Goerli Testnet

Contract

0xF73Bc3Fa2f6F774D4b6791414B1092a40Cd83831
Source Code

Overview

ETH Balance

0 ETH

Token Holdings

Multi Chain

Multichain Addresses

N/A
Transaction Hash
Method
Block
From
To
Value
Register77927572022-10-18 19:59:00413 days 22 hrs ago1666123140IN
0xF73Bc3...0Cd83831
0 ETH0.000030681.00408745
Register77927202022-10-18 19:50:12413 days 22 hrs ago1666122612IN
0xF73Bc3...0Cd83831
0 ETH0.000031311.02082502
Register77927052022-10-18 19:46:12413 days 22 hrs ago1666122372IN
0xF73Bc3...0Cd83831
0 ETH0.000031471.02959583
Register77257622022-10-07 4:20:00425 days 14 hrs ago1665116400IN
0xF73Bc3...0Cd83831
0.01 ETH0.000030411.00000001
Register77257412022-10-07 4:14:36425 days 14 hrs ago1665116076IN
0xF73Bc3...0Cd83831
0.01 ETH0.000023261.00000001
Transfer76830552022-09-29 23:15:48432 days 19 hrs ago1664493348IN
0xF73Bc3...0Cd83831
0.1 ETH0.00003151.50000279
0x60c0604076487952022-09-24 3:03:12438 days 15 hrs ago1663988592IN
 Create: NameRegistry
0 ETH0.014050933

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
96032582023-08-29 21:28:3698 days 21 hrs ago1693344516
0xF73Bc3...0Cd83831
0 ETH
96028322023-08-29 19:42:3698 days 22 hrs ago1693338156
0xF73Bc3...0Cd83831
0 ETH
96027972023-08-29 19:33:0098 days 22 hrs ago1693337580
0xF73Bc3...0Cd83831
0 ETH
96022922023-08-29 17:23:1299 days 1 hr ago1693329792
0xF73Bc3...0Cd83831
0 ETH
96022382023-08-29 17:10:2499 days 1 hr ago1693329024
0xF73Bc3...0Cd83831
0 ETH
96022332023-08-29 17:08:4899 days 1 hr ago1693328928
0xF73Bc3...0Cd83831
0 ETH
96021962023-08-29 16:58:3699 days 1 hr ago1693328316
0xF73Bc3...0Cd83831
0 ETH
96020712023-08-29 16:23:2499 days 2 hrs ago1693326204
0xF73Bc3...0Cd83831
0 ETH
96019732023-08-29 15:58:0099 days 2 hrs ago1693324680
0xF73Bc3...0Cd83831
0 ETH
96018352023-08-29 15:24:2499 days 3 hrs ago1693322664
0xF73Bc3...0Cd83831
0 ETH
96018202023-08-29 15:20:2499 days 3 hrs ago1693322424
0xF73Bc3...0Cd83831
0 ETH
96014572023-08-29 13:48:0099 days 4 hrs ago1693316880
0xF73Bc3...0Cd83831
0 ETH
96013582023-08-29 13:24:2499 days 5 hrs ago1693315464
0xF73Bc3...0Cd83831
0 ETH
96013542023-08-29 13:23:3699 days 5 hrs ago1693315416
0xF73Bc3...0Cd83831
0 ETH
96012742023-08-29 13:04:4899 days 5 hrs ago1693314288
0xF73Bc3...0Cd83831
0 ETH
96012232023-08-29 12:51:0099 days 5 hrs ago1693313460
0xF73Bc3...0Cd83831
0 ETH
96010522023-08-29 12:08:3699 days 6 hrs ago1693310916
0xF73Bc3...0Cd83831
0 ETH
96010302023-08-29 12:03:2499 days 6 hrs ago1693310604
0xF73Bc3...0Cd83831
0 ETH
96009042023-08-29 11:33:1299 days 6 hrs ago1693308792
0xF73Bc3...0Cd83831
0 ETH
96008292023-08-29 11:14:4899 days 7 hrs ago1693307688
0xF73Bc3...0Cd83831
0 ETH
96007392023-08-29 10:52:2499 days 7 hrs ago1693306344
0xF73Bc3...0Cd83831
0 ETH
96006272023-08-29 10:24:3699 days 8 hrs ago1693304676
0xF73Bc3...0Cd83831
0 ETH
96006152023-08-29 10:21:1299 days 8 hrs ago1693304472
0xF73Bc3...0Cd83831
0 ETH
96005502023-08-29 10:05:3699 days 8 hrs ago1693303536
0xF73Bc3...0Cd83831
0 ETH
96004942023-08-29 9:52:0099 days 8 hrs ago1693302720
0xF73Bc3...0Cd83831
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NameRegistry

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 21 : NameRegistry.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.16;

import {AccessControlUpgradeable} from "openzeppelin-upgradeable/contracts/access/AccessControlUpgradeable.sol";
import {ContextUpgradeable} from "openzeppelin-upgradeable/contracts/utils/ContextUpgradeable.sol";
import {ERC2771ContextUpgradeable} from "openzeppelin-upgradeable/contracts/metatx/ERC2771ContextUpgradeable.sol";
import {ERC721Upgradeable} from "openzeppelin-upgradeable/contracts/token/ERC721/ERC721Upgradeable.sol";
import {Initializable} from "openzeppelin-upgradeable/contracts/proxy/utils/Initializable.sol";
import {PausableUpgradeable} from "openzeppelin-upgradeable/contracts/security/PausableUpgradeable.sol";
import {UUPSUpgradeable} from "openzeppelin-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";

import {FixedPointMathLib} from "solmate/src/utils/FixedPointMathLib.sol";

/**
 * @title NameRegistry
 * @author varunsrin
 * @custom:version 2.0.0
 *
 * @notice NameRegistry enables any ETH address to claim a Farcaster Name (fname). A name is a
 *         rentable ERC-721 that can be registered for one year by paying a fee. On expiry, the
 *         owner has 30 days to renew the name by paying a fee, or it is placed in a dutch
 *         auction. The NameRegistry starts in a trusted mode where only a trusted caller can
 *         register an fname and can move to an untrusted mode where any address can register an
 *         fname. The Registry implements a recovery system which allows the custody address to
 *         nominate a recovery address that can transfer the fname to a new address after a delay.
 */
contract NameRegistry is
    Initializable,
    ERC721Upgradeable,
    ERC2771ContextUpgradeable,
    AccessControlUpgradeable,
    PausableUpgradeable,
    UUPSUpgradeable
{
    using FixedPointMathLib for uint256;

    /*//////////////////////////////////////////////////////////////
                                 ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @dev Revert when there are not enough funds to complete the transaction
    error InsufficientFunds();

    /// @dev Revert when the caller does not have the authority to perform the action
    error Unauthorized();

    /// @dev Revert if the caller does not have ADMIN_ROLE
    error NotAdmin();

    /// @dev Revert if the caller does not have OPERATOR_ROLE
    error NotOperator();

    /// @dev Revert if the caller does not have MODERATOR_ROLE
    error NotModerator();

    /// @dev Revert if the caller does not have TREASURER_ROLE
    error NotTreasurer();
    /// @dev Revert when excess funds could not be sent back to the caller
    error CallFailed();

    /// @dev Revert when the commit hash is not found
    error InvalidCommit();

    /// @dev Revert when a commit is re-submitted before it has expired
    error CommitReplay();

    /// @dev Revert if the fname has invalid characters during registration
    error InvalidName();

    /// @dev Revert if renew() is called on a registered name.
    error Registered();

    /// @dev Revert if an operation is called on a name that hasn't been minted
    error Registrable();

    /// @dev Revert if makeCommit() is invoked before trustedCallerOnly is disabled
    error Invitable();

    /// @dev Revert if trustedRegister() is invoked after trustedCallerOnly is disabled
    error NotInvitable();

    /// @dev Revert if the fname being operated on is renewable or biddable
    error Expired();

    /// @dev Revert if renew() is called after the fname becomes Biddable
    error NotRenewable();

    /// @dev Revert if bid() is called on an fname that has not become Biddable.
    error NotBiddable();

    /// @dev Revert when completeRecovery() is called before the escrow period has elapsed.
    error Escrow();

    /// @dev Revert if a recovery operation is called when there is no active recovery.
    error NoRecovery();

    /// @dev Revert if the recovery address is set to address(0).
    error InvalidRecovery();

    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev Emit an event when a Farcaster Name is renewed for another year.
     *
     * @param tokenId The uint256 representation of the fname
     * @param expiry  The timestamp at which the renewal expires
     */
    event Renew(uint256 indexed tokenId, uint256 expiry);

    /**
     * @dev Emit an event when a user invites another user to register a Farcaster Name
     *
     * @param inviterId The fid of the user with the invite
     * @param inviteeId The fid of the user receiving the invite
     * @param fname     The fname that was registered by the invitee
     */
    event Invite(uint256 indexed inviterId, uint256 indexed inviteeId, bytes16 indexed fname);

    /**
     * @dev Emit an event when a Farcaster Name's recovery address is updated
     *
     * @param tokenId  The uint256 representation of the fname being updated
     * @param recovery The new recovery address
     */
    event ChangeRecoveryAddress(uint256 indexed tokenId, address indexed recovery);

    /**
     * @dev Emit an event when a recovery request is initiated for a Farcaster Name
     *
     * @param from     The custody address of the fname being recovered.
     * @param to       The destination address for the fname when the recovery is completed.
     * @param tokenId  The uint256 representation of the fname being recovered
     */
    event RequestRecovery(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emit an event when a recovery request is cancelled
     *
     * @param by      The address that cancelled the recovery request
     * @param tokenId The uint256 representation of the fname
     */
    event CancelRecovery(address indexed by, uint256 indexed tokenId);

    /**
     * @dev Emit an event when the trusted caller is modified
     *
     * @param trustedCaller The address of the new trusted caller.
     */
    event ChangeTrustedCaller(address indexed trustedCaller);

    /**
     * @dev Emit an event when the trusted only state is disabled.
     */
    event DisableTrustedOnly();

    /**
     * @dev Emit an event when the vault address is modified
     *
     * @param vault The address of the new vault.
     */
    event ChangeVault(address indexed vault);

    /**
     * @dev Emit an event when the pool address is modified
     *
     * @param pool The address of the new pool.
     */
    event ChangePool(address indexed pool);

    /**
     * @dev Emit an event when the fee is changed
     *
     * @param fee The new yearly registration fee
     */
    event ChangeFee(uint256 fee);

    /*//////////////////////////////////////////////////////////////
                                 STORAGE
    //////////////////////////////////////////////////////////////*/

    /// WARNING - DO NOT CHANGE THE ORDER OF THESE VARIABLES ONCE DEPLOYED
    /// Changes should be replicated to NameRegistryV2 in NameRegistryUpdate.t.sol

    // Audit: These variables are kept public to make it easier to test the contract, since using
    // the same inherit and extend trick that we used for IdRegistry is harder to pull off here
    //  due to the UUPS structure.

    /**
     * @notice The fee to renew a name for a full calendar year
     * @dev    Occupies slot 0.
     */
    uint256 public fee;

    /**
     * @notice The address controlled by the Farcaster Invite service that is allowed to call
     *         trustedRegister
     * @dev    Occupies slot 1
     */
    address public trustedCaller;

    /**
     * @notice Flag that determines if registration can occur through trustedRegister or register
     * @dev    Occupies slot 2, initialized to 1 and can only be changed to zero
     */
    uint256 public trustedOnly;

    /**
     * @notice Maps each commit to the timestamp at which it was created.
     * @dev    Occupies slot 3
     */
    mapping(bytes32 => uint256) public timestampOf;

    /**
     * @notice Maps each uint256 representation of an fname to the time at which it expires
     * @dev    Occupies slot 4
     */
    mapping(uint256 => uint256) public expiryOf;

    /**
     * @notice The address that funds can be withdrawn to
     * @dev    Occupies slot 5
     */
    address public vault;

    /**
     * @notice The address that names can be reclaimed to
     * @dev    Occupies slot 6
     */
    address public pool;

    /**
     * @notice Maps each uint256 representation of an fname to the address that can recover it
     * @dev    Occupies slot 7
     */
    mapping(uint256 => address) public recoveryOf;

    /**
     * @notice Maps each uint256 representation of an fname to the timestamp of the recovery
     *         attempt or zero if there is no active recovery.
     * @dev    Occupies slot 8
     */
    mapping(uint256 => uint256) public recoveryClockOf;

    /**
     * @notice Maps each uint256 representation of an fname to the destination address of the most
     *         recent recovery attempt.
     * @dev    Occupies slot 9, and the value is left dirty after a recovery to save gas and should
     *         not be relied upon to check if there is an active recovery.
     */
    mapping(uint256 => address) public recoveryDestinationOf;

    /**
     * @dev Added to allow future versions to add new variables in case this contract becomes
     *      inherited. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[40] private __gap;

    /*//////////////////////////////////////////////////////////////
                                CONSTANTS
    //////////////////////////////////////////////////////////////*/

    string internal constant BASE_URI = "http://www.farcaster.xyz/u/";

    /// @dev enforced delay between makeCommit() and register() to prevent front-running
    uint256 internal constant REVEAL_DELAY = 60 seconds;

    /// @dev enforced delay in makeCommit() to prevent griefing by replaying the commit
    uint256 internal constant COMMIT_REPLAY_DELAY = 10 minutes;

    uint256 internal constant REGISTRATION_PERIOD = 365 days;

    uint256 internal constant RENEWAL_PERIOD = 30 days;

    uint256 internal constant ESCROW_PERIOD = 3 days;

    /// @dev Starting price of every bid during the first period
    uint256 internal constant BID_START_PRICE = 1000 ether;

    /// @dev 60.18-decimal fixed-point that decreases the price by 10% when multiplied
    uint256 internal constant BID_PERIOD_DECREASE_UD60X18 = 0.9 ether;

    /// @dev 60.18-decimal fixed-point that approximates divide by 28,800 when multiplied
    uint256 internal constant DIV_28800_UD60X18 = 3.4722222222222e13;

    bytes32 internal constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    bytes32 internal constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");

    bytes32 internal constant MODERATOR_ROLE = keccak256("MODERATOR_ROLE");

    bytes32 internal constant TREASURER_ROLE = keccak256("TREASURER_ROLE");

    uint256 internal constant INITIAL_FEE = 0.01 ether;

    /*//////////////////////////////////////////////////////////////
                      CONSTRUCTORS AND INITIALIZERS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Disable initialization to protect the contract and configure the trusted forwarder.
     */
    // solhint-disable-next-line no-empty-blocks
    constructor(address _forwarder) ERC2771ContextUpgradeable(_forwarder) {
        // Audit: Is this the safest way to prevent contract initialization attacks?
        // See: https://twitter.com/z0age/status/1551951489354145795
        _disableInitializers();
    }

    /**
     * @notice Initialize default storage values and initialize inherited contracts. This should be
     *         called once after the contract is deployed via the ERC1967 proxy. Slither incorrectly flags
     *         this method as unprotected: https://github.com/crytic/slither/issues/1341
     *
     * @param _tokenName   The ERC-721 name of the fname token
     * @param _tokenSymbol The ERC-721 symbol of the fname token
     * @param _vault       The address that funds can be withdrawn to
     * @param _pool        The address that fnames can be reclaimed to
     */
    function initialize(
        string calldata _tokenName,
        string calldata _tokenSymbol,
        address _vault,
        address _pool
    ) external initializer {
        __ERC721_init(_tokenName, _tokenSymbol);

        __Pausable_init();

        __AccessControl_init();

        __UUPSUpgradeable_init();

        // Grant the DEFAULT_ADMIN_ROLE to the deployer, which can configure other roles
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());

        vault = _vault;
        emit ChangeVault(_vault);

        pool = _pool;
        emit ChangePool(_pool);

        fee = INITIAL_FEE;
        emit ChangeFee(INITIAL_FEE);

        trustedOnly = 1;
    }

    /*//////////////////////////////////////////////////////////////
                           REGISTRATION LOGIC
    //////////////////////////////////////////////////////////////*/

    /**
     * INVARIANT 1A: If an id is not minted, expiryOf[id] must be 0 and ownerOf(id) and
     *               recoveryOf[id] must also be address(0).
     *
     * INVARIANT 1B: If an id is minted, expiryOf[id] and ownerOf(id) must be non-zero.
     *
     * INVARIANT 2: An fname cannot be transferred to address(0) after it is minted.
     */

    /**
     * @notice Generate a commitment that is used as part of a commit-reveal scheme to register a
     *         an fname while protecting the registration from being front-run.
     *
     * @param fname  The fname to be registered
     * @param to     The address that will own the fname
     * @param secret A secret that is known only to the caller
     */
    function generateCommit(
        bytes16 fname,
        address to,
        bytes32 secret,
        address recovery
    ) public pure returns (bytes32 commit) {
        // Perf: Do not validate to != address(0) because it happens during register/mint

        _validateName(fname);

        commit = keccak256(abi.encode(fname, to, recovery, secret));
    }

    /**
     * @notice Save a commitment on-chain which can be revealed later to register an fname while
     *         protecting the registration from being front-run. This is allowed even when the
     *         contract is paused.
     *
     * @param commit The commitment hash to be persisted on-chain
     */
    function makeCommit(bytes32 commit) external {
        if (trustedOnly == 1) revert Invitable();

        unchecked {
            // Safety: timestampOf is always set to block.timestamp and cannot overflow here

            // Commits cannot be re-submitted immediately to prevent griefing by re-submitting commits
            // to reset the REVEAL_DELAY clock
            if (block.timestamp <= timestampOf[commit] + COMMIT_REPLAY_DELAY) revert CommitReplay();
        }

        // Save the commit and start the REVEAL_DELAY clock
        timestampOf[commit] = block.timestamp;
    }

    /**
     * @notice Mint a new fname if the inputs match a previous commit and if it was called at least
     *         60 seconds after the commit's timestamp to prevent frontrunning within the same block.
     *         It fails when paused because it invokes _mint which in turn invokes beforeTransfer()
     *
     * @param fname    The fname to register
     * @param to       The address that will own the fname
     * @param secret   The secret value in the commitment
     * @param recovery The address which can recovery the fname if the custody address is lost
     */
    function register(
        bytes16 fname,
        address to,
        bytes32 secret,
        address recovery
    ) external payable {
        bytes32 commit = generateCommit(fname, to, secret, recovery);

        uint256 _fee = fee;
        if (msg.value < _fee) revert InsufficientFunds();

        // Perf: do not check if trustedOnly = 1, because timestampOf[commit] will always be zero
        // while trustedOnly = 1 since makeCommit cannot be called.
        uint256 commitTs = timestampOf[commit];
        if (commitTs == 0) revert InvalidCommit();

        unchecked {
            // Audit: verify that 60s is the right duration to use
            // Safety: makeCommit() sets commitTs to block.timestamp which cannot overflow
            if (block.timestamp < commitTs + REVEAL_DELAY) revert InvalidCommit();
        }

        // ERC-721's require a unique token number for each fname token, and we calculate this by
        // converting the byte16 representation into a uint256
        uint256 tokenId = uint256(bytes32(fname));

        // Mint checks that to != address(0) and that the tokenId wasn't previously issued
        _mint(to, tokenId);

        // Clearing unnecessary storage reduces gas consumption
        delete timestampOf[commit];

        unchecked {
            // Safety: expiryOf will not overflow given the expected sizes of block.timestamp
            expiryOf[tokenId] = block.timestamp + REGISTRATION_PERIOD;
        }

        recoveryOf[tokenId] = recovery;

        uint256 overpayment;

        unchecked {
            // Safety: msg.value >= _fee by check above, so this cannot overflow
            overpayment = msg.value - _fee;
        }

        if (overpayment > 0) {
            // Perf: Call msg.sender instead of _msgSender() to save ~100 gas b/c we don't need meta-tx
            // solhint-disable-next-line avoid-low-level-calls
            (bool success, ) = msg.sender.call{value: overpayment}("");
            if (!success) revert CallFailed();
        }
    }

    /**
     * @notice Mint a fname during the invitation period from the trusted caller.
     *
     * @dev The function is pauseable since it invokes _transfer by way of _mint.
     *
     * @param to the address that will claim the fname
     * @param fname the fname to register
     * @param recovery address which can recovery the fname if the custody address is lost
     * @param inviter the fid of the user who invited the new user to get an fname
     * @param invitee the fid of the user who was invited to get an fname
     */
    function trustedRegister(
        bytes16 fname,
        address to,
        address recovery,
        uint256 inviter,
        uint256 invitee
    ) external payable {
        // Trusted Register can only be called during the invite period (when trustedOnly = 1)
        if (trustedOnly == 0) revert NotInvitable();

        // Call msg.sender instead of _msgSender() to prevent meta-txns and allow the function
        // to be called by BatchRegistry. This also saves ~100 gas.
        if (msg.sender != trustedCaller) revert Unauthorized();

        // Perf: this can be omitted to save ~3k gas if we believe that the trusted caller will
        // never call this function with an invalid fname.
        _validateName(fname);

        // Mint checks that to != address(0) and that the tokenId wasn't previously issued
        uint256 tokenId = uint256(bytes32(fname));
        _mint(to, tokenId);

        unchecked {
            // Safety: expiryOf will not overflow given the expected sizes of block.timestamp
            expiryOf[tokenId] = block.timestamp + REGISTRATION_PERIOD;
        }

        recoveryOf[tokenId] = recovery;

        emit Invite(inviter, invitee, fname);
    }

    /**
     * @notice Renew a name for another year while it is in the renewable period.
     *
     * @param tokenId The uint256 representation of the fname to renew
     */
    function renew(uint256 tokenId) external payable whenNotPaused {
        uint256 _fee = fee;
        if (msg.value < _fee) revert InsufficientFunds();

        // Check that the tokenID was previously registered
        uint256 expiryTs = expiryOf[tokenId];
        if (expiryTs == 0) revert Registrable();

        // tokenID is not owned by address(0) because of INVARIANT 1B + 2

        // Check that we are still in the renewable period, and have not passed into biddable
        unchecked {
            // Safety: expiryTs is a timestamp of a known calendar year and cannot overflow
            if (block.timestamp >= expiryTs + RENEWAL_PERIOD) revert NotRenewable();
        }

        if (block.timestamp < expiryTs) revert Registered();

        expiryOf[tokenId] = block.timestamp + REGISTRATION_PERIOD;

        emit Renew(tokenId, expiryOf[tokenId]);

        uint256 overpayment;

        unchecked {
            // Safety: msg.value >= _fee by check above, so this cannot overflow
            overpayment = msg.value - _fee;
        }

        if (overpayment > 0) {
            // Perf: Call msg.sender instead of _msgSender() to save ~100 gas b/c we don't need meta-tx
            // solhint-disable-next-line avoid-low-level-calls
            (bool success, ) = msg.sender.call{value: overpayment}("");
            if (!success) revert CallFailed();
        }
    }

    /**
     * @notice Bid to purchase an expired fname in a dutch auction and register it through the end
     *         of the calendar year. The winning bid starts at ~1000.01 ETH on Feb 1st and decays
     *         exponentially until it reaches 0 at the end of Dec 31st.
     *
     * @param to       The address where the fname should be transferred
     * @param tokenId  The uint256 representation of the fname to bid on
     * @param recovery The address which can recovery the fname if the custody address is lost
     */
    function bid(
        address to,
        uint256 tokenId,
        address recovery
    ) external payable {
        // Check that the tokenID was previously registered
        uint256 expiryTs = expiryOf[tokenId];
        if (expiryTs == 0) revert Registrable();

        uint256 auctionStartTimestamp;

        unchecked {
            // Safety: expiryTs is a timestamp of a known calendar year and adding it to
            // RENEWAL_PERIOD cannot overflow
            auctionStartTimestamp = expiryTs + RENEWAL_PERIOD;
        }

        if (block.timestamp < auctionStartTimestamp) revert NotBiddable();

        uint256 price;

        /**
         * The price to win a bid is calculated with formula price = dutch_premium + renewal_fee,
         * where the dutch_premium starts at 1,000 ETH and decreases exponentially by 10% every
         * 8 hours after bidding starts.
         *
         * dutch_premium = 1000 ether * (0.9)^(periods), where:
         * periods = (block.timestamp - auctionStartTimestamp) / 28_800
         *
         * Periods are calculated with fixed-point multiplication which causes a slight error
         * that increases the price (DivErr), while dutch_premium is calculated with the identity
         * (x^y = exp(ln(x) * y)) which truncates 3 digits of precision and slightly lowers the
         * price (ExpErr).
         *
         * The two errors interact in different ways keeping the price slightly higher or lower
         * than expected as shown below:
         *
         * +=========+======================+========================+========================+
         * | Periods |        NoErr         |         DivErr         |    PowErr + DivErr     |
         * +=========+======================+========================+========================+
         * |       1 |                900.0 | 900.000000000000606876 | 900.000000000000606000 |
         * +---------+----------------------+------------------------+------------------------+
         * |      10 |          348.6784401 | 348.678440100002351164 | 348.678440100002351000 |
         * +---------+----------------------+------------------------+------------------------+
         * |     100 | 0.026561398887587476 |   0.026561398887589867 |   0.026561398887589000 |
         * +---------+----------------------+------------------------+------------------------+
         * |     393 | 0.000000000000001040 |   0.000000000000001040 |   0.000000000000001000 |
         * +---------+----------------------+------------------------+------------------------+
         * |     394 |                  0.0 |                    0.0 |                    0.0 |
         * +---------+----------------------+------------------------+------------------------+
         *
         */

        unchecked {
            // Safety: cannot underflow because auctionStartTimestamp <= block.timestamp and cannot
            // overflow because block.timestamp - auctionStartTimestamp realistically will stay
            // under 10^10 for the next 50 years, which can be safely multiplied with
            // DIV_28800_UD60X18
            int256 periodsSD59x18 = int256((block.timestamp - auctionStartTimestamp) * DIV_28800_UD60X18);

            // Perf: Precomputing common values might save gas but at the expense of storage which
            // is our biggest constraint and so it was discarded.

            // Safety/Audit: the below cannot intuitively underflow or overflow given the ranges,
            // but needs proof
            price =
                BID_START_PRICE.mulWadDown(
                    uint256(FixedPointMathLib.powWad(int256(BID_PERIOD_DECREASE_UD60X18), periodsSD59x18))
                ) +
                fee;
        }

        if (msg.value < price) revert InsufficientFunds();

        // call super.ownerOf instead of ownerOf, because the latter reverts if name is expired
        _transfer(super.ownerOf(tokenId), to, tokenId);

        unchecked {
            // Safety: expiryOf will not overflow given the expected sizes of block.timestamp
            expiryOf[tokenId] = block.timestamp + REGISTRATION_PERIOD;
        }

        recoveryOf[tokenId] = recovery;

        uint256 overpayment;

        unchecked {
            // Safety: msg.value >= price by check above, so this cannot underflow
            overpayment = msg.value - price;
        }

        if (overpayment > 0) {
            // Perf: Call msg.sender instead of _msgSender() to save ~100 gas b/c we don't need meta-tx
            // solhint-disable-next-line avoid-low-level-calls
            (bool success, ) = msg.sender.call{value: overpayment}("");
            if (!success) revert CallFailed();
        }
    }

    /*//////////////////////////////////////////////////////////////
                            ERC-721 OVERRIDES
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Override the ownerOf implementation to throw if an fname is renewable or biddable.
     *
     * @param tokenId The uint256 representation of the fname to check
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        uint256 expiryTs = expiryOf[tokenId];

        if (expiryTs != 0 && block.timestamp >= expiryTs) revert Expired();

        // Assumption: If the token is unregistered, super.ownerOf will revert
        return super.ownerOf(tokenId);
    }

    /**
     * Audit: ERC721 balanceOf will over report the balance of the owner even if the name is expired.
     */

    /**
     * @notice Override transferFrom to throw if the name is renewable or biddable.
     *
     * @param from    The address which currently holds the fname
     * @param to      The address to transfer the fname to
     * @param tokenId The uint256 representation of the fname to transfer
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        uint256 expiryTs = expiryOf[tokenId];

        // Expired names should not be transferrable by the previous owner
        if (expiryTs != 0 && block.timestamp >= expiryOf[tokenId]) revert Expired();

        super.transferFrom(from, to, tokenId);
    }

    /**
     * @notice Override safeTransferFrom to throw if the name is renewable or biddable.
     *
     * @param from     The address which currently holds the fname
     * @param to       The address to transfer the fname to
     * @param tokenId  The uint256 representation of the fname to transfer
     * @param data     Additional data with no specified format, sent in call to `to`
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public override {
        uint256 expiryTs = expiryOf[tokenId];

        // Expired names should not be transferrable by the previous owner
        if (expiryTs != 0 && block.timestamp >= expiryOf[tokenId]) revert Expired();

        super.safeTransferFrom(from, to, tokenId, data);
    }

    /**
     * @notice Return a distinct Uniform Resource Identifier (URI) for a given tokenId even if it
     *         is not registered. Throws if the tokenId cannot be converted to a valid fname.
     *
     * @param tokenId The uint256 representation of the fname
     */
    function tokenURI(uint256 tokenId) public pure override returns (string memory) {
        uint256 lastCharIdx;

        // Safety: fnames are byte16's that are cast to uint256 tokenIds, so inverting this is safe
        bytes16 fname = bytes16(bytes32(tokenId));

        _validateName(fname);

        // Step back from the last byte to find the first non-zero byte
        for (uint256 i = 15; ; ) {
            if (uint8(fname[i]) != 0) {
                lastCharIdx = i;
                break;
            }

            unchecked {
                // Safety: i cannot underflow because the loop terminates when i == 0
                --i;
            }
        }

        // Safety: this non-zero byte must exist at some position because of _validateName and
        // therefore lastCharIdx must be > 1

        // Construct a new bytes[] with the valid fname characters.
        bytes memory fnameBytes = new bytes(lastCharIdx + 1);

        for (uint256 j = 0; j <= lastCharIdx; ) {
            fnameBytes[j] = fname[j];

            unchecked {
                // Safety: j cannot overflow because the loop terminates when j > lastCharIdx
                ++j;
            }
        }

        return string(abi.encodePacked(BASE_URI, string(fnameBytes), ".json"));
    }

    /**
     * @dev Hook that ensures that token transfers cannot occur when the contract is paused.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override whenNotPaused {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Hook that ensures that recovery address is reset whenever a transfer occurs.
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override {
        super._afterTokenTransfer(from, to, tokenId);

        // Checking state before clearing is more gas-efficient than always clearing
        if (recoveryClockOf[tokenId] != 0) delete recoveryClockOf[tokenId];
        delete recoveryOf[tokenId];
    }

    /*//////////////////////////////////////////////////////////////
                             RECOVERY LOGIC
    //////////////////////////////////////////////////////////////*/

    /**
     * The custodyAddress (i.e. owner) can appoint a recoveryAddress which can transfer a
     * specific fname if the custodyAddress is lost. The recovery address must first request the
     * transfer on-chain which moves it into escrow. If the custodyAddress does not cancel
     * the request during escrow, the recoveryAddress can then transfer the fname. The custody
     * address can remove or change the recovery address at any time.
     *
     * INVARIANT 3: Changing ownerOf must set recoveryOf to address(0) and recoveryClockOf[id] to 0
     *
     * INVARIANT 4: If recoveryClockOf is non-zero, then recoveryDestinationOf is a non-zero address.
     */

    /**
     * @notice Change the recovery address of the fname and reset any active recovery requests.
     *         Supports ERC 2771 meta-transactions and can be called by a relayer.
     *
     * @param tokenId  The uint256 representation of the fname
     * @param recovery The address which can recover the fname (set to 0x0 to disable recovery)
     */
    function changeRecoveryAddress(uint256 tokenId, address recovery) external whenNotPaused {
        if (ownerOf(tokenId) != _msgSender()) revert Unauthorized();

        recoveryOf[tokenId] = recovery;

        // Perf: clear any active recovery requests, but check if they exist before deleting
        // because this usually already zero
        if (recoveryClockOf[tokenId] != 0) delete recoveryClockOf[tokenId];

        emit ChangeRecoveryAddress(tokenId, recovery);
    }

    /**
     * @notice Request a recovery of an fid to a new address if the caller is the recovery address.
     *         Supports ERC 2771 meta-transactions and can be called by a relayer. Requests can be
     *         overwritten by making another request.
     *
     * @param tokenId The uint256 representation of the fname
     * @param to      The address to transfer the fname to, which cannot be address(0)
     */
    function requestRecovery(uint256 tokenId, address to) external whenNotPaused {
        if (to == address(0)) revert InvalidRecovery();

        // Invariant 3 ensures that a request cannot be made after ownership change without consent
        if (_msgSender() != recoveryOf[tokenId]) revert Unauthorized();

        // Perf: don't check if in renewable or biddable state since it saves gas and
        // completeRecovery will revert when it runs

        // Track when the escrow period started
        recoveryClockOf[tokenId] = block.timestamp;

        // Store the final destination so that it cannot be modified unless completed or cancelled
        recoveryDestinationOf[tokenId] = to;

        // Perf: Gas costs can be reduced by omitting the from param, at the cost of breaking
        // compatibility with the IdRegistry's RequestRecovery event
        emit RequestRecovery(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @notice Complete a recovery request and transfer the fname if the caller is the recovery
     *         address and the escrow period has passed. Supports ERC 2771 meta-transactions and
     *         can be called by a relayer. Cannot be called when paused because _transfer reverts.
     *
     * @param tokenId The uint256 representation of the fname
     */
    function completeRecovery(uint256 tokenId) external {
        if (block.timestamp >= expiryOf[tokenId]) revert Expired();

        // Invariant 3 ensures that a request cannot be completed after ownership change without consent
        if (_msgSender() != recoveryOf[tokenId]) revert Unauthorized();

        uint256 _recoveryClock = recoveryClockOf[tokenId];
        if (_recoveryClock == 0) revert NoRecovery();

        unchecked {
            // Safety: _recoveryClock is always set to block.timestamp and cannot realistically overflow
            if (block.timestamp < _recoveryClock + ESCROW_PERIOD) revert Escrow();
        }

        // Assumption: Invariant 4 prevents this from going to address(0).
        _transfer(ownerOf(tokenId), recoveryDestinationOf[tokenId], tokenId);
    }

    /**
     * @notice Cancel an active recovery request if the caller is the recovery address or the
     *         custody address. Supports ERC 2771 meta-transactions and can be called by a relayer.
     *         Can be called even if the contract is paused to avoid griefing before a known pause.
     *
     * @param tokenId The uint256 representation of the fname
     */
    function cancelRecovery(uint256 tokenId) external {
        address sender = _msgSender();

        // Perf: super.ownerOf is called instead of ownerOf since cancellation has no undesirable
        // side effects when expired and it saves some gas.
        if (sender != super.ownerOf(tokenId) && sender != recoveryOf[tokenId]) revert Unauthorized();

        // Check if there is a recovery to avoid emitting incorrect CancelRecovery events
        if (recoveryClockOf[tokenId] == 0) revert NoRecovery();

        // Clear the recovery request so that it cannot be completed
        delete recoveryClockOf[tokenId];

        emit CancelRecovery(sender, tokenId);
    }

    /*//////////////////////////////////////////////////////////////
                            MODERATOR ACTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Move the fname from the current owner to the pool and renew it for another year.
     *         Does not work when paused because it calls _transfer.
     *
     * @param tokenId the uint256 representation of the fname.
     */
    function reclaim(uint256 tokenId) external payable {
        // call msg.sender instead of _msgSender() since we don't need meta-tx for admin actions
        // and it reduces our attack surface area
        if (!hasRole(MODERATOR_ROLE, msg.sender)) revert NotModerator();

        uint256 _expiry = expiryOf[tokenId];

        // If an fname hasn't been minted, it should be minted instead of reclaimed
        if (_expiry == 0) revert Registrable();

        // Call super.ownerOf instead of ownerOf because we want the admin to transfer the name
        // even if is expired and there is no current owner.
        _transfer(super.ownerOf(tokenId), pool, tokenId);

        // If an fname expires in the near future, extend its registration by the renewal period
        if (block.timestamp >= _expiry - RENEWAL_PERIOD) {
            expiryOf[tokenId] = block.timestamp + RENEWAL_PERIOD;
        }
    }

    /*//////////////////////////////////////////////////////////////
                              ADMIN ACTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Changes the address from which registerTrusted calls can be made
     *
     * @param _trustedCaller The address of the new trusted caller
     */
    function changeTrustedCaller(address _trustedCaller) external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(ADMIN_ROLE, msg.sender)) revert NotAdmin();
        trustedCaller = _trustedCaller;
        emit ChangeTrustedCaller(_trustedCaller);
    }

    /**
     * @notice Disables registerTrusted and enables register calls from any address.
     */
    function disableTrustedOnly() external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(ADMIN_ROLE, msg.sender)) revert NotAdmin();
        delete trustedOnly;
        emit DisableTrustedOnly();
    }

    /**
     * @notice Changes the address to which funds can be withdrawn
     *
     * @param _vault The address of the new vault
     */
    function changeVault(address _vault) external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(ADMIN_ROLE, msg.sender)) revert NotAdmin();
        vault = _vault;
        emit ChangeVault(_vault);
    }

    /**
     * @notice Changes the address to which names are reclaimed
     *
     * @param _pool The address of the new pool
     */
    function changePool(address _pool) external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(ADMIN_ROLE, msg.sender)) revert NotAdmin();
        pool = _pool;
        emit ChangePool(_pool);
    }

    /*//////////////////////////////////////////////////////////////
                            TREASURER ACTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Change the fee charged to register an fname for a full year
     *
     * @param _fee The new yearly fee
     */
    function changeFee(uint256 _fee) external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(TREASURER_ROLE, msg.sender)) revert NotTreasurer();

        // Audit does fee == 0 cause any problems with other logic?
        fee = _fee;
        emit ChangeFee(_fee);
    }

    /**
     * @notice Withdraw a specified amount of ether to the vault
     *
     * @param amount The amount of ether to withdraw
     */
    function withdraw(uint256 amount) external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(TREASURER_ROLE, msg.sender)) revert NotTreasurer();

        // Audit: this will not revert if the requested amount is zero, will that cause problems?
        if (address(this).balance < amount) revert InsufficientFunds();

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, ) = vault.call{value: amount}("");
        if (!success) revert CallFailed();
    }

    /*//////////////////////////////////////////////////////////////
                            OPERATOR ACTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice pause the contract and prevent registrations, renewals, recoveries and transfers of names.
     */
    function pause() external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(OPERATOR_ROLE, msg.sender)) revert NotOperator();
        _pause();
    }

    /**
     * @notice unpause the contract and resume registrations, renewals, recoveries and transfers of names.
     */
    function unpause() external {
        // avoid _msgSender() since meta-tx are unnecessary here and increase attack surface area
        if (!hasRole(OPERATOR_ROLE, msg.sender)) revert NotOperator();
        _unpause();
    }

    /*//////////////////////////////////////////////////////////////
                         OPEN ZEPPELIN OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function _msgSender()
        internal
        view
        override(ContextUpgradeable, ERC2771ContextUpgradeable)
        returns (address sender)
    {
        sender = ERC2771ContextUpgradeable._msgSender();
    }

    function _msgData() internal view override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {
        return ERC2771ContextUpgradeable._msgData();
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(AccessControlUpgradeable, ERC721Upgradeable)
        returns (bool)
    {
        return ERC721Upgradeable.supportsInterface(interfaceId);
    }

    // solhint-disable-next-line no-empty-blocks
    function _authorizeUpgrade(address) internal view override {
        if (!hasRole(ADMIN_ROLE, _msgSender())) revert NotAdmin();
    }

    /*//////////////////////////////////////////////////////////////
                             INTERNAL LOGIC
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev Reverts if the name contains an invalid fname character
     */
    // solhint-disable-next-line code-complexity
    function _validateName(bytes16 fname) internal pure {
        uint256 length = fname.length;
        bool nameEnded;

        /**
         * Iterate over the bytes16 fname one char at a time, ensuring that:
         *   1. The name begins with [a-z 0-9] or the ascii numbers [48-57, 97-122] inclusive
         *   2. The name can contain [a-z 0-9 -] or the ascii numbers [45, 48-57, 97-122] inclusive
         *   3. Once the name is ended with a NULL char (0), the follows character must also be NULLs
         */

        // If the name begins with a hyphen, reject it
        if (uint8(fname[0]) == 45) revert InvalidName();

        for (uint256 i = 0; i < length; ) {
            uint8 charInt = uint8(fname[i]);

            unchecked {
                // Safety: i can never overflow because length is guaranteed to be <= 16
                i++;
            }

            if (nameEnded) {
                // Only NULL characters are allowed after a name has ended
                if (charInt != 0) {
                    revert InvalidName();
                }
            } else {
                // Only valid ASCII characters [45, 48-57, 97-122] are allowed before the name ends

                // Check if the character is a-z
                if ((charInt >= 97 && charInt <= 122)) {
                    continue;
                }

                // Check if the character is 0-9
                if ((charInt >= 48 && charInt <= 57)) {
                    continue;
                }

                // Check if the character is a hyphen
                if ((charInt == 45)) {
                    continue;
                }

                // On seeing the first NULL char in the name, revert if is the first char in the
                // name, otherwise mark the name as ended
                if (charInt == 0) {
                    // We check i==1 instead of i==0 because i is incremented before the check
                    if (i == 1) revert InvalidName();
                    nameEnded = true;
                    continue;
                }

                revert InvalidName();
            }
        }
    }
}

File 2 of 21 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 21 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 4 of 21 : ERC2771ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)

pragma solidity ^0.8.9;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Context variant with ERC2771 support.
 */
abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _trustedForwarder;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(address trustedForwarder) {
        _trustedForwarder = trustedForwarder;
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return forwarder == _trustedForwarder;
    }

    function _msgSender() internal view virtual override returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            /// @solidity memory-safe-assembly
            assembly {
                sender := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return super._msgSender();
        }
    }

    function _msgData() internal view virtual override returns (bytes calldata) {
        if (isTrustedForwarder(msg.sender)) {
            return msg.data[:msg.data.length - 20];
        } else {
            return super._msgData();
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 5 of 21 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
        return
            interfaceId == type(IERC721Upgradeable).interfaceId ||
            interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[44] private __gap;
}

File 6 of 21 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 7 of 21 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 8 of 21 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate that the this implementation remains valid after an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 9 of 21 : FixedPointMathLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/FixedPointMathLib.sol)
library FixedPointMathLib {
    /*//////////////////////////////////////////////////////////////
                    SIMPLIFIED FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.

    function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
    }

    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
    }

    function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
    }

    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
    }

    function powWad(int256 x, int256 y) internal pure returns (int256) {
        // Equivalent to x to the power of y because x ** y = (e ** ln(x)) ** y = e ** (ln(x) * y)
        return expWad((lnWad(x) * y) / int256(WAD)); // Using ln(x) means x must be greater than 0.
    }

    function expWad(int256 x) internal pure returns (int256 r) {
        unchecked {
            // When the result is < 0.5 we return zero. This happens when
            // x <= floor(log(0.5e18) * 1e18) ~ -42e18
            if (x <= -42139678854452767551) return 0;

            // When the result is > (2**255 - 1) / 1e18 we can not represent it as an
            // int. This happens when x >= floor(log((2**255 - 1) / 1e18) * 1e18) ~ 135.
            if (x >= 135305999368893231589) revert("EXP_OVERFLOW");

            // x is now in the range (-42, 136) * 1e18. Convert to (-42, 136) * 2**96
            // for more intermediate precision and a binary basis. This base conversion
            // is a multiplication by 1e18 / 2**96 = 5**18 / 2**78.
            x = (x << 78) / 5**18;

            // Reduce range of x to (-½ ln 2, ½ ln 2) * 2**96 by factoring out powers
            // of two such that exp(x) = exp(x') * 2**k, where k is an integer.
            // Solving this gives k = round(x / log(2)) and x' = x - k * log(2).
            int256 k = ((x << 96) / 54916777467707473351141471128 + 2**95) >> 96;
            x = x - k * 54916777467707473351141471128;

            // k is in the range [-61, 195].

            // Evaluate using a (6, 7)-term rational approximation.
            // p is made monic, we'll multiply by a scale factor later.
            int256 y = x + 1346386616545796478920950773328;
            y = ((y * x) >> 96) + 57155421227552351082224309758442;
            int256 p = y + x - 94201549194550492254356042504812;
            p = ((p * y) >> 96) + 28719021644029726153956944680412240;
            p = p * x + (4385272521454847904659076985693276 << 96);

            // We leave p in 2**192 basis so we don't need to scale it back up for the division.
            int256 q = x - 2855989394907223263936484059900;
            q = ((q * x) >> 96) + 50020603652535783019961831881945;
            q = ((q * x) >> 96) - 533845033583426703283633433725380;
            q = ((q * x) >> 96) + 3604857256930695427073651918091429;
            q = ((q * x) >> 96) - 14423608567350463180887372962807573;
            q = ((q * x) >> 96) + 26449188498355588339934803723976023;

            assembly {
                // Div in assembly because solidity adds a zero check despite the unchecked.
                // The q polynomial won't have zeros in the domain as all its roots are complex.
                // No scaling is necessary because p is already 2**96 too large.
                r := sdiv(p, q)
            }

            // r should be in the range (0.09, 0.25) * 2**96.

            // We now need to multiply r by:
            // * the scale factor s = ~6.031367120.
            // * the 2**k factor from the range reduction.
            // * the 1e18 / 2**96 factor for base conversion.
            // We do this all at once, with an intermediate result in 2**213
            // basis, so the final right shift is always by a positive amount.
            r = int256((uint256(r) * 3822833074963236453042738258902158003155416615667) >> uint256(195 - k));
        }
    }

    function lnWad(int256 x) internal pure returns (int256 r) {
        unchecked {
            require(x > 0, "UNDEFINED");

            // We want to convert x from 10**18 fixed point to 2**96 fixed point.
            // We do this by multiplying by 2**96 / 10**18. But since
            // ln(x * C) = ln(x) + ln(C), we can simply do nothing here
            // and add ln(2**96 / 10**18) at the end.

            // Reduce range of x to (1, 2) * 2**96
            // ln(2^k * x) = k * ln(2) + ln(x)
            int256 k = int256(log2(uint256(x))) - 96;
            x <<= uint256(159 - k);
            x = int256(uint256(x) >> 159);

            // Evaluate using a (8, 8)-term rational approximation.
            // p is made monic, we will multiply by a scale factor later.
            int256 p = x + 3273285459638523848632254066296;
            p = ((p * x) >> 96) + 24828157081833163892658089445524;
            p = ((p * x) >> 96) + 43456485725739037958740375743393;
            p = ((p * x) >> 96) - 11111509109440967052023855526967;
            p = ((p * x) >> 96) - 45023709667254063763336534515857;
            p = ((p * x) >> 96) - 14706773417378608786704636184526;
            p = p * x - (795164235651350426258249787498 << 96);

            // We leave p in 2**192 basis so we don't need to scale it back up for the division.
            // q is monic by convention.
            int256 q = x + 5573035233440673466300451813936;
            q = ((q * x) >> 96) + 71694874799317883764090561454958;
            q = ((q * x) >> 96) + 283447036172924575727196451306956;
            q = ((q * x) >> 96) + 401686690394027663651624208769553;
            q = ((q * x) >> 96) + 204048457590392012362485061816622;
            q = ((q * x) >> 96) + 31853899698501571402653359427138;
            q = ((q * x) >> 96) + 909429971244387300277376558375;
            assembly {
                // Div in assembly because solidity adds a zero check despite the unchecked.
                // The q polynomial is known not to have zeros in the domain.
                // No scaling required because p is already 2**96 too large.
                r := sdiv(p, q)
            }

            // r is in the range (0, 0.125) * 2**96

            // Finalization, we need to:
            // * multiply by the scale factor s = 5.549…
            // * add ln(2**96 / 10**18)
            // * add k * ln(2)
            // * multiply by 10**18 / 2**96 = 5**18 >> 78

            // mul s * 5e18 * 2**96, base is now 5**18 * 2**192
            r *= 1677202110996718588342820967067443963516166;
            // add ln(2) * k * 5e18 * 2**192
            r += 16597577552685614221487285958193947469193820559219878177908093499208371 * k;
            // add ln(2**96 / 10**18) * 5e18 * 2**192
            r += 600920179829731861736702779321621459595472258049074101567377883020018308;
            // base conversion: mul 2**18 / 2**192
            r >>= 174;
        }
    }

    /*//////////////////////////////////////////////////////////////
                    LOW LEVEL FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function mulDivDown(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // Divide z by the denominator.
            z := div(z, denominator)
        }
    }

    function mulDivUp(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // First, divide z - 1 by the denominator and add 1.
            // We allow z - 1 to underflow if z is 0, because we multiply the
            // end result by 0 if z is zero, ensuring we return 0 if z is zero.
            z := mul(iszero(iszero(z)), add(div(sub(z, 1), denominator), 1))
        }
    }

    function rpow(
        uint256 x,
        uint256 n,
        uint256 scalar
    ) internal pure returns (uint256 z) {
        assembly {
            switch x
            case 0 {
                switch n
                case 0 {
                    // 0 ** 0 = 1
                    z := scalar
                }
                default {
                    // 0 ** n = 0
                    z := 0
                }
            }
            default {
                switch mod(n, 2)
                case 0 {
                    // If n is even, store scalar in z for now.
                    z := scalar
                }
                default {
                    // If n is odd, store x in z for now.
                    z := x
                }

                // Shifting right by 1 is like dividing by 2.
                let half := shr(1, scalar)

                for {
                    // Shift n right by 1 before looping to halve it.
                    n := shr(1, n)
                } n {
                    // Shift n right by 1 each iteration to halve it.
                    n := shr(1, n)
                } {
                    // Revert immediately if x ** 2 would overflow.
                    // Equivalent to iszero(eq(div(xx, x), x)) here.
                    if shr(128, x) {
                        revert(0, 0)
                    }

                    // Store x squared.
                    let xx := mul(x, x)

                    // Round to the nearest number.
                    let xxRound := add(xx, half)

                    // Revert if xx + half overflowed.
                    if lt(xxRound, xx) {
                        revert(0, 0)
                    }

                    // Set x to scaled xxRound.
                    x := div(xxRound, scalar)

                    // If n is even:
                    if mod(n, 2) {
                        // Compute z * x.
                        let zx := mul(z, x)

                        // If z * x overflowed:
                        if iszero(eq(div(zx, x), z)) {
                            // Revert if x is non-zero.
                            if iszero(iszero(x)) {
                                revert(0, 0)
                            }
                        }

                        // Round to the nearest number.
                        let zxRound := add(zx, half)

                        // Revert if zx + half overflowed.
                        if lt(zxRound, zx) {
                            revert(0, 0)
                        }

                        // Return properly scaled zxRound.
                        z := div(zxRound, scalar)
                    }
                }
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                        GENERAL NUMBER UTILITIES
    //////////////////////////////////////////////////////////////*/

    function sqrt(uint256 x) internal pure returns (uint256 z) {
        assembly {
            let y := x // We start y at x, which will help us make our initial estimate.

            z := 181 // The "correct" value is 1, but this saves a multiplication later.

            // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
            // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.

            // We check y >= 2^(k + 8) but shift right by k bits
            // each branch to ensure that if x >= 256, then y >= 256.
            if iszero(lt(y, 0x10000000000000000000000000000000000)) {
                y := shr(128, y)
                z := shl(64, z)
            }
            if iszero(lt(y, 0x1000000000000000000)) {
                y := shr(64, y)
                z := shl(32, z)
            }
            if iszero(lt(y, 0x10000000000)) {
                y := shr(32, y)
                z := shl(16, z)
            }
            if iszero(lt(y, 0x1000000)) {
                y := shr(16, y)
                z := shl(8, z)
            }

            // Goal was to get z*z*y within a small factor of x. More iterations could
            // get y in a tighter range. Currently, we will have y in [256, 256*2^16).
            // We ensured y >= 256 so that the relative difference between y and y+1 is small.
            // That's not possible if x < 256 but we can just verify those cases exhaustively.

            // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
            // Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
            // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.

            // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
            // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.

            // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
            // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.

            // There is no overflow risk here since y < 2^136 after the first branch above.
            z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.

            // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))

            // If x+1 is a perfect square, the Babylonian method cycles between
            // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
            // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
            // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
            // If you don't care whether the floor or ceil square root is returned, you can remove this statement.
            z := sub(z, lt(div(x, z), z))
        }
    }

    function log2(uint256 x) internal pure returns (uint256 r) {
        require(x > 0, "UNDEFINED");

        assembly {
            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
            r := or(r, shl(6, lt(0xffffffffffffffff, 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))))
            r := or(r, shl(2, lt(0xf, shr(r, x))))
            r := or(r, shl(1, lt(0x3, shr(r, x))))
            r := or(r, lt(0x1, shr(r, x)))
        }
    }
}

File 10 of 21 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 11 of 21 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 12 of 21 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 13 of 21 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - 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 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - 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 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 14 of 21 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 15 of 21 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 16 of 21 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 17 of 21 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 18 of 21 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 19 of 21 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 20 of 21 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 21 of 21 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CallFailed","type":"error"},{"inputs":[],"name":"CommitReplay","type":"error"},{"inputs":[],"name":"Escrow","type":"error"},{"inputs":[],"name":"Expired","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidCommit","type":"error"},{"inputs":[],"name":"InvalidName","type":"error"},{"inputs":[],"name":"InvalidRecovery","type":"error"},{"inputs":[],"name":"Invitable","type":"error"},{"inputs":[],"name":"NoRecovery","type":"error"},{"inputs":[],"name":"NotAdmin","type":"error"},{"inputs":[],"name":"NotBiddable","type":"error"},{"inputs":[],"name":"NotInvitable","type":"error"},{"inputs":[],"name":"NotModerator","type":"error"},{"inputs":[],"name":"NotOperator","type":"error"},{"inputs":[],"name":"NotRenewable","type":"error"},{"inputs":[],"name":"NotTreasurer","type":"error"},{"inputs":[],"name":"Registered","type":"error"},{"inputs":[],"name":"Registrable","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"CancelRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"ChangeFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"ChangePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recovery","type":"address"}],"name":"ChangeRecoveryAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"trustedCaller","type":"address"}],"name":"ChangeTrustedCaller","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"}],"name":"ChangeVault","type":"event"},{"anonymous":false,"inputs":[],"name":"DisableTrustedOnly","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"inviterId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"inviteeId","type":"uint256"},{"indexed":true,"internalType":"bytes16","name":"fname","type":"bytes16"}],"name":"Invite","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"Renew","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"RequestRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recovery","type":"address"}],"name":"bid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"cancelRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"changeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"changePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recovery","type":"address"}],"name":"changeRecoveryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_trustedCaller","type":"address"}],"name":"changeTrustedCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"changeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"completeRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableTrustedOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"expiryOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes16","name":"fname","type":"bytes16"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"recovery","type":"address"}],"name":"generateCommit","outputs":[{"internalType":"bytes32","name":"commit","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_pool","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commit","type":"bytes32"}],"name":"makeCommit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"reclaim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"recoveryClockOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"recoveryDestinationOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"recoveryOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes16","name":"fname","type":"bytes16"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"recovery","type":"address"}],"name":"register","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"renew","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"requestRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"timestampOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"trustedCaller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedOnly","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes16","name":"fname","type":"bytes16"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"recovery","type":"address"},{"internalType":"uint256","name":"inviter","type":"uint256"},{"internalType":"uint256","name":"invitee","type":"uint256"}],"name":"trustedRegister","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523060a0523480156200001557600080fd5b506040516200555f3803806200555f833981016040819052620000389162000118565b6001600160a01b0381166080526200004f62000056565b506200014a565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000116576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012b57600080fd5b81516001600160a01b03811681146200014357600080fd5b9392505050565b60805160a0516153cc62000193600039600081816111d101528181611267015281816118050152818161189b015261199201526000818161063e0152613a6901526153cc6000f3fe6080604052600436106103555760003560e01c80636352211e116101bb5780639950e7ee116100f7578063c87b56dd11610095578063ddca3f431161006f578063ddca3f43146109de578063e985e9c5146109f5578063fa1a1b2514610a3e578063fbfa77cf14610a7557600080fd5b8063c87b56dd14610967578063cb17e04a14610987578063d547741f146109be57600080fd5b8063a22cb465116100d1578063a22cb465146108cb578063ac817ccc146108eb578063b88d4fde14610919578063baef73e91461093957600080fd5b80639950e7ee146108765780639fc999e414610896578063a217fddf146108b657600080fd5b806376fa0b8a11610164578063881b19561161013e578063881b1956146107db5780638f15b414146107fb57806391d148541461081b57806395d89b411461086157600080fd5b806376fa0b8a146107785780638456cb59146107a657806385fb8449146107bb57600080fd5b80636b2ddd4e116101955780636b2ddd4e1461072c5780636e9bde491461074357806370a082311461075857600080fd5b80636352211e146106cc5780636473b35e146106ec5780636a1db1bf1461070c57600080fd5b806336568abe116102955780634f1ef286116102335780635baa75091161020d5780635baa75091461066e5780635c975abb146106815780635e7510001461069957806360e232a9146106ac57600080fd5b80634f1ef286146105f957806352d1902d1461060c578063572b6c051461062157600080fd5b80633f4ba83a1161026f5780633f4ba83a1461059157806342842e0e146105a65780634339bc30146105c6578063464ac22c146105e657600080fd5b806336568abe1461053e5780633659cfe61461055e5780633f09a95a1461057e57600080fd5b806316f0115b11610302578063268f0760116102dc578063268f0760146104ca5780632dabbeed146104eb5780632e1a7d4d146104fe5780632f2ff15d1461051e57600080fd5b806316f0115b1461044b57806323b872dd1461046c578063248a9ca31461048c57600080fd5b8063095ea7b311610333578063095ea7b3146103e95780630c97fc361461040b57806310de26761461042b57600080fd5b806301ffc9a71461035a57806306fdde031461038f578063081812fc146103b1575b600080fd5b34801561036657600080fd5b5061037a6103753660046149a0565b610a96565b60405190151581526020015b60405180910390f35b34801561039b57600080fd5b506103a4610aa7565b6040516103869190614a0d565b3480156103bd57600080fd5b506103d16103cc366004614a20565b610b39565b6040516001600160a01b039091168152602001610386565b3480156103f557600080fd5b50610409610404366004614a55565b610b60565b005b34801561041757600080fd5b50610409610426366004614a20565b610ca8565b34801561043757600080fd5b50610409610446366004614a20565b610d45565b34801561045757600080fd5b50610197546103d1906001600160a01b031681565b34801561047857600080fd5b50610409610487366004614a7f565b610e5e565b34801561049857600080fd5b506104bc6104a7366004614a20565b600090815260c9602052604090206001015490565b604051908152602001610386565b3480156104d657600080fd5b50610192546103d1906001600160a01b031681565b6104096104f9366004614a20565b610ed4565b34801561050a57600080fd5b50610409610519366004614a20565b610fda565b34801561052a57600080fd5b50610409610539366004614abb565b61110a565b34801561054a57600080fd5b50610409610559366004614abb565b61112f565b34801561056a57600080fd5b50610409610579366004614ae7565b6111c7565b61040961058c366004614b32565b611364565b34801561059d57600080fd5b506104096114ba565b3480156105b257600080fd5b506104096105c1366004614a7f565b61152c565b3480156105d257600080fd5b506104096105e1366004614ae7565b611547565b6104096105f4366004614b87565b611607565b610409610607366004614c90565b6117fb565b34801561061857600080fd5b506104bc611985565b34801561062d57600080fd5b5061037a61063c366004614ae7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61040961067c366004614a20565b611a4a565b34801561068d57600080fd5b5060fb5460ff1661037a565b6104096106a7366004614cde565b611c41565b3480156106b857600080fd5b506104096106c7366004614ae7565b611e36565b3480156106d857600080fd5b506103d16106e7366004614a20565b611ef6565b3480156106f857600080fd5b50610409610707366004614abb565b611f5c565b34801561071857600080fd5b50610409610727366004614a20565b61208f565b34801561073857600080fd5b506104bc6101935481565b34801561074f57600080fd5b50610409612133565b34801561076457600080fd5b506104bc610773366004614ae7565b6121cc565b34801561078457600080fd5b506104bc610793366004614a20565b6101946020526000908152604090205481565b3480156107b257600080fd5b50610409612266565b3480156107c757600080fd5b506104096107d6366004614a20565b6122d6565b3480156107e757600080fd5b506104096107f6366004614ae7565b612433565b34801561080757600080fd5b50610409610816366004614d63565b6124f3565b34801561082757600080fd5b5061037a610836366004614abb565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561086d57600080fd5b506103a46127d8565b34801561088257600080fd5b50610409610891366004614abb565b6127e7565b3480156108a257600080fd5b506104bc6108b1366004614b87565b6128da565b3480156108c257600080fd5b506104bc600081565b3480156108d757600080fd5b506104096108e6366004614df3565b612955565b3480156108f757600080fd5b506104bc610906366004614a20565b6101996020526000908152604090205481565b34801561092557600080fd5b50610409610934366004614e2f565b612967565b34801561094557600080fd5b506104bc610954366004614a20565b6101956020526000908152604090205481565b34801561097357600080fd5b506103a4610982366004614a20565b6129d8565b34801561099357600080fd5b506103d16109a2366004614a20565b61019a602052600090815260409020546001600160a01b031681565b3480156109ca57600080fd5b506104096109d9366004614abb565b612b30565b3480156109ea57600080fd5b506104bc6101915481565b348015610a0157600080fd5b5061037a610a10366004614e97565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610a4a57600080fd5b506103d1610a59366004614a20565b610198602052600090815260409020546001600160a01b031681565b348015610a8157600080fd5b50610196546103d1906001600160a01b031681565b6000610aa182612b55565b92915050565b606060658054610ab690614ec1565b80601f0160208091040260200160405190810160405280929190818152602001828054610ae290614ec1565b8015610b2f5780601f10610b0457610100808354040283529160200191610b2f565b820191906000526020600020905b815481529060010190602001808311610b1257829003601f168201915b5050505050905090565b6000610b4482612c38565b506000908152606960205260409020546001600160a01b031690565b6000610b6b82612c9c565b9050806001600160a01b0316836001600160a01b031603610bf95760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b806001600160a01b0316610c0b612d01565b6001600160a01b03161480610c275750610c2781610a10612d01565b610c995760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610bf0565b610ca38383612d10565b505050565b61019354600103610ce5576040517f40adbefd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526101946020526040902054610258014211610d31576040517f4002db2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600090815261019460205260409020429055565b6000610d4f612d01565b9050610d5a82612c9c565b6001600160a01b0316816001600160a01b031614158015610d965750600082815261019860205260409020546001600160a01b03828116911614155b15610dcd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019960205260408120549003610e15576040517fc993b99300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019960205260408082208290555183916001600160a01b038416917f6181d4215ebc71e962cc193554c17f05a825da06230fdf9ece45081f09cb206f9190a35050565b600081815261019560205260409020548015801590610e8c5750600082815261019560205260409020544210155b15610ec3576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ece848484612d8b565b50505050565b3360009081527f3092a9721ab951abc46661db103a5d03d04480b09446fa131eb59820635cf144602052604090205460ff16610f3c576040517feaa45d6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152610195602052604081205490819003610f86576040517f7cb40a3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fa5610f9283612c9c565b610197546001600160a01b031684612e15565b610fb262278d0082614f43565b4210610fd657610fc562278d0042614f56565b600083815261019560205260409020555b5050565b3360009081527f75522faebd8252265a4c98687d4b5f5b6c3a71858d7f8312047425dcd4725046602052604090205460ff16611042576040517f5647892800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8047101561107c576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610196546040516000916001600160a01b03169083908381818185875af1925050503d80600081146110ca576040519150601f19603f3d011682016040523d82523d6000602084013e6110cf565b606091505b5050905080610fd6576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260c9602052604090206001015461112581613000565b610ca38383613011565b611137612d01565b6001600160a01b0316816001600160a01b0316146111bd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610bf0565b610fd682826130b4565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036112655760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610bf0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112c07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b03161461133c5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610bf0565b61134581613155565b60408051600080825260208201909252611361918391906131b7565b50565b610193546000036113a1576040517f516a601900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610192546001600160a01b031633146113e6576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113ef85613357565b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000851661141c85826134e3565b6000818152610195602090815260408083206301e1338042019055610198909152808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038816179055517fffffffffffffffffffffffffffffffff00000000000000000000000000000000881691849186917fed994b8dfbd359de8b535931832fe533e23820fbb73ce69d8dde9bd677989f3991a4505050505050565b3360009081527fc99cfc74cbb51adc7ca8731c432a51a31a086a1789003f0b773be6e802362bf4602052604090205460ff16611522576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61152a613646565b565b610ca383838360405180602001604052806000815250612967565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff166115af576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610197805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f79025dab199855650264c602de305dcf5c292b8e5b4470ef271724a79d0343f490600090a250565b6000611615858585856128da565b6101915490915034811115611656576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526101946020526040812054908190036116a0576040517fb7b3378700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b603c81014210156116dd576040517fb7b3378700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000871661170a87826134e3565b60008481526101946020908152604080832083905583835261019582528083206301e13380420190556101989091529020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038716179055348381039084146117f057604051600090339083908381818185875af1925050503d80600081146117ae576040519150601f19603f3d011682016040523d82523d6000602084013e6117b3565b606091505b50509050806117ee576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050505050505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036118995760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610bf0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166118f47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146119705760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610bf0565b61197982613155565b610fd6828260016131b7565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611a255760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610bf0565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b611a5261369e565b6101915434811115611a90576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152610195602052604081205490819003611ada576040517f7cb40a3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62278d0081014210611b18576040517f566e239b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80421015611b52576040517f28d4030000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b606301e1338042614f56565b60008481526101956020526040908190208290555184917fbf5b84fa6df1868d005e90d05ee12a6c49025be6f38d2807f183743676744c1691611ba591815260200190565b60405180910390a234828103908314610ece57604051600090339083908381818185875af1925050503d8060008114611bfa576040519150601f19603f3d011682016040523d82523d6000602084013e611bff565b606091505b5050905080611c3a576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6000828152610195602052604081205490819003611c8b576040517f7cb40a3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62278d00810142811115611ccb576040517f2720243f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080651f9465b8ab8e83420302905061019154611d04611cf4670c7d713b49da0000846136f1565b683635c9adc5dea0000090613722565b0191505080341015611d42576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d55611d4e86612c9c565b8787612e15565b6000858152610195602090815260408083206301e13380420190556101989091529020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861617905534818103908214611e2d57604051600090339083908381818185875af1925050503d8060008114611deb576040519150601f19603f3d011682016040523d82523d6000602084013e611df0565b606091505b5050905080611e2b576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050505050565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff16611e9e576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610196805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f646d70535c6b451b92021874a72abd441f122ba1c0b8f24d074352bd169fad3f90600090a250565b600081815261019560205260408120548015801590611f155750804210155b15611f4c576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f5583612c9c565b9392505050565b611f6461369e565b6001600160a01b038116611fa4576040517ff7eb744d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019860205260409020546001600160a01b0316611fc5612d01565b6001600160a01b031614612005576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526101996020908152604080832042905561019a9091529020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155829061205682611ef6565b6001600160a01b03167ffab80e8bf242ed27bf595552dfdddbdd794f201d6dfcd8df7347f82f8e1f1f9b60405160405180910390a45050565b3360009081527f75522faebd8252265a4c98687d4b5f5b6c3a71858d7f8312047425dcd4725046602052604090205460ff166120f7576040517f5647892800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101918190556040518181527ffba1d84f2e30311f1380f2355f294fbedd53264c2504378e2c4b2133dea166709060200160405180910390a150565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff1661219b576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006101938190556040517f03732e5295a5bd18e6ef95b03b41aa8bcadae292a7ef40468144c7a727dfa8b59190a1565b60006001600160a01b03821661224a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610bf0565b506001600160a01b031660009081526068602052604090205490565b3360009081527fc99cfc74cbb51adc7ca8731c432a51a31a086a1789003f0b773be6e802362bf4602052604090205460ff166122ce576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61152a613737565b60008181526101956020526040902054421061231e576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815261019860205260409020546001600160a01b031661233f612d01565b6001600160a01b03161461237f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526101996020526040812054908190036123c9576040517fc993b99300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6203f4808101421015612408576040517f22f607f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fd661241483611ef6565b600084815261019a60205260409020546001600160a01b031684612e15565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff1661249b576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610192805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f255ba3357fefe42b361c216b6e0bc5541f1e6ea4c6178d4a45ad8dd7ec28139d90600090a250565b600054610100900460ff16158080156125135750600054600160ff909116105b8061252d5750303b15801561252d575060005460ff166001145b61259f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610bf0565b6000805460ff1916600117905580156125df57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61265287878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061377592505050565b61265a6137fc565b612662613881565b61266a613881565b61267c6000612677612d01565b6138fe565b610196805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385169081179091556040517f646d70535c6b451b92021874a72abd441f122ba1c0b8f24d074352bd169fad3f90600090a2610197805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040517f79025dab199855650264c602de305dcf5c292b8e5b4470ef271724a79d0343f490600090a2662386f26fc100006101918190556040519081527ffba1d84f2e30311f1380f2355f294fbedd53264c2504378e2c4b2133dea166709060200160405180910390a16001610193558015611e2d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b606060668054610ab690614ec1565b6127ef61369e565b6127f7612d01565b6001600160a01b031661280983611ef6565b6001600160a01b031614612849576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019860209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616179055610199909152902054156128a057600082815261019960205260408120555b6040516001600160a01b0382169083907f8e700b803af43e14651431cd73c9fe7d11b131ad797576a70b893ce5766f65c390600090a35050565b60006128e585613357565b604080517fffffffffffffffffffffffffffffffff00000000000000000000000000000000871660208201526001600160a01b038087169282019290925290831660608201526080810184905260a001604051602081830303815290604052805190602001209050949350505050565b610fd6612960612d01565b8383613908565b6000828152610195602052604090205480158015906129955750600083815261019560205260409020544210155b156129cc576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c3a858585856139d6565b60606000826129e681613357565b600f5b8181601081106129fb576129fb614f69565b1a15612a0957809250612a12565b600019016129e9565b506000612a20836001614f56565b67ffffffffffffffff811115612a3857612a38614bd4565b6040519080825280601f01601f191660200182016040528015612a62576020820181803683370190505b50905060005b838111612ace57828160108110612a8157612a81614f69565b1a60f81b828281518110612a9757612a97614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101612a68565b506040518060400160405280601b81526020017f687474703a2f2f7777772e6661726361737465722e78797a2f752f000000000081525081604051602001612b17929190614f98565b6040516020818303038152906040529350505050919050565b600082815260c96020526040902060010154612b4b81613000565b610ca383836130b4565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480612be857507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610aa157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610aa1565b6000818152606760205260409020546001600160a01b03166113615760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610bf0565b6000818152606760205260408120546001600160a01b031680610aa15760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610bf0565b6000612d0b613a65565b905090565b6000818152606960205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190612d5282612c9c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b612d9c612d96612d01565b82613ac7565b612e0e5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610bf0565b610ca38383835b826001600160a01b0316612e2882612c9c565b6001600160a01b031614612ea45760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610bf0565b6001600160a01b038216612f1f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610bf0565b612f2a838383613b46565b612f35600082612d10565b6001600160a01b0383166000908152606860205260408120805460019290612f5e908490614f43565b90915550506001600160a01b0382166000908152606860205260408120805460019290612f8c908490614f56565b9091555050600081815260676020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ca3838383613b4e565b6113618161300c612d01565b613ba2565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff16610fd657600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613070612d01565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff1615610fd657600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19169055613111612d01565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6131817fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610836612d01565b611361576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131ea57610ca383613c22565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613244575060408051601f3d908101601f1916820190925261324191810190614fef565b60015b6132b65760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610bf0565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461334b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610bf0565b50610ca3838383613ced565b6010600082811a602d03613397576040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82811015610ece5760008482601081106133b6576133b6614f69565b6001909301921a905082156134055760ff811615613400576040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6134dd565b60618160ff161015801561341d5750607a8160ff1611155b15613428575061339a565b60308160ff1610158015613440575060398160ff1611155b1561344b575061339a565b8060ff16602d0361345c575061339a565b8060ff166000036134ab57816001036134a1576040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600192505061339a565b6040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061339a565b6001600160a01b0382166135395760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610bf0565b6000818152606760205260409020546001600160a01b03161561359e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610bf0565b6135aa60008383613b46565b6001600160a01b03821660009081526068602052604081208054600192906135d3908490614f56565b9091555050600081815260676020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610fd660008383613b4e565b61364e613d12565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613681612d01565b6040516001600160a01b03909116815260200160405180910390a1565b60fb5460ff161561152a5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610bf0565b6000611f55670de0b6b3a76400008361370986613d64565b6137139190615008565b61371d91906150c4565b613f8e565b6000611f558383670de0b6b3a76400006141b3565b61373f61369e565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613681612d01565b600054610100900460ff166137f25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b610fd682826141d2565b600054610100900460ff166138795760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b61152a614268565b600054610100900460ff1661152a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b610fd68282613011565b816001600160a01b0316836001600160a01b0316036139695760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610bf0565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6139e76139e1612d01565b83613ac7565b613a595760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610bf0565b610ece848484846142f1565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303613ac257507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b600080613ad383612c9c565b9050806001600160a01b0316846001600160a01b03161480613b1a57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b80613b3e5750836001600160a01b0316613b3384610b39565b6001600160a01b0316145b949350505050565b610ca361369e565b6000818152610199602052604090205415613b7457600081815261019960205260408120555b600090815261019860205260409020805473ffffffffffffffffffffffffffffffffffffffff191690555050565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff16610fd657613be0816001600160a01b0316601461437a565b613beb83602061437a565b604051602001613bfc929190615135565b60408051601f198184030181529082905262461bcd60e51b8252610bf091600401614a0d565b6001600160a01b0381163b613c9f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610bf0565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b613cf6836145a3565b600082511180613d035750805b15610ca357610ece83836145e3565b60fb5460ff1661152a5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610bf0565b6000808213613db55760405162461bcd60e51b815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610bf0565b60006060613dc2846146ee565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213613fbf57506000919050565b680755bf798b4a1bf1e582126140175760405162461bcd60e51b815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610bf0565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b8282028115158415858304851417166141cb57600080fd5b0492915050565b600054610100900460ff1661424f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b606561425b8382615204565b506066610ca38282615204565b600054610100900460ff166142e55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b60fb805460ff19169055565b6142fc848484612e15565b614308848484846147aa565b610ece5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610bf0565b606060006143898360026152c4565b614394906002614f56565b67ffffffffffffffff8111156143ac576143ac614bd4565b6040519080825280601f01601f1916602001820160405280156143d6576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061440d5761440d614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061447057614470614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006144ac8460026152c4565b6144b7906001614f56565b90505b6001811115614554577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106144f8576144f8614f69565b1a60f81b82828151811061450e5761450e614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361454d816152e3565b90506144ba565b508315611f555760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610bf0565b6145ac81613c22565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6146625760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610bf0565b600080846001600160a01b03168460405161467d91906152fa565b600060405180830381855af49150503d80600081146146b8576040519150601f19603f3d011682016040523d82523d6000602084013e6146bd565b606091505b50915091506146e5828260405180606001604052806027815260200161537060279139614939565b95945050505050565b600080821161473f5760405162461bcd60e51b815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610bf0565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60006001600160a01b0384163b1561492e57836001600160a01b031663150b7a026147d3612d01565b8786866040518563ffffffff1660e01b81526004016147f59493929190615316565b6020604051808303816000875af1925050508015614830575060408051601f3d908101601f1916820190925261482d91810190615352565b60015b6148e3573d80801561485e576040519150601f19603f3d011682016040523d82523d6000602084013e614863565b606091505b5080516000036148db5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610bf0565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050613b3e565b506001949350505050565b60608315614948575081611f55565b8251156149585782518084602001fd5b8160405162461bcd60e51b8152600401610bf09190614a0d565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461136157600080fd5b6000602082840312156149b257600080fd5b8135611f5581614972565b60005b838110156149d85781810151838201526020016149c0565b50506000910152565b600081518084526149f98160208601602086016149bd565b601f01601f19169290920160200192915050565b602081526000611f5560208301846149e1565b600060208284031215614a3257600080fd5b5035919050565b80356001600160a01b0381168114614a5057600080fd5b919050565b60008060408385031215614a6857600080fd5b614a7183614a39565b946020939093013593505050565b600080600060608486031215614a9457600080fd5b614a9d84614a39565b9250614aab60208501614a39565b9150604084013590509250925092565b60008060408385031215614ace57600080fd5b82359150614ade60208401614a39565b90509250929050565b600060208284031215614af957600080fd5b611f5582614a39565b80357fffffffffffffffffffffffffffffffff0000000000000000000000000000000081168114614a5057600080fd5b600080600080600060a08688031215614b4a57600080fd5b614b5386614b02565b9450614b6160208701614a39565b9350614b6f60408701614a39565b94979396509394606081013594506080013592915050565b60008060008060808587031215614b9d57600080fd5b614ba685614b02565b9350614bb460208601614a39565b925060408501359150614bc960608601614a39565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112614c1457600080fd5b813567ffffffffffffffff80821115614c2f57614c2f614bd4565b604051601f8301601f19908116603f01168101908282118183101715614c5757614c57614bd4565b81604052838152866020858801011115614c7057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215614ca357600080fd5b614cac83614a39565b9150602083013567ffffffffffffffff811115614cc857600080fd5b614cd485828601614c03565b9150509250929050565b600080600060608486031215614cf357600080fd5b614cfc84614a39565b925060208401359150614d1160408501614a39565b90509250925092565b60008083601f840112614d2c57600080fd5b50813567ffffffffffffffff811115614d4457600080fd5b602083019150836020828501011115614d5c57600080fd5b9250929050565b60008060008060008060808789031215614d7c57600080fd5b863567ffffffffffffffff80821115614d9457600080fd5b614da08a838b01614d1a565b90985096506020890135915080821115614db957600080fd5b50614dc689828a01614d1a565b9095509350614dd9905060408801614a39565b9150614de760608801614a39565b90509295509295509295565b60008060408385031215614e0657600080fd5b614e0f83614a39565b915060208301358015158114614e2457600080fd5b809150509250929050565b60008060008060808587031215614e4557600080fd5b614e4e85614a39565b9350614e5c60208601614a39565b925060408501359150606085013567ffffffffffffffff811115614e7f57600080fd5b614e8b87828801614c03565b91505092959194509250565b60008060408385031215614eaa57600080fd5b614eb383614a39565b9150614ade60208401614a39565b600181811c90821680614ed557607f821691505b602082108103614f0e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610aa157610aa1614f14565b80820180821115610aa157610aa1614f14565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008351614faa8184602088016149bd565b835190830190614fbe8183602088016149bd565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b60006020828403121561500157600080fd5b5051919050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561504957615049614f14565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561508457615084614f14565b600087129250878205871284841616156150a0576150a0614f14565b878505871281841616156150b6576150b6614f14565b505050929093029392505050565b6000826150fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60001983147f80000000000000000000000000000000000000000000000000000000000000008314161561513057615130614f14565b500590565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161516d8160178501602088016149bd565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516151aa8160288401602088016149bd565b01602801949350505050565b601f821115610ca357600081815260208120601f850160051c810160208610156151dd5750805b601f850160051c820191505b818110156151fc578281556001016151e9565b505050505050565b815167ffffffffffffffff81111561521e5761521e614bd4565b6152328161522c8454614ec1565b846151b6565b602080601f831160018114615267576000841561524f5750858301515b600019600386901b1c1916600185901b1785556151fc565b600085815260208120601f198616915b8281101561529657888601518255948401946001909101908401615277565b50858210156152b45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008160001904831182151516156152de576152de614f14565b500290565b6000816152f2576152f2614f14565b506000190190565b6000825161530c8184602087016149bd565b9190910192915050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261534860808301846149e1565b9695505050505050565b60006020828403121561536457600080fd5b8151611f558161497256fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201bc50654aaa9327b0743f4153b73854ff6461884d1531dac408b1bf6f5f44c7164736f6c634300081000330000000000000000000000007a95fa73250dc53556d264522150a940d4c50238

Deployed Bytecode

0x6080604052600436106103555760003560e01c80636352211e116101bb5780639950e7ee116100f7578063c87b56dd11610095578063ddca3f431161006f578063ddca3f43146109de578063e985e9c5146109f5578063fa1a1b2514610a3e578063fbfa77cf14610a7557600080fd5b8063c87b56dd14610967578063cb17e04a14610987578063d547741f146109be57600080fd5b8063a22cb465116100d1578063a22cb465146108cb578063ac817ccc146108eb578063b88d4fde14610919578063baef73e91461093957600080fd5b80639950e7ee146108765780639fc999e414610896578063a217fddf146108b657600080fd5b806376fa0b8a11610164578063881b19561161013e578063881b1956146107db5780638f15b414146107fb57806391d148541461081b57806395d89b411461086157600080fd5b806376fa0b8a146107785780638456cb59146107a657806385fb8449146107bb57600080fd5b80636b2ddd4e116101955780636b2ddd4e1461072c5780636e9bde491461074357806370a082311461075857600080fd5b80636352211e146106cc5780636473b35e146106ec5780636a1db1bf1461070c57600080fd5b806336568abe116102955780634f1ef286116102335780635baa75091161020d5780635baa75091461066e5780635c975abb146106815780635e7510001461069957806360e232a9146106ac57600080fd5b80634f1ef286146105f957806352d1902d1461060c578063572b6c051461062157600080fd5b80633f4ba83a1161026f5780633f4ba83a1461059157806342842e0e146105a65780634339bc30146105c6578063464ac22c146105e657600080fd5b806336568abe1461053e5780633659cfe61461055e5780633f09a95a1461057e57600080fd5b806316f0115b11610302578063268f0760116102dc578063268f0760146104ca5780632dabbeed146104eb5780632e1a7d4d146104fe5780632f2ff15d1461051e57600080fd5b806316f0115b1461044b57806323b872dd1461046c578063248a9ca31461048c57600080fd5b8063095ea7b311610333578063095ea7b3146103e95780630c97fc361461040b57806310de26761461042b57600080fd5b806301ffc9a71461035a57806306fdde031461038f578063081812fc146103b1575b600080fd5b34801561036657600080fd5b5061037a6103753660046149a0565b610a96565b60405190151581526020015b60405180910390f35b34801561039b57600080fd5b506103a4610aa7565b6040516103869190614a0d565b3480156103bd57600080fd5b506103d16103cc366004614a20565b610b39565b6040516001600160a01b039091168152602001610386565b3480156103f557600080fd5b50610409610404366004614a55565b610b60565b005b34801561041757600080fd5b50610409610426366004614a20565b610ca8565b34801561043757600080fd5b50610409610446366004614a20565b610d45565b34801561045757600080fd5b50610197546103d1906001600160a01b031681565b34801561047857600080fd5b50610409610487366004614a7f565b610e5e565b34801561049857600080fd5b506104bc6104a7366004614a20565b600090815260c9602052604090206001015490565b604051908152602001610386565b3480156104d657600080fd5b50610192546103d1906001600160a01b031681565b6104096104f9366004614a20565b610ed4565b34801561050a57600080fd5b50610409610519366004614a20565b610fda565b34801561052a57600080fd5b50610409610539366004614abb565b61110a565b34801561054a57600080fd5b50610409610559366004614abb565b61112f565b34801561056a57600080fd5b50610409610579366004614ae7565b6111c7565b61040961058c366004614b32565b611364565b34801561059d57600080fd5b506104096114ba565b3480156105b257600080fd5b506104096105c1366004614a7f565b61152c565b3480156105d257600080fd5b506104096105e1366004614ae7565b611547565b6104096105f4366004614b87565b611607565b610409610607366004614c90565b6117fb565b34801561061857600080fd5b506104bc611985565b34801561062d57600080fd5b5061037a61063c366004614ae7565b7f0000000000000000000000007a95fa73250dc53556d264522150a940d4c502386001600160a01b0390811691161490565b61040961067c366004614a20565b611a4a565b34801561068d57600080fd5b5060fb5460ff1661037a565b6104096106a7366004614cde565b611c41565b3480156106b857600080fd5b506104096106c7366004614ae7565b611e36565b3480156106d857600080fd5b506103d16106e7366004614a20565b611ef6565b3480156106f857600080fd5b50610409610707366004614abb565b611f5c565b34801561071857600080fd5b50610409610727366004614a20565b61208f565b34801561073857600080fd5b506104bc6101935481565b34801561074f57600080fd5b50610409612133565b34801561076457600080fd5b506104bc610773366004614ae7565b6121cc565b34801561078457600080fd5b506104bc610793366004614a20565b6101946020526000908152604090205481565b3480156107b257600080fd5b50610409612266565b3480156107c757600080fd5b506104096107d6366004614a20565b6122d6565b3480156107e757600080fd5b506104096107f6366004614ae7565b612433565b34801561080757600080fd5b50610409610816366004614d63565b6124f3565b34801561082757600080fd5b5061037a610836366004614abb565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561086d57600080fd5b506103a46127d8565b34801561088257600080fd5b50610409610891366004614abb565b6127e7565b3480156108a257600080fd5b506104bc6108b1366004614b87565b6128da565b3480156108c257600080fd5b506104bc600081565b3480156108d757600080fd5b506104096108e6366004614df3565b612955565b3480156108f757600080fd5b506104bc610906366004614a20565b6101996020526000908152604090205481565b34801561092557600080fd5b50610409610934366004614e2f565b612967565b34801561094557600080fd5b506104bc610954366004614a20565b6101956020526000908152604090205481565b34801561097357600080fd5b506103a4610982366004614a20565b6129d8565b34801561099357600080fd5b506103d16109a2366004614a20565b61019a602052600090815260409020546001600160a01b031681565b3480156109ca57600080fd5b506104096109d9366004614abb565b612b30565b3480156109ea57600080fd5b506104bc6101915481565b348015610a0157600080fd5b5061037a610a10366004614e97565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610a4a57600080fd5b506103d1610a59366004614a20565b610198602052600090815260409020546001600160a01b031681565b348015610a8157600080fd5b50610196546103d1906001600160a01b031681565b6000610aa182612b55565b92915050565b606060658054610ab690614ec1565b80601f0160208091040260200160405190810160405280929190818152602001828054610ae290614ec1565b8015610b2f5780601f10610b0457610100808354040283529160200191610b2f565b820191906000526020600020905b815481529060010190602001808311610b1257829003601f168201915b5050505050905090565b6000610b4482612c38565b506000908152606960205260409020546001600160a01b031690565b6000610b6b82612c9c565b9050806001600160a01b0316836001600160a01b031603610bf95760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b806001600160a01b0316610c0b612d01565b6001600160a01b03161480610c275750610c2781610a10612d01565b610c995760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610bf0565b610ca38383612d10565b505050565b61019354600103610ce5576040517f40adbefd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526101946020526040902054610258014211610d31576040517f4002db2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600090815261019460205260409020429055565b6000610d4f612d01565b9050610d5a82612c9c565b6001600160a01b0316816001600160a01b031614158015610d965750600082815261019860205260409020546001600160a01b03828116911614155b15610dcd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019960205260408120549003610e15576040517fc993b99300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019960205260408082208290555183916001600160a01b038416917f6181d4215ebc71e962cc193554c17f05a825da06230fdf9ece45081f09cb206f9190a35050565b600081815261019560205260409020548015801590610e8c5750600082815261019560205260409020544210155b15610ec3576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ece848484612d8b565b50505050565b3360009081527f3092a9721ab951abc46661db103a5d03d04480b09446fa131eb59820635cf144602052604090205460ff16610f3c576040517feaa45d6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152610195602052604081205490819003610f86576040517f7cb40a3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fa5610f9283612c9c565b610197546001600160a01b031684612e15565b610fb262278d0082614f43565b4210610fd657610fc562278d0042614f56565b600083815261019560205260409020555b5050565b3360009081527f75522faebd8252265a4c98687d4b5f5b6c3a71858d7f8312047425dcd4725046602052604090205460ff16611042576040517f5647892800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8047101561107c576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610196546040516000916001600160a01b03169083908381818185875af1925050503d80600081146110ca576040519150601f19603f3d011682016040523d82523d6000602084013e6110cf565b606091505b5050905080610fd6576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260c9602052604090206001015461112581613000565b610ca38383613011565b611137612d01565b6001600160a01b0316816001600160a01b0316146111bd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610bf0565b610fd682826130b4565b6001600160a01b037f000000000000000000000000f73bc3fa2f6f774d4b6791414b1092a40cd838311630036112655760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610bf0565b7f000000000000000000000000f73bc3fa2f6f774d4b6791414b1092a40cd838316001600160a01b03166112c07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b03161461133c5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610bf0565b61134581613155565b60408051600080825260208201909252611361918391906131b7565b50565b610193546000036113a1576040517f516a601900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610192546001600160a01b031633146113e6576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113ef85613357565b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000851661141c85826134e3565b6000818152610195602090815260408083206301e1338042019055610198909152808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038816179055517fffffffffffffffffffffffffffffffff00000000000000000000000000000000881691849186917fed994b8dfbd359de8b535931832fe533e23820fbb73ce69d8dde9bd677989f3991a4505050505050565b3360009081527fc99cfc74cbb51adc7ca8731c432a51a31a086a1789003f0b773be6e802362bf4602052604090205460ff16611522576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61152a613646565b565b610ca383838360405180602001604052806000815250612967565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff166115af576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610197805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f79025dab199855650264c602de305dcf5c292b8e5b4470ef271724a79d0343f490600090a250565b6000611615858585856128da565b6101915490915034811115611656576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526101946020526040812054908190036116a0576040517fb7b3378700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b603c81014210156116dd576040517fb7b3378700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000871661170a87826134e3565b60008481526101946020908152604080832083905583835261019582528083206301e13380420190556101989091529020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038716179055348381039084146117f057604051600090339083908381818185875af1925050503d80600081146117ae576040519150601f19603f3d011682016040523d82523d6000602084013e6117b3565b606091505b50509050806117ee576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050505050505050565b6001600160a01b037f000000000000000000000000f73bc3fa2f6f774d4b6791414b1092a40cd838311630036118995760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610bf0565b7f000000000000000000000000f73bc3fa2f6f774d4b6791414b1092a40cd838316001600160a01b03166118f47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146119705760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610bf0565b61197982613155565b610fd6828260016131b7565b6000306001600160a01b037f000000000000000000000000f73bc3fa2f6f774d4b6791414b1092a40cd838311614611a255760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610bf0565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b611a5261369e565b6101915434811115611a90576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152610195602052604081205490819003611ada576040517f7cb40a3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62278d0081014210611b18576040517f566e239b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80421015611b52576040517f28d4030000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b606301e1338042614f56565b60008481526101956020526040908190208290555184917fbf5b84fa6df1868d005e90d05ee12a6c49025be6f38d2807f183743676744c1691611ba591815260200190565b60405180910390a234828103908314610ece57604051600090339083908381818185875af1925050503d8060008114611bfa576040519150601f19603f3d011682016040523d82523d6000602084013e611bff565b606091505b5050905080611c3a576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6000828152610195602052604081205490819003611c8b576040517f7cb40a3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62278d00810142811115611ccb576040517f2720243f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080651f9465b8ab8e83420302905061019154611d04611cf4670c7d713b49da0000846136f1565b683635c9adc5dea0000090613722565b0191505080341015611d42576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d55611d4e86612c9c565b8787612e15565b6000858152610195602090815260408083206301e13380420190556101989091529020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861617905534818103908214611e2d57604051600090339083908381818185875af1925050503d8060008114611deb576040519150601f19603f3d011682016040523d82523d6000602084013e611df0565b606091505b5050905080611e2b576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050505050565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff16611e9e576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610196805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f646d70535c6b451b92021874a72abd441f122ba1c0b8f24d074352bd169fad3f90600090a250565b600081815261019560205260408120548015801590611f155750804210155b15611f4c576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f5583612c9c565b9392505050565b611f6461369e565b6001600160a01b038116611fa4576040517ff7eb744d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019860205260409020546001600160a01b0316611fc5612d01565b6001600160a01b031614612005576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526101996020908152604080832042905561019a9091529020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155829061205682611ef6565b6001600160a01b03167ffab80e8bf242ed27bf595552dfdddbdd794f201d6dfcd8df7347f82f8e1f1f9b60405160405180910390a45050565b3360009081527f75522faebd8252265a4c98687d4b5f5b6c3a71858d7f8312047425dcd4725046602052604090205460ff166120f7576040517f5647892800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101918190556040518181527ffba1d84f2e30311f1380f2355f294fbedd53264c2504378e2c4b2133dea166709060200160405180910390a150565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff1661219b576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006101938190556040517f03732e5295a5bd18e6ef95b03b41aa8bcadae292a7ef40468144c7a727dfa8b59190a1565b60006001600160a01b03821661224a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610bf0565b506001600160a01b031660009081526068602052604090205490565b3360009081527fc99cfc74cbb51adc7ca8731c432a51a31a086a1789003f0b773be6e802362bf4602052604090205460ff166122ce576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61152a613737565b60008181526101956020526040902054421061231e576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815261019860205260409020546001600160a01b031661233f612d01565b6001600160a01b03161461237f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526101996020526040812054908190036123c9576040517fc993b99300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6203f4808101421015612408576040517f22f607f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fd661241483611ef6565b600084815261019a60205260409020546001600160a01b031684612e15565b3360009081527f56eafcfe4e056e5ee1febf92b17728968883505f0e8dc799e4f43119d826ca85602052604090205460ff1661249b576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610192805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f255ba3357fefe42b361c216b6e0bc5541f1e6ea4c6178d4a45ad8dd7ec28139d90600090a250565b600054610100900460ff16158080156125135750600054600160ff909116105b8061252d5750303b15801561252d575060005460ff166001145b61259f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610bf0565b6000805460ff1916600117905580156125df57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61265287878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061377592505050565b61265a6137fc565b612662613881565b61266a613881565b61267c6000612677612d01565b6138fe565b610196805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385169081179091556040517f646d70535c6b451b92021874a72abd441f122ba1c0b8f24d074352bd169fad3f90600090a2610197805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040517f79025dab199855650264c602de305dcf5c292b8e5b4470ef271724a79d0343f490600090a2662386f26fc100006101918190556040519081527ffba1d84f2e30311f1380f2355f294fbedd53264c2504378e2c4b2133dea166709060200160405180910390a16001610193558015611e2d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b606060668054610ab690614ec1565b6127ef61369e565b6127f7612d01565b6001600160a01b031661280983611ef6565b6001600160a01b031614612849576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261019860209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616179055610199909152902054156128a057600082815261019960205260408120555b6040516001600160a01b0382169083907f8e700b803af43e14651431cd73c9fe7d11b131ad797576a70b893ce5766f65c390600090a35050565b60006128e585613357565b604080517fffffffffffffffffffffffffffffffff00000000000000000000000000000000871660208201526001600160a01b038087169282019290925290831660608201526080810184905260a001604051602081830303815290604052805190602001209050949350505050565b610fd6612960612d01565b8383613908565b6000828152610195602052604090205480158015906129955750600083815261019560205260409020544210155b156129cc576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c3a858585856139d6565b60606000826129e681613357565b600f5b8181601081106129fb576129fb614f69565b1a15612a0957809250612a12565b600019016129e9565b506000612a20836001614f56565b67ffffffffffffffff811115612a3857612a38614bd4565b6040519080825280601f01601f191660200182016040528015612a62576020820181803683370190505b50905060005b838111612ace57828160108110612a8157612a81614f69565b1a60f81b828281518110612a9757612a97614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101612a68565b506040518060400160405280601b81526020017f687474703a2f2f7777772e6661726361737465722e78797a2f752f000000000081525081604051602001612b17929190614f98565b6040516020818303038152906040529350505050919050565b600082815260c96020526040902060010154612b4b81613000565b610ca383836130b4565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480612be857507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610aa157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610aa1565b6000818152606760205260409020546001600160a01b03166113615760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610bf0565b6000818152606760205260408120546001600160a01b031680610aa15760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610bf0565b6000612d0b613a65565b905090565b6000818152606960205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190612d5282612c9c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b612d9c612d96612d01565b82613ac7565b612e0e5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610bf0565b610ca38383835b826001600160a01b0316612e2882612c9c565b6001600160a01b031614612ea45760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610bf0565b6001600160a01b038216612f1f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610bf0565b612f2a838383613b46565b612f35600082612d10565b6001600160a01b0383166000908152606860205260408120805460019290612f5e908490614f43565b90915550506001600160a01b0382166000908152606860205260408120805460019290612f8c908490614f56565b9091555050600081815260676020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ca3838383613b4e565b6113618161300c612d01565b613ba2565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff16610fd657600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613070612d01565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff1615610fd657600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19169055613111612d01565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6131817fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610836612d01565b611361576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131ea57610ca383613c22565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613244575060408051601f3d908101601f1916820190925261324191810190614fef565b60015b6132b65760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610bf0565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461334b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610bf0565b50610ca3838383613ced565b6010600082811a602d03613397576040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82811015610ece5760008482601081106133b6576133b6614f69565b6001909301921a905082156134055760ff811615613400576040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6134dd565b60618160ff161015801561341d5750607a8160ff1611155b15613428575061339a565b60308160ff1610158015613440575060398160ff1611155b1561344b575061339a565b8060ff16602d0361345c575061339a565b8060ff166000036134ab57816001036134a1576040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600192505061339a565b6040517f430f13b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061339a565b6001600160a01b0382166135395760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610bf0565b6000818152606760205260409020546001600160a01b03161561359e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610bf0565b6135aa60008383613b46565b6001600160a01b03821660009081526068602052604081208054600192906135d3908490614f56565b9091555050600081815260676020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610fd660008383613b4e565b61364e613d12565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613681612d01565b6040516001600160a01b03909116815260200160405180910390a1565b60fb5460ff161561152a5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610bf0565b6000611f55670de0b6b3a76400008361370986613d64565b6137139190615008565b61371d91906150c4565b613f8e565b6000611f558383670de0b6b3a76400006141b3565b61373f61369e565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613681612d01565b600054610100900460ff166137f25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b610fd682826141d2565b600054610100900460ff166138795760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b61152a614268565b600054610100900460ff1661152a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b610fd68282613011565b816001600160a01b0316836001600160a01b0316036139695760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610bf0565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6139e76139e1612d01565b83613ac7565b613a595760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610bf0565b610ece848484846142f1565b60007f0000000000000000000000007a95fa73250dc53556d264522150a940d4c502386001600160a01b03163303613ac257507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b600080613ad383612c9c565b9050806001600160a01b0316846001600160a01b03161480613b1a57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b80613b3e5750836001600160a01b0316613b3384610b39565b6001600160a01b0316145b949350505050565b610ca361369e565b6000818152610199602052604090205415613b7457600081815261019960205260408120555b600090815261019860205260409020805473ffffffffffffffffffffffffffffffffffffffff191690555050565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff16610fd657613be0816001600160a01b0316601461437a565b613beb83602061437a565b604051602001613bfc929190615135565b60408051601f198184030181529082905262461bcd60e51b8252610bf091600401614a0d565b6001600160a01b0381163b613c9f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610bf0565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b613cf6836145a3565b600082511180613d035750805b15610ca357610ece83836145e3565b60fb5460ff1661152a5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610bf0565b6000808213613db55760405162461bcd60e51b815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610bf0565b60006060613dc2846146ee565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213613fbf57506000919050565b680755bf798b4a1bf1e582126140175760405162461bcd60e51b815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610bf0565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b8282028115158415858304851417166141cb57600080fd5b0492915050565b600054610100900460ff1661424f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b606561425b8382615204565b506066610ca38282615204565b600054610100900460ff166142e55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bf0565b60fb805460ff19169055565b6142fc848484612e15565b614308848484846147aa565b610ece5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610bf0565b606060006143898360026152c4565b614394906002614f56565b67ffffffffffffffff8111156143ac576143ac614bd4565b6040519080825280601f01601f1916602001820160405280156143d6576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061440d5761440d614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061447057614470614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006144ac8460026152c4565b6144b7906001614f56565b90505b6001811115614554577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106144f8576144f8614f69565b1a60f81b82828151811061450e5761450e614f69565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361454d816152e3565b90506144ba565b508315611f555760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610bf0565b6145ac81613c22565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6146625760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610bf0565b600080846001600160a01b03168460405161467d91906152fa565b600060405180830381855af49150503d80600081146146b8576040519150601f19603f3d011682016040523d82523d6000602084013e6146bd565b606091505b50915091506146e5828260405180606001604052806027815260200161537060279139614939565b95945050505050565b600080821161473f5760405162461bcd60e51b815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610bf0565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60006001600160a01b0384163b1561492e57836001600160a01b031663150b7a026147d3612d01565b8786866040518563ffffffff1660e01b81526004016147f59493929190615316565b6020604051808303816000875af1925050508015614830575060408051601f3d908101601f1916820190925261482d91810190615352565b60015b6148e3573d80801561485e576040519150601f19603f3d011682016040523d82523d6000602084013e614863565b606091505b5080516000036148db5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610bf0565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050613b3e565b506001949350505050565b60608315614948575081611f55565b8251156149585782518084602001fd5b8160405162461bcd60e51b8152600401610bf09190614a0d565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461136157600080fd5b6000602082840312156149b257600080fd5b8135611f5581614972565b60005b838110156149d85781810151838201526020016149c0565b50506000910152565b600081518084526149f98160208601602086016149bd565b601f01601f19169290920160200192915050565b602081526000611f5560208301846149e1565b600060208284031215614a3257600080fd5b5035919050565b80356001600160a01b0381168114614a5057600080fd5b919050565b60008060408385031215614a6857600080fd5b614a7183614a39565b946020939093013593505050565b600080600060608486031215614a9457600080fd5b614a9d84614a39565b9250614aab60208501614a39565b9150604084013590509250925092565b60008060408385031215614ace57600080fd5b82359150614ade60208401614a39565b90509250929050565b600060208284031215614af957600080fd5b611f5582614a39565b80357fffffffffffffffffffffffffffffffff0000000000000000000000000000000081168114614a5057600080fd5b600080600080600060a08688031215614b4a57600080fd5b614b5386614b02565b9450614b6160208701614a39565b9350614b6f60408701614a39565b94979396509394606081013594506080013592915050565b60008060008060808587031215614b9d57600080fd5b614ba685614b02565b9350614bb460208601614a39565b925060408501359150614bc960608601614a39565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112614c1457600080fd5b813567ffffffffffffffff80821115614c2f57614c2f614bd4565b604051601f8301601f19908116603f01168101908282118183101715614c5757614c57614bd4565b81604052838152866020858801011115614c7057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215614ca357600080fd5b614cac83614a39565b9150602083013567ffffffffffffffff811115614cc857600080fd5b614cd485828601614c03565b9150509250929050565b600080600060608486031215614cf357600080fd5b614cfc84614a39565b925060208401359150614d1160408501614a39565b90509250925092565b60008083601f840112614d2c57600080fd5b50813567ffffffffffffffff811115614d4457600080fd5b602083019150836020828501011115614d5c57600080fd5b9250929050565b60008060008060008060808789031215614d7c57600080fd5b863567ffffffffffffffff80821115614d9457600080fd5b614da08a838b01614d1a565b90985096506020890135915080821115614db957600080fd5b50614dc689828a01614d1a565b9095509350614dd9905060408801614a39565b9150614de760608801614a39565b90509295509295509295565b60008060408385031215614e0657600080fd5b614e0f83614a39565b915060208301358015158114614e2457600080fd5b809150509250929050565b60008060008060808587031215614e4557600080fd5b614e4e85614a39565b9350614e5c60208601614a39565b925060408501359150606085013567ffffffffffffffff811115614e7f57600080fd5b614e8b87828801614c03565b91505092959194509250565b60008060408385031215614eaa57600080fd5b614eb383614a39565b9150614ade60208401614a39565b600181811c90821680614ed557607f821691505b602082108103614f0e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610aa157610aa1614f14565b80820180821115610aa157610aa1614f14565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008351614faa8184602088016149bd565b835190830190614fbe8183602088016149bd565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b60006020828403121561500157600080fd5b5051919050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561504957615049614f14565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561508457615084614f14565b600087129250878205871284841616156150a0576150a0614f14565b878505871281841616156150b6576150b6614f14565b505050929093029392505050565b6000826150fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60001983147f80000000000000000000000000000000000000000000000000000000000000008314161561513057615130614f14565b500590565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161516d8160178501602088016149bd565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516151aa8160288401602088016149bd565b01602801949350505050565b601f821115610ca357600081815260208120601f850160051c810160208610156151dd5750805b601f850160051c820191505b818110156151fc578281556001016151e9565b505050505050565b815167ffffffffffffffff81111561521e5761521e614bd4565b6152328161522c8454614ec1565b846151b6565b602080601f831160018114615267576000841561524f5750858301515b600019600386901b1c1916600185901b1785556151fc565b600085815260208120601f198616915b8281101561529657888601518255948401946001909101908401615277565b50858210156152b45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008160001904831182151516156152de576152de614f14565b500290565b6000816152f2576152f2614f14565b506000190190565b6000825161530c8184602087016149bd565b9190910192915050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261534860808301846149e1565b9695505050505050565b60006020828403121561536457600080fd5b8151611f558161497256fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201bc50654aaa9327b0743f4153b73854ff6461884d1531dac408b1bf6f5f44c7164736f6c63430008100033

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

0000000000000000000000007a95fa73250dc53556d264522150a940d4c50238

-----Decoded View---------------
Arg [0] : _forwarder (address): 0x7A95fA73250dc53556d264522150A940d4C50238

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a95fa73250dc53556d264522150a940d4c50238


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn 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.