ETH Price: $3,454.86 (+1.65%)

Contract

0x870851bE6e03dB864c804898a3CDCe89579C65b8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DeGodsV2

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 33 : DeGodsV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import {DeGods} from "./DeGods.sol";
import {BaseWormholeBridgedNft} from "./BaseWormholeBridgedNft.sol";
import {ERC5058Upgradeable} from "ERC5058/ERC5058Upgradeable.sol";
import {IERC5192} from "ERC5192/IERC5192.sol";
import {IWormhole} from "wormhole-solidity/IWormhole.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract DeGodsV2 is DeGods, ERC5058Upgradeable, IERC5192 {
	uint256 private constant MAX_EXPIRE_TIME =
		0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

	constructor(
		IWormhole wormhole,
		IERC20 dustToken,
		bytes32 emitterAddress,
		bytes memory baseUri
	) DeGods(wormhole, dustToken, emitterAddress, baseUri) {}

	function locked(uint256 tokenId) external view override returns (bool) {
		return isLocked(tokenId);
	}

	function _baseURI()
		internal
		view
		virtual
		override(BaseWormholeBridgedNft, ERC721Upgradeable)
		returns (string memory)
	{
		return BaseWormholeBridgedNft._baseURI();
	}

	function _beforeTokenTransfer(
		address from,
		address to,
		uint256 tokenId,
		uint256 batchSize
	) internal virtual override(ERC721Upgradeable, ERC5058Upgradeable) {
		ERC5058Upgradeable._beforeTokenTransfer(from, to, tokenId, batchSize);
	}

	function _afterTokenTransfer(
		address from,
		address to,
		uint256 tokenId,
		uint256 batchSize
	) internal virtual override(ERC721Upgradeable, ERC5058Upgradeable) {
		ERC5058Upgradeable._afterTokenTransfer(from, to, tokenId, batchSize);
	}

	function _beforeTokenLock(
		address operator,
		address owner,
		uint256 tokenId,
		uint256 expired
	) internal virtual override {
		super._beforeTokenLock(operator, owner, tokenId, expired);
		require(expired == 0 || expired == MAX_EXPIRE_TIME, "Auto expiration is not supported.");

		// Emit events for ERC5192
		if (expired != 0) {
			emit Locked(tokenId);
		} else {
			emit Unlocked(tokenId);
		}
	}

	function _burn(
		uint256 tokenId
	) internal virtual override(ERC721Upgradeable, ERC5058Upgradeable) {
		ERC5058Upgradeable._burn(tokenId);
	}

	function supportsInterface(
		bytes4 interfaceId
	) public view virtual override(BaseWormholeBridgedNft, ERC5058Upgradeable) returns (bool) {
		return
			interfaceId == type(IERC5192).interfaceId ||
			ERC5058Upgradeable.supportsInterface(interfaceId) ||
			BaseWormholeBridgedNft.supportsInterface(interfaceId);
	}

	function tokenURI(
		uint256 tokenId
	)
		public
		view
		virtual
		override(ERC721Upgradeable, BaseWormholeBridgedNft)
		returns (string memory)
	{
		return BaseWormholeBridgedNft.tokenURI(tokenId);
	}
}

File 2 of 33 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 33 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 4 of 33 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 33 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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 6 of 33 : Ownable2StepUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
    function __Ownable2Step_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable2Step_init_unchained() internal onlyInitializing {
    }
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() external {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }

    /**
     * @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 7 of 33 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

    /**
     * @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 33 : IERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981Upgradeable is IERC165Upgradeable {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 9 of 33 : 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 10 of 33 : 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 11 of 33 : 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 12 of 33 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (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.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    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.
     *
     * 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.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * 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.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    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.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 13 of 33 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 the implementation's compatibility when performing 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 14 of 33 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 = _ownerOf(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 or 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 or 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 or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721Upgradeable.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

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

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

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @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. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) 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 15 of 33 : 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 16 of 33 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 17 of 33 : 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 18 of 33 : ERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981Upgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable {
    function __ERC2981_init() internal onlyInitializing {
    }

    function __ERC2981_init_unchained() internal onlyInitializing {
    }
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981Upgradeable
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }

    /**
     * @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[48] private __gap;
}

File 19 of 33 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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 20 of 33 : 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 21 of 33 : 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
        }
    }
}

File 22 of 33 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _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) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

    /**
     * @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] = _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 23 of 33 : 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 24 of 33 : 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 25 of 33 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 26 of 33 : ERC5058Upgradeable.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.19;

import {IERC5058Upgradeable} from "./IERC5058Upgradeable.sol";
import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev Implementation ERC721 Lockable Token
 */
abstract contract ERC5058Upgradeable is ERC721Upgradeable, IERC5058Upgradeable {
	// Mapping from token ID to unlock time
	mapping(uint256 => uint256) public lockedTokens;

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

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

	/**
	 * @dev See {IERC5058-lockApprove}.
	 */
	function lockApprove(address to, uint256 tokenId) public virtual override {
		require(!isLocked(tokenId), "ERC5058: token is locked");
		address owner = ERC721Upgradeable.ownerOf(tokenId);
		require(to != owner, "ERC5058: lock approval to current owner");

		require(
			_msgSender() == owner || isLockApprovedForAll(owner, _msgSender()),
			"ERC5058: lock approve caller is not owner nor approved for all"
		);

		_lockApprove(owner, to, tokenId);
	}

	/**
	 * @dev See {IERC5058-getLockApproved}.
	 */
	function getLockApproved(uint256 tokenId) public view virtual override returns (address) {
		require(_exists(tokenId), "ERC5058: lock approved query for nonexistent token");

		return _lockApprovals[tokenId];
	}

	/**
	 * @dev See {IERC5058-lockerOf}.
	 */
	function lockerOf(uint256 tokenId) public view virtual override returns (address) {
		require(_exists(tokenId), "ERC5058: locker query for nonexistent token");
		require(isLocked(tokenId), "ERC5058: locker query for non-locked token");

		return _lockApprovals[tokenId];
	}

	/**
	 * @dev See {IERC5058-setLockApprovalForAll}.
	 */
	function setLockApprovalForAll(address operator, bool approved) public virtual override {
		_setLockApprovalForAll(_msgSender(), operator, approved);
	}

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

	/**
	 * @dev See {IERC5058-isLocked}.
	 */
	function isLocked(uint256 tokenId) public view virtual override returns (bool) {
		return lockedTokens[tokenId] > block.number;
	}

	/**
	 * @dev See {IERC5058-lockExpiredTime}.
	 */
	function lockExpiredTime(uint256 tokenId) public view virtual override returns (uint256) {
		return lockedTokens[tokenId];
	}

	/**
	 * @dev See {IERC5058-lock}.
	 */
	function lock(uint256 tokenId, uint256 expired) public virtual override {
		require(
			_isLockApprovedOrOwner(_msgSender(), tokenId),
			"ERC5058: lock caller is not owner nor approved"
		);
		require(
			expired > block.number,
			"ERC5058: expired time must be greater than current block number"
		);
		require(!isLocked(tokenId), "ERC5058: token is locked");

		_lock(_msgSender(), tokenId, expired);
	}

	/**
	 * @dev See {IERC5058-unlock}.
	 */
	function unlock(uint256 tokenId) public virtual override {
		require(lockerOf(tokenId) == _msgSender(), "ERC5058: unlock caller is not lock operator");

		address from = ERC721Upgradeable.ownerOf(tokenId);

		_beforeTokenLock(_msgSender(), from, tokenId, 0);

		delete lockedTokens[tokenId];

		emit Unlocked(_msgSender(), from, tokenId);

		_afterTokenLock(_msgSender(), from, tokenId, 0);
	}

	/**
	 * @dev Locks `tokenId` from `from`  until `expired`.
	 *
	 * Requirements:
	 *
	 * - `tokenId` token must be owned by `from`.
	 *
	 * Emits a {Locked} event.
	 */
	function _lock(address operator, uint256 tokenId, uint256 expired) internal virtual {
		address owner = ERC721Upgradeable.ownerOf(tokenId);

		_beforeTokenLock(operator, owner, tokenId, expired);

		lockedTokens[tokenId] = expired;
		_lockApprovals[tokenId] = operator;

		emit Locked(operator, owner, tokenId, expired);

		_afterTokenLock(operator, owner, tokenId, expired);
	}

	/**
	 * @dev Safely mints `tokenId` and transfers it to `to`, but the `tokenId` is locked and cannot be transferred.
	 *
	 * Requirements:
	 *
	 * - `tokenId` must not exist.
	 *
	 * Emits {Locked} and {Transfer} event.
	 */
	function _safeLockMint(
		address to,
		uint256 tokenId,
		uint256 expired,
		bytes memory _data
	) internal virtual {
		require(expired > block.number, "ERC5058: lock mint for invalid lock block number");

		_safeMint(to, tokenId, _data);

		_lock(_msgSender(), tokenId, expired);
	}

	/**
	 * @dev See {ERC721-_burn}. This override additionally clears the lock approvals for the token.
	 */
	function _burn(uint256 tokenId) internal virtual override {
		address owner = ERC721Upgradeable.ownerOf(tokenId);
		super._burn(tokenId);

		_beforeTokenLock(_msgSender(), owner, tokenId, 0);

		// clear lock approvals
		delete lockedTokens[tokenId];
		delete _lockApprovals[tokenId];

		_afterTokenLock(_msgSender(), owner, tokenId, 0);
	}

	/**
	 * @dev Approve `to` to lock operate on `tokenId`
	 *
	 * Emits a {LockApproval} event.
	 */
	function _lockApprove(address owner, address to, uint256 tokenId) internal virtual {
		_lockApprovals[tokenId] = to;
		emit LockApproval(owner, to, tokenId);
	}

	/**
	 * @dev Approve `operator` to lock operate on all of `owner` tokens
	 *
	 * Emits a {LockApprovalForAll} event.
	 */
	function _setLockApprovalForAll(
		address owner,
		address operator,
		bool approved
	) internal virtual {
		require(owner != operator, "ERC5058: lock approve to caller");
		_lockOperatorApprovals[owner][operator] = approved;
		emit LockApprovalForAll(owner, operator, approved);
	}

	/**
	 * @dev Returns whether `spender` is allowed to lock `tokenId`.
	 *
	 * Requirements:
	 *
	 * - `tokenId` must exist.
	 */
	function _isLockApprovedOrOwner(
		address spender,
		uint256 tokenId
	) internal view virtual returns (bool) {
		require(_exists(tokenId), "ERC5058: lock operator query for nonexistent token");
		address owner = ERC721Upgradeable.ownerOf(tokenId);
		return (spender == owner ||
			isLockApprovedForAll(owner, spender) ||
			getLockApproved(tokenId) == spender);
	}

	/**
	 * @dev See {ERC721-_beforeTokenTransfer}.
	 *
	 * Requirements:
	 *
	 * - the `tokenId` must not be locked.
	 */
	function _beforeTokenTransfer(
		address from,
		address to,
		uint256 tokenId,
		uint256 batchSize
	) internal virtual override {
		super._beforeTokenTransfer(from, to, tokenId, batchSize);

		require(!isLocked(tokenId), "ERC5058: token transfer while locked");
	}

	function _afterTokenTransfer(
		address from,
		address to,
		uint256 tokenId,
		uint256 batchSize
	) internal virtual override {
		super._afterTokenTransfer(from, to, tokenId, batchSize);
		// Revoke the lock approval from the previous owner on the current token.
		delete _lockApprovals[tokenId];
	}

	/**
	 * @dev Hook that is called before any token lock/unlock.
	 *
	 * Calling conditions:
	 *
	 * - `owner` is non-zero.
	 * - When `expired` is zero, `tokenId` will be unlock for `from`.
	 * - When `expired` is non-zero, ``from``'s `tokenId` will be locked.
	 *
	 */
	function _beforeTokenLock(
		address operator,
		address owner,
		uint256 tokenId,
		uint256 expired
	) internal virtual {}

	/**
	 * @dev Hook that is called after any lock/unlock of tokens.
	 *
	 * Calling conditions:
	 *
	 * - `owner` is non-zero.
	 * - When `expired` is zero, `tokenId` will be unlock for `from`.
	 * - When `expired` is non-zero, ``from``'s `tokenId` will be locked.
	 *
	 */
	function _afterTokenLock(
		address operator,
		address owner,
		uint256 tokenId,
		uint256 expired
	) internal virtual {}

	/**
	 * @dev See {IERC165-supportsInterface}.
	 */
	function supportsInterface(
		bytes4 interfaceId
	) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) {
		return
			interfaceId == type(IERC5058Upgradeable).interfaceId ||
			super.supportsInterface(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 27 of 33 : IERC5058Upgradeable.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.19;

import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";

/**
 * @dev ERC-721 Non-Fungible Token Standard, optional lockable extension
 * ERC721 Token that can be locked for a certain period and cannot be transferred.
 * This is designed for a non-escrow staking contract that comes later to lock a user's NFT
 * while still letting them keep it in their wallet.
 * This extension can ensure the security of user tokens during the staking period.
 * If the nft lending protocol is compatible with this extension, the trouble caused by the NFT
 * airdrop can be avoided, because the airdrop is still in the user's wallet
 */

interface IERC5058Upgradeable is IERC721Upgradeable {
	/**
	 * @dev Emitted when `tokenId` token is locked by `operator` from `owner`.
	 */
	event Locked(
		address indexed operator,
		address indexed owner,
		uint256 indexed tokenId,
		uint256 expired
	);

	/**
	 * @dev Emitted when `tokenId` token is unlocked by `operator` from `owner`.
	 */
	event Unlocked(address indexed operator, address indexed owner, uint256 indexed tokenId);

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

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

	/**
	 * @dev Returns the locker who is locking the `tokenId` token.
	 *
	 * Requirements:
	 *
	 * - `tokenId` must exist.
	 */
	function lockerOf(uint256 tokenId) external view returns (address locker);

	/**
	 * @dev Lock `tokenId` token until the block number is greater than `expired` to be unlocked.
	 *
	 * Requirements:
	 *
	 * - `tokenId` token must be owned by `owner`.
	 * - `expired` must be greater than block.number
	 * - If the caller is not `from`, it must be approved to lock this token
	 * by either {lockApprove} or {setLockApprovalForAll}.
	 *
	 * Emits a {Locked} event.
	 */
	function lock(uint256 tokenId, uint256 expired) external;

	/**
	 * @dev Unlock `tokenId` token.
	 *
	 * Requirements:
	 *
	 * - `tokenId` token must be owned by `from`.
	 * - the caller must be the operator who locks the token by {lock}
	 *
	 * Emits a {Unlocked} event.
	 */
	function unlock(uint256 tokenId) external;

	/**
	 * @dev Gives permission to `to` to lock `tokenId` token.
	 *
	 * Requirements:
	 *
	 * - The caller must own the token or be an approved lock operator.
	 * - `tokenId` must exist.
	 *
	 * Emits an {LockApproval} event.
	 */
	function lockApprove(address to, uint256 tokenId) external;

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

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

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

	/**
	 * @dev Returns if the `tokenId` token is locked.
	 */
	function isLocked(uint256 tokenId) external view returns (bool);

	/**
	 * @dev Returns the `tokenId` token lock expired time.
	 */
	function lockExpiredTime(uint256 tokenId) external view returns (uint256);
}

File 28 of 33 : IERC5192.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.19;

interface IERC5192 {
	/// @notice Emitted when the locking status is changed to locked.
	/// @dev If a token is minted and the status is locked, this event should be emitted.
	/// @param tokenId The identifier for a token.
	event Locked(uint256 tokenId);

	/// @notice Emitted when the locking status is changed to unlocked.
	/// @dev If a token is minted and the status is unlocked, this event should be emitted.
	/// @param tokenId The identifier for a token.
	event Unlocked(uint256 tokenId);

	/// @notice Returns the locking status of an Soulbound Token
	/// @dev SBTs assigned to zero address are considered invalid, and queries
	/// about them do throw.
	/// @param tokenId The identifier for an SBT.
	function locked(uint256 tokenId) external view returns (bool);
}

File 29 of 33 : BytesLib.sol
// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      This is a reduced version of the library.
 */
pragma solidity >=0.8.0 <0.9.0;

library BytesLib {
    uint256 private constant freeMemoryPtr = 0x40;
    uint256 private constant maskModulo32 = 0x1f;
    /**
     * Size of word read by `mload` instruction.
     */
    uint256 private constant memoryWord = 32;
    uint256 internal constant uint8Size = 1;
    uint256 internal constant uint16Size = 2;
    uint256 internal constant uint32Size = 4;
    uint256 internal constant uint64Size = 8;
    uint256 internal constant uint128Size = 16;
    uint256 internal constant uint256Size = 32;
    uint256 internal constant addressSize = 20;
    /**
     * Bits in 12 bytes.
     */
    uint256 private constant bytes12Bits = 96;

    function slice(bytes memory buffer, uint256 startIndex, uint256 length) internal pure returns (bytes memory) {
        unchecked {
            require(length + 31 >= length, "slice_overflow");
        }
        require(buffer.length >= startIndex + length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly ("memory-safe") {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(freeMemoryPtr)

            switch iszero(length)
            case 0 {
                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(length, maskModulo32)
                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let startOffset := add(lengthmod, mul(memoryWord, iszero(lengthmod)))

                let dst := add(tempBytes, startOffset)
                let end := add(dst, length)

                for { let src := add(add(buffer, startOffset), startIndex) } lt(dst, end) {
                    dst := add(dst, memoryWord)
                    src := add(src, memoryWord)
                } { mstore(dst, mload(src)) }

                // Update free-memory pointer
                // allocating the array padded to 32 bytes like the compiler does now
                // Note that negating bitwise the `maskModulo32` produces a mask that aligns addressing to 32 bytes.
                mstore(freeMemoryPtr, and(add(dst, maskModulo32), not(maskModulo32)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default { mstore(freeMemoryPtr, add(tempBytes, memoryWord)) }

            // Store the length of the buffer
            // We need to do it even if the length is zero because Solidity does not garbage collect
            mstore(tempBytes, length)
        }

        return tempBytes;
    }

    function toAddress(bytes memory buffer, uint256 startIndex) internal pure returns (address) {
        require(buffer.length >= startIndex + addressSize, "toAddress_outOfBounds");
        address tempAddress;

        assembly ("memory-safe") {
            // We want to shift into the lower 12 bytes and leave the upper 12 bytes clear.
            tempAddress := shr(bytes12Bits, mload(add(add(buffer, memoryWord), startIndex)))
        }

        return tempAddress;
    }

    function toUint8(bytes memory buffer, uint256 startIndex) internal pure returns (uint8) {
        require(buffer.length > startIndex, "toUint8_outOfBounds");

        // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
        uint256 startOffset = startIndex + uint8Size;
        uint8 tempUint;
        assembly ("memory-safe") {
            tempUint := mload(add(buffer, startOffset))
        }
        return tempUint;
    }

    function toUint16(bytes memory buffer, uint256 startIndex) internal pure returns (uint16) {
        uint256 endIndex = startIndex + uint16Size;
        require(buffer.length >= endIndex, "toUint16_outOfBounds");

        uint16 tempUint;
        assembly ("memory-safe") {
            // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
            tempUint := mload(add(buffer, endIndex))
        }
        return tempUint;
    }

    function toUint32(bytes memory buffer, uint256 startIndex) internal pure returns (uint32) {
        uint256 endIndex = startIndex + uint32Size;
        require(buffer.length >= endIndex, "toUint32_outOfBounds");

        uint32 tempUint;
        assembly ("memory-safe") {
            // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
            tempUint := mload(add(buffer, endIndex))
        }
        return tempUint;
    }

    function toUint64(bytes memory buffer, uint256 startIndex) internal pure returns (uint64) {
        uint256 endIndex = startIndex + uint64Size;
        require(buffer.length >= endIndex, "toUint64_outOfBounds");

        uint64 tempUint;
        assembly ("memory-safe") {
            // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
            tempUint := mload(add(buffer, endIndex))
        }
        return tempUint;
    }

    function toUint128(bytes memory buffer, uint256 startIndex) internal pure returns (uint128) {
        uint256 endIndex = startIndex + uint128Size;
        require(buffer.length >= endIndex, "toUint128_outOfBounds");

        uint128 tempUint;
        assembly ("memory-safe") {
            // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
            tempUint := mload(add(buffer, endIndex))
        }
        return tempUint;
    }

    function toUint256(bytes memory buffer, uint256 startIndex) internal pure returns (uint256) {
        uint256 endIndex = startIndex + uint256Size;
        require(buffer.length >= endIndex, "toUint256_outOfBounds");

        uint256 tempUint;
        assembly ("memory-safe") {
            // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
            tempUint := mload(add(buffer, endIndex))
        }
        return tempUint;
    }

    function toBytes32(bytes memory buffer, uint256 startIndex) internal pure returns (bytes32) {
        uint256 endIndex = startIndex + uint256Size;
        require(buffer.length >= endIndex, "toBytes32_outOfBounds");

        bytes32 tempBytes32;
        assembly ("memory-safe") {
            // Note that `endIndex == startOffset` for a given buffer due to the 32 bytes at the start that store the length.
            tempBytes32 := mload(add(buffer, endIndex))
        }
        return tempBytes32;
    }
}

File 30 of 33 : IWormhole.sol
// contracts/Messages.sol
// SPDX-License-Identifier: Apache 2

pragma solidity ^0.8.0;

interface IWormhole {
    struct GuardianSet {
        address[] keys;
        uint32 expirationTime;
    }

    struct Signature {
        bytes32 r;
        bytes32 s;
        uint8 v;
        uint8 guardianIndex;
    }

    struct VM {
        uint8 version;
        uint32 timestamp;
        uint32 nonce;
        uint16 emitterChainId;
        bytes32 emitterAddress;
        uint64 sequence;
        uint8 consistencyLevel;
        bytes payload;
        uint32 guardianSetIndex;
        Signature[] signatures;
        bytes32 hash;
    }

    struct ContractUpgrade {
        bytes32 module;
        uint8 action;
        uint16 chain;
        address newContract;
    }

    struct GuardianSetUpgrade {
        bytes32 module;
        uint8 action;
        uint16 chain;
        GuardianSet newGuardianSet;
        uint32 newGuardianSetIndex;
    }

    struct SetMessageFee {
        bytes32 module;
        uint8 action;
        uint16 chain;
        uint256 messageFee;
    }

    struct TransferFees {
        bytes32 module;
        uint8 action;
        uint16 chain;
        uint256 amount;
        bytes32 recipient;
    }

    struct RecoverChainId {
        bytes32 module;
        uint8 action;
        uint256 evmChainId;
        uint16 newChainId;
    }

    event LogMessagePublished(
        address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel
    );
    event ContractUpgraded(address indexed oldContract, address indexed newContract);
    event GuardianSetAdded(uint32 indexed index);

    function publishMessage(uint32 nonce, bytes memory payload, uint8 consistencyLevel)
        external
        payable
        returns (uint64 sequence);

    function initialize() external;

    function parseAndVerifyVM(bytes calldata encodedVM)
        external
        view
        returns (VM memory vm, bool valid, string memory reason);

    function verifyVM(VM memory vm) external view returns (bool valid, string memory reason);

    function verifySignatures(bytes32 hash, Signature[] memory signatures, GuardianSet memory guardianSet)
        external
        pure
        returns (bool valid, string memory reason);

    function parseVM(bytes memory encodedVM) external pure returns (VM memory vm);

    function quorum(uint256 numGuardians) external pure returns (uint256 numSignaturesRequiredForQuorum);

    function getGuardianSet(uint32 index) external view returns (GuardianSet memory);

    function getCurrentGuardianSetIndex() external view returns (uint32);

    function getGuardianSetExpiry() external view returns (uint32);

    function governanceActionIsConsumed(bytes32 hash) external view returns (bool);

    function isInitialized(address impl) external view returns (bool);

    function chainId() external view returns (uint16);

    function isFork() external view returns (bool);

    function governanceChainId() external view returns (uint16);

    function governanceContract() external view returns (bytes32);

    function messageFee() external view returns (uint256);

    function evmChainId() external view returns (uint256);

    function nextSequence(address emitter) external view returns (uint64);

    function parseContractUpgrade(bytes memory encodedUpgrade) external pure returns (ContractUpgrade memory cu);

    function parseGuardianSetUpgrade(bytes memory encodedUpgrade)
        external
        pure
        returns (GuardianSetUpgrade memory gsu);

    function parseSetMessageFee(bytes memory encodedSetMessageFee) external pure returns (SetMessageFee memory smf);

    function parseTransferFees(bytes memory encodedTransferFees) external pure returns (TransferFees memory tf);

    function parseRecoverChainId(bytes memory encodedRecoverChainId)
        external
        pure
        returns (RecoverChainId memory rci);

    function submitContractUpgrade(bytes memory _vm) external;

    function submitSetMessageFee(bytes memory _vm) external;

    function submitNewGuardianSet(bytes memory _vm) external;

    function submitTransferFees(bytes memory _vm) external;

    function submitRecoverChainId(bytes memory _vm) external;
}

File 31 of 33 : BaseWormholeBridgedNft.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import {ERC2981Upgradeable} from "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import {IWormhole} from "wormhole-solidity/IWormhole.sol";
import {BytesLib} from "wormhole-solidity/BytesLib.sol";
import {DummyERC721EnumerableUpgradeable} from "./DummyERC721EnumerableUpgradeable.sol";

/**
 * @title  DeBridge
 * @notice ERC721 that mints tokens based on VAAs.
 */
abstract contract BaseWormholeBridgedNft is
	UUPSUpgradeable,
	DummyERC721EnumerableUpgradeable,
	ERC2981Upgradeable,
	Ownable2StepUpgradeable
{
	using BytesLib for bytes;
	using SafeERC20 for IERC20;

	// Wormhole chain id that valid vaas must have -- must be Solana.
	uint16 constant SOURCE_CHAIN_ID = 1;

	// -- immutable members (baked into the code by the constructor of the logic contract)

	// Core layer Wormhole contract.
	IWormhole private immutable _wormhole;
	// ERC20 DUST token contract.
	IERC20 private immutable _dustToken;
	// Only VAAs from this emitter can mint NFTs with our contract (prevents spoofing).
	bytes32 private immutable _emitterAddress;
	// Common URI for all NFTs handled by this contract.
	bytes32 private immutable _baseUri;
	uint8 private immutable _baseUriLength;

	// Amount of DUST to transfer to the minter on upon relayed mint.
	uint256 private _dustAmountOnMint;
	// Amount of gas token (ETH, MATIC, etc.) to transfer to the minter on upon relayed mint.
	uint256 private _gasTokenAmountOnMint;
	// Dictionary of VAA hash => flag that keeps track of claimed VAAs
	mapping(bytes32 => bool) private _claimedVaas;

	error WrongEmitterChainId();
	error WrongEmitterAddress();
	error FailedVaaParseAndVerification(string reason);
	error VaaAlreadyClaimed();
	error InvalidMessageLength();
	error BaseUriEmpty();
	error BaseUriTooLong();
	error InvalidMsgValue();

	event Minted(uint256 indexed tokenId, address indexed receiver);

	//constructor for the logic(!) contract
	constructor(
		IWormhole wormhole,
		IERC20 dustToken,
		bytes32 emitterAddress,
		bytes memory baseUri
	) {
		if (baseUri.length == 0) {
			revert BaseUriEmpty();
		}
		if (baseUri.length > 32) {
			revert BaseUriTooLong();
		}

		_wormhole = wormhole;
		_dustToken = dustToken;
		_emitterAddress = emitterAddress;
		_baseUri = bytes32(baseUri);
		_baseUriLength = uint8(baseUri.length);

		//brick logic contract
		initialize("", "", 0, 0, address(1), 0);
		renounceOwnership();
	}

	//intentionally empty (we only want the onlyOwner modifier "side-effect")
	function _authorizeUpgrade(address) internal override onlyOwner {}

	//"constructor" of the proxy contract
	function initialize(
		string memory name,
		string memory symbol,
		uint256 dustAmountOnMint,
		uint256 gasTokenAmountOnMint,
		address royaltyReceiver,
		uint96 royaltyFeeNumerator
	) public initializer {
		_dustAmountOnMint = dustAmountOnMint;
		_gasTokenAmountOnMint = gasTokenAmountOnMint;
		__UUPSUpgradeable_init();
		__ERC721_init(name, symbol);
		__ERC2981_init();
		__Ownable_init();

		_setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator);
	}

	function updateAmountsOnMint(
		uint256 dustAmountOnMint,
		uint256 gasTokenAmountOnMint
	) external onlyOwner {
		_dustAmountOnMint = dustAmountOnMint;
		_gasTokenAmountOnMint = gasTokenAmountOnMint;
	}

	function getAmountsOnMint()
		external
		view
		returns (uint256 dustAmountOnMint, uint256 gasTokenAmountOnMint)
	{
		dustAmountOnMint = _dustAmountOnMint;
		gasTokenAmountOnMint = _gasTokenAmountOnMint;
	}

	/**
	 * Mints an NFT based on an valid VAA and kickstarts the recipient's wallet with
	 *   gas tokens (ETH or MATIC) and DUST (taken from msg.sender unless msg.sender is recipient).
	 * TokenId and recipient address are taken from the VAA.
	 * The Wormhole message must have been published by the DeBridge instance of the
	 *   NFT collection with the specified emitter on Solana (chainId = 1).
	 */
	function receiveAndMint(bytes calldata vaa) external payable {
		(IWormhole.VM memory vm, bool valid, string memory reason) = _wormhole.parseAndVerifyVM(
			vaa
		);
		if (!valid) revert FailedVaaParseAndVerification(reason);

		if (vm.emitterChainId != SOURCE_CHAIN_ID) revert WrongEmitterChainId();

		if (vm.emitterAddress != _emitterAddress) revert WrongEmitterAddress();

		if (_claimedVaas[vm.hash]) revert VaaAlreadyClaimed();

		_claimedVaas[vm.hash] = true;

		(uint256 tokenId, address evmRecipient) = parsePayload(vm.payload);
		_safeMint(evmRecipient, tokenId);
		emit Minted(tokenId, evmRecipient);

		if (msg.sender != evmRecipient) {
			if (msg.value != _gasTokenAmountOnMint) revert InvalidMsgValue();

			payable(evmRecipient).transfer(msg.value);
			_dustToken.safeTransferFrom(msg.sender, evmRecipient, _dustAmountOnMint);
		}
		//if the recipient relays the message themselves then they must not include any gas token
		else if (msg.value != 0) revert InvalidMsgValue();
	}

	function parsePayload(
		bytes memory message
	) internal pure returns (uint256 tokenId, address evmRecipient) {
		if (message.length != BytesLib.uint16Size + BytesLib.addressSize)
			revert InvalidMessageLength();

		tokenId = message.toUint16(0);
		evmRecipient = message.toAddress(BytesLib.uint16Size);
	}

	// ---- ERC721 ----

	function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
		return string.concat(super.tokenURI(tokenId), ".json");
	}

	function _baseURI() internal view virtual override returns (string memory baseUri) {
		baseUri = new string(_baseUriLength);
		bytes32 tmp = _baseUri;
		assembly ("memory-safe") {
			mstore(add(baseUri, 32), tmp)
		}
	}

	// ---- ERC2981 ----

	function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner {
		_setDefaultRoyalty(receiver, feeNumerator);
	}

	function deleteDefaultRoyalty() external onlyOwner {
		_deleteDefaultRoyalty();
	}

	function setTokenRoyalty(
		uint256 tokenId,
		address receiver,
		uint96 feeNumerator
	) external onlyOwner {
		_setTokenRoyalty(tokenId, receiver, feeNumerator);
	}

	function resetTokenRoyalty(uint256 tokenId) external onlyOwner {
		_resetTokenRoyalty(tokenId);
	}

	// ---- ERC165 ----

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

File 32 of 33 : DeGods.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {BaseWormholeBridgedNft} from "./BaseWormholeBridgedNft.sol";
import {IWormhole} from "wormhole-solidity/IWormhole.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract DeGods is BaseWormholeBridgedNft {
	constructor(
		IWormhole wormhole,
		IERC20 dustToken,
		bytes32 emitterAddress,
		bytes memory baseUri
	) BaseWormholeBridgedNft(wormhole, dustToken, emitterAddress, baseUri) {}
}

File 33 of 33 : DummyERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

// This a dummy implementation to the true ERC721EnumerableUpgradeable that maintains the identical storage layout but
// removes all the ERC721Enumerable methods from the ABI.
//
// IMPORTANT: please make sure the storage layout is identical to ERC721EnumerableUpgradeable!!!!!
abstract contract DummyERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable {
	mapping(address => mapping(uint256 => uint256)) internal _ownedTokens;
	mapping(uint256 => uint256) internal _ownedTokensIndex;
	uint256[] internal _allTokens;
	mapping(uint256 => uint256) internal _allTokensIndex;
	uint256[46] private __gap;
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ERC5058/=modules/ERC5058/",
    "ERC5192/=modules/ERC5192/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "opensea/=modules/opensea/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "wormhole-solidity/=modules/wormhole/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IWormhole","name":"wormhole","type":"address"},{"internalType":"contract IERC20","name":"dustToken","type":"address"},{"internalType":"bytes32","name":"emitterAddress","type":"bytes32"},{"internalType":"bytes","name":"baseUri","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BaseUriEmpty","type":"error"},{"inputs":[],"name":"BaseUriTooLong","type":"error"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"FailedVaaParseAndVerification","type":"error"},{"inputs":[],"name":"InvalidMessageLength","type":"error"},{"inputs":[],"name":"InvalidMsgValue","type":"error"},{"inputs":[],"name":"VaaAlreadyClaimed","type":"error"},{"inputs":[],"name":"WrongEmitterAddress","type":"error"},{"inputs":[],"name":"WrongEmitterChainId","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":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":"LockApproval","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":"LockApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expired","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","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":[],"name":"deleteDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAmountsOnMint","outputs":[{"internalType":"uint256","name":"dustAmountOnMint","type":"uint256"},{"internalType":"uint256","name":"gasTokenAmountOnMint","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getLockApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"dustAmountOnMint","type":"uint256"},{"internalType":"uint256","name":"gasTokenAmountOnMint","type":"uint256"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"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":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isLockApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"expired","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"lockApprove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"lockExpiredTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"lockerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"pendingOwner","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":"bytes","name":"vaa","type":"bytes"}],"name":"receiveAndMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setLockApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","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":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dustAmountOnMint","type":"uint256"},{"internalType":"uint256","name":"gasTokenAmountOnMint","type":"uint256"}],"name":"updateAmountsOnMint","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"}]

6040610140815234620006255762003ed0803803806200001f816200064a565b92833981019160808284031262000625578151916001600160a01b038084168403620006255760209384830151828116810362000625578385015160608501516001600160401b039586821162000625570191601f93898585011215620006255783518781116200036d57601f19946200009f82880187168c016200064a565b9b828d528b838301011162000625578a9060005b838110620006105750506000918c01015230608052895115620005ff57888a5111620005ee5760a05260c05260e0528651968681015197878110620005d9575b5061010097885260ff8091511696610120978852620001116200062a565b9260008452620001206200062a565b906000825260005495848760081c161595868097620005cc575b8015620005b4575b156200055957600197878960ff1983161760005562000546575b5060006101c35560006101c455620001918660005460081c16620001808162000670565b6200018b8162000670565b62000670565b8051908a82116200036d5760c954908982811c921680156200053b575b8783101462000451578184849311620004e4575b5086908483116001146200047e5760009262000472575b5050600019600383901b1c191690881b1760c9555b8251928984116200036d5760ca54928884811c9416801562000467575b8685101462000451578383869511620003f6575b50859284116001146200038f575060009262000383575b5050600019600383901b1c191690851b1760ca555b62000263600054928360081c16620001808162000670565b610191805461015f80547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e098919790966001600160a01b0319969387169592339089168b600080a38b51808d019b8c11818d10176200036d578360009c918d928f5284815201528161012d5562000335575b50505055803316911617905533908280a351906137fe9283620006d28439608051838181611a9501528181611b850152611eb6015260a0518361045b015260c051836106d2015260e051836104b601525182610d1101525181610ce50152f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989261ff0019168a558a51908152a1388080620002d5565b634e487b7160e01b600052604160045260246000fd5b01519050388062000236565b8894929192169160ca600052856000209260005b87828210620003df5750508411620003c5575b505050811b0160ca556200024b565b015160001960f88460031b161c19169055388080620003b6565b8385015186558b97909501949384019301620003a3565b909192935060ca600052856000208480870160051c82019288881062000447575b9187968c92969594930160051c01915b828110620004375750506200021f565b600081558796508b910162000427565b9250819262000417565b634e487b7160e01b600052602260045260246000fd5b93607f16936200020b565b015190503880620001d9565b90858b94169160c9600052886000209260005b8a828210620004cd5750508411620004b3575b505050811b0160c955620001ee565b015160001960f88460031b161c19169055388080620004a4565b8385015186558e9790950194938401930162000491565b90915060c9600052866000208480850160051c82019289861062000531575b918c91869594930160051c01915b82811062000521575050620001c2565b600081558594508c910162000511565b9250819262000503565b91607f1691620001ae565b61ffff191661010117600055386200015c565b8a5162461bcd60e51b815260048101869052602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b15801562000142575060018689161462000142565b506001868916106200013a565b60001990880360031b1b9097169638620000f3565b875163d1eae93360e01b8152600490fd5b8751633b0187cd60e21b8152600490fd5b818101830151818f018401528c9201620000b3565b600080fd5b60405190602082016001600160401b038111838210176200036d57604052565b6040519190601f01601f191682016001600160401b038111838210176200036d57604052565b156200067857565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fdfe6080806040526004908136101561001557600080fd5b600090813560e01c90816301ffc9a7146128695750806304634d8d1461283057806306fdde031461278a578063081812fc1461276c578063095ea7b3146125f6578063121cba19146125d85780631338736f146122cf578063179a9c0f1461213e5780631ddae4f914610c7557806323b872dd146121195780632a55205a1461205c5780633659cfe614611e8e57806342842e0e14611e5b5780634ce17b8614611e3d5780634f1ef28614611b4557806352d1902d14611a815780635944c753146119a75780636198e339146118b15780636352211e146118815780636a76d4ae1461185a57806370a08231146117c3578063715018a61461175a57806379ba5097146116d35780638a616bc0146116a65780638da5cb5b1461167c57806391c79cd71461162b57806395d89b411461154657806397b33552146110d6578063a22cb46514611012578063aa1b103f14610ff1578063b128a29914610fce578063b45a3c0e14610fa1578063b88d4fde14610f2a578063c87b56dd14610ca0578063dcec329414610c75578063e02c792c146103d2578063e30c3978146103a8578063e985e9c514610358578063f2fde38b146102e8578063f4bbcb291461021f5763f6aacfb1146101e657600080fd5b3461021c57602036600319011261021c57602061021283356000526101c6602052604060002054431090565b6040519015158152f35b80fd5b5090346102e45761022f36612a9c565b6001600160a01b03909116913383146102a057503383526101c86020526040832082845260205261026f81604085209060ff801983541691151516179055565b60405190151581527fbb3b2937fc41058c97e1ad0d0bbac3c664894dd823924eb7717d814fe700f03460203392a380f35b60649060206040519162461bcd60e51b8352820152601f60248201527f455243353035383a206c6f636b20617070726f766520746f2063616c6c6572006044820152fd5b5080fd5b503461021c57602036600319011261021c576103026128ee565b61030a612b21565b61019180546001600160a01b0319166001600160a01b0392831690811790915561015f549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b503461021c57604036600319011261021c5760ff60406020926103796128ee565b610381612909565b6001600160a01b03918216835260ce86528383209116825284522054604051911615158152f35b503461021c578060031936011261021c57610191546040516001600160a01b039091168152602090f35b509060203660031901126102e45780356001600160401b038111610c715736602382011215610c7157808201356001600160401b038111610c6d57602491843684848401011161021c5783926040519283809263607ec5ef60e11b8252602089830152808783015280604498899401848401378181018301859052601f01601f191681010301817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610c6257859186908792610994575b501561096d575061ffff906001826060830151160361095c5760808101517f00000000000000000000000000000000000000000000000000000000000000000361094b576101408101805187526101c5908160205260ff60408920541661093a5751875260205260408620805460ff1916600117905560e001518051909190601519016109295760028251106108f0576002820151169060168151106108b6576022015160601c9060405161054a816129e3565b868152821561087457600082815260cb6020526040902054610578906001600160a01b031615155b15613668565b610590826000526101c6602052604060002054431090565b61082557600082815260cb602052604090205461063591610630916105bf906001600160a01b03161515610572565b84895260cc602052604089206001815401905583895260cb602052604089206001600160601b0360a01b90868282541617905584868b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46101c760205260408a209081541690558385613110565b612e9b565b81604051917fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e8880a333821461080b57506101c45434036107fa57848034156107f1575b81808092853491f1156107e6576101c3546040519060208201926323b872dd60e01b845233858401528583015260648201526064815260a08101918183106001600160401b038411176107d457604083905261074792917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316918891829190610709866129b2565b602086527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460c0820152519082855af1610741612ccc565b916136b4565b805180610757575b505050505080f35b81602091810103126107d057602061076f910161365b565b1561077b57808061074f565b60849291602a7f5361666545524332303a204552433230206f7065726174696f6e20646964206e9260206040519562461bcd60e51b8752860152840152820152691bdd081cdd58d8d9595960b21b6064820152fd5b8480fd5b634e487b7160e01b8752604186528387fd5b6040513d86823e3d90fd5b506108fc610679565b604051631841b4e160e01b81528490fd5b925050503461081957505080f35b631841b4e160e01b8152fd5b60405162461bcd60e51b81526020818801528085018590527f455243353035383a20746f6b656e207472616e73666572207768696c65206c6f818701526318dad95960e21b6064820152608490fd5b60405162461bcd60e51b81526020818801819052818601527f4552433732313a206d696e7420746f20746865207a65726f206164647265737381870152606490fd5b60405162461bcd60e51b815260208187015260158185015274746f416464726573735f6f75744f66426f756e647360581b81860152606490fd5b60405162461bcd60e51b815260208187015260148185015273746f55696e7431365f6f75744f66426f756e647360601b81860152606490fd5b604051638d0242c960e01b81528590fd5b60405163032a925360e41b81528790fd5b604051636b99980160e11b81528590fd5b60405163eae0fb0960e01b81528590fd5b6040516366fd14ef60e01b81526020818701529081906109909082860190612942565b0390fd5b925050503d908186823e6109a88282612a19565b60609081818481010312610c5e5780516001600160401b038111610c5a5761016092838284018685010312610ba3576040519384018481106001600160401b03821117610c48576040526109fd828401613605565b8452610a0d602083850101613613565b6020850152610a20604083850101613613565b604085015280828401015161ffff81168103610c44578185015260808083850101518186015260a083850101516001600160401b0381168103610c405760a0860152610a7060c084860101613605565b60c086015260e083850101516001600160401b038111610c405783850101868501601f82011215610c4057610aae9087860190602081519101613624565b60e0860152610100610ac38185870101613613565b9086015261012083850101516001600160401b038111610c405783850101868501601f82011215610c40578051906001600160401b038211610c2e5760405193610b1360208460051b0186612a19565b828552602085019189880160208560071b83010111610c2a5760208101925b60208560071b8301018410610ba75750505050505061012084015261014080918301015190830152610b666020820161365b565b9260408201516001600160401b038111610ba357820190808301601f83011215610ba357610b9b920190602081519101613624565b909138610496565b8880fd5b85848c8b010312610c265760405180878101106001600160401b038883011117610c125760208093928289809401604052875181528288015183820152610bf060408901613605565b6040820152610c00878901613605565b87820152815201940193909150610b32565b5050634e487b7160e01b8e5260418d528a8efd5b8e80fd5b8d80fd5b634e487b7160e01b8c5260418b52888cfd5b8a80fd5b8980fd5b634e487b7160e01b8a5260418952868afd5b8780fd5b8680fd5b6040513d87823e3d90fd5b8380fd5b8280fd5b5090346102e45760203660031901126102e4576020916040913581526101c683522054604051908152f35b5090346102e4576020918260031936011261021c578135600081815260cb602052604090205484929190610cde906001600160a01b03161515612cfc565b610d0a60ff7f000000000000000000000000000000000000000000000000000000000000000016613776565b93838501917f0000000000000000000000000000000000000000000000000000000000000000835285511515600014610f0f5780809285917a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000009081811015610f01575b5050866d04ee2d6d415b85acef810000000080861015610ef2575b5050662386f26fc1000080851015610ee3575b506305f5e10080851015610ed4575b5061271080851015610ec8575b50506064831015610eba575b600a80931015610eb2575b9060219160019281610ddd85809401613776565b9750870101905b610e7c575b5050505092610e299291610e09946040519586935180928686019061291f565b8201610e1d8251809386808501910161291f565b01038084520182612a19565b905b610e64602560405184610e47829651809287808601910161291f565b810164173539b7b760d91b85820152036005810185520183612a19565b610e78604051928284938452830190612942565b0390f35b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a835304918215610ead57919082610de4565b610de9565b600101610dc9565b916064600291049201610dbe565b90930492013880610db2565b60089192940493019038610da5565b60109192940493019038610d96565b90919294049301908638610d83565b049350604091503880610d68565b50505091505060405190610f22826129e3565b815290610e2b565b5090346102e45760803660031901126102e457610f456128ee565b90610f4e612909565b91604435606435936001600160401b038511610f9d57610f7761063094610f9a96369101612a55565b92610f8a610f858433612ebb565b612de6565b610f95838383612f83565b613204565b80f35b8580fd5b503461021c57602036600319011261021c57602061021283356000526101c6602052604060002054431090565b503461021c57610fdd36612967565b90610fe6612b21565b6101c3556101c45580f35b503461021c578060031936011261021c5761100a612b21565b8061012d5580f35b5090346102e45761102236612a9c565b6001600160a01b0390911691338314611092575033835260ce6020526040832082845260205261106181604085209060ff801983541691151516179055565b60405190151581527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b60649060206040519162461bcd60e51b8352820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152fd5b5090346102e45760c03660031901126102e4576001600160401b03908035828111610c6d576111089036908301612a55565b6024358381116107d05761111f9036908401612a55565b92608435906001600160a01b0382168203610f9d5760a435926001600160601b0384168403610c5e5786549560ff8760081c161595868097611539575b8015611522575b156114c757600197878960ff198316178b556114b6575b506044356101c3556064356101c4556111ab60ff8a5460081c1661119d816134b0565b6111a6816134b0565b6134b0565b82518481116114a357806111c060c954612d6e565b94601f95868111611435575b506020908683116001146113b6578c926113ab575b5050600019600383901b1c191690891b1760c9555b8151938411611398575061120b60ca54612d6e565b828111611335575b5060209183116001146112b057611266949392918891836112a5575b5050600019600383901b1c191690861b1760ca555b61125860ff875460081c1661119d816134b0565b61126133612acb565b61356f565b61126e575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff00198454168455604051908152a180f35b01519050388061122f565b60ca885293929186917f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee190601f1983168a5b81811061131d575096836112669810611304575b505050811b0160ca55611244565b015160001960f88460031b161c191690553880806112f6565b8289015184558a9590930192602092830192016112e2565b60ca89527f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee18380860160051c8201926020871061138f575b0160051c019088905b828110611384575050611213565b8a8155018890611376565b9250819261136d565b634e487b7160e01b895260419052602488fd5b0151905038806111e1565b60c98d528b93507f66be4f155c5ef2ebd3772b228f2f00681e4ed5826cdb3b1943cc11ad15ad1d289190601f1984168e5b81811061141d57508411611404575b505050811b0160c9556111f6565b015160001960f88460031b161c191690553880806113f6565b8284015185558e9690940193602093840193016113e7565b90915060c98c527f66be4f155c5ef2ebd3772b228f2f00681e4ed5826cdb3b1943cc11ad15ad1d288680850160051c8201926020861061149a575b918d91869594930160051c01915b82811061148c5750506111cc565b8e81558594508d910161147e565b92508192611470565b634e487b7160e01b8a526041825260248afd5b61ffff19166101011789553861117a565b60849060206040519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156111635750600160ff891614611163565b50600160ff89161061115c565b503461021c578060031936011261021c57604051908060ca5461156881612d6e565b8085529160019180831690811561160157506001146115a6575b610e788561159281870382612a19565b604051918291602083526020830190612942565b925060ca83527f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee15b8284106115e957505050810160200161159282610e78611582565b805460208587018101919091529093019281016115ce565b869550610e789693506020925061159294915060ff191682840152151560051b8201019293611582565b503461021c57604036600319011261021c5760ff604060209261164c6128ee565b611654612909565b6001600160a01b0391821683526101c886528383209116825284522054604051911615158152f35b503461021c578060031936011261021c5761015f546040516001600160a01b039091168152602090f35b5090346102e45760203660031901126102e4576116c1612b21565b35815261012e60205280604081205580f35b5090346102e457816003193601126102e45761019154336001600160a01b03909116036117045750610f9a33612acb565b60849060206040519162461bcd60e51b8352820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152fd5b503461021c578060031936011261021c57611773612b21565b61019180546001600160a01b031990811690915561015f8054918216905581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5090346102e45760203660031901126102e4576001600160a01b036117e66128ee565b1690811561180457602060408484815260cc83522054604051908152f35b60849060206040519162461bcd60e51b8352820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152fd5b503461021c578060031936011261021c5760406101c3546101c45482519182526020820152f35b503461021c57602036600319011261021c57602061189f8335612d48565b6040516001600160a01b039091168152f35b5090346102e45760203660031901126102e4578035906118d0826133a9565b6001600160a01b039190339083160361194f57506118ed82612d48565b7ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f18426020604051858152a18284526101c660205283604081205516337fe6e0ef9cd056ca98561ca60e347ada61e1ede2f1142a078951b7a52e1e508e608480a480f35b60849060206040519162461bcd60e51b8352820152602b60248201527f455243353035383a20756e6c6f636b2063616c6c6572206973206e6f74206c6f60448201526a31b59037b832b930ba37b960a91b6064820152fd5b5090346102e45760603660031901126102e4576119c2612909565b604435906001600160601b038216809203610c6d576119df612b21565b6119ed612710831115613510565b6001600160a01b03908116928315611a3d5760405193611a0c856129b2565b84526020840192835235845261012e60205260408420925116906001600160601b0360a01b905160a01b1617905580f35b60649060206040519162461bcd60e51b8352820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b503461021c578060031936011261021c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003611adb5760206040516000805160206137a98339815191528152f35b60849060206040519162461bcd60e51b8352820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152fd5b509060403660031901126102e457611b5b6128ee565b906024356001600160401b038111610c6d57611b7a9036908301612a55565b906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690611bb330831415612b7a565b611bd06000805160206137a9833981519152928284541614612bdb565b611bd8612b21565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c0f5750505050610f9a90612c3c565b84919395929416604051936352d1902d60e01b855260209485818881865afa859181611e0e575b50611c965760405162461bcd60e51b8152808801879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b959192939503611db857611ca983612c3c565b604051917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a2855115801590611db0575b611cea575b50505050905080f35b823b15611d61575050918084611d5694848397519201905af4611d0b612ccc565b907f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60405193611d3a856129fe565b60278552840152660819985a5b195960ca1b604084015261327f565b508038808080611ce1565b62461bcd60e51b82528101839052602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b506001611cdc565b60405162461bcd60e51b8152908101849052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d8311611e36575b611e268183612a19565b81010312610f9d57519038611c36565b503d611e1c565b503461021c57602036600319011261021c57602061189f8335613310565b503461021c57610f9a610630611e703661297d565b9060405192611e7e846129e3565b868452610f8a610f858433612ebb565b5090346102e457602080600319360112610c7157611eaa6128ee565b916001600160a01b03917f00000000000000000000000000000000000000000000000000000000000000008316611ee330821415612b7a565b611f006000805160206137a9833981519152918583541614612bdb565b611f08612b21565b60405193611f15856129e3565b8685527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611f50575050505050610f9a90612c3c565b85929496939516906040516352d1902d60e01b815285818881865afa85918161202d575b50611fd45760405162461bcd60e51b8152808801879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b959192939503611db857611fe783612c3c565b604051917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a285511580159061202657611cea5750505050905080f35b5084611cdc565b9091508681813d8311612055575b6120458183612a19565b81010312610f9d57519038611f74565b503d61203b565b503461021c5761206b36612967565b9190815261012e602052604081209060405191612087836129b2565b546001600160a01b0380821680855260a09290921c6020850152929190156120f4575b6001600160601b03602083015116938481029481860414901517156120e15760408461271085855116918351928352046020820152f35b634e487b7160e01b815260118552602490fd5b9050604051612102816129b2565b61012d54838116825260a01c6020820152906120aa565b503461021c57610f9a61212b3661297d565b91612139610f858433612ebb565b612f83565b5090346102e45760403660031901126102e4576121596128ee565b906024359161217f612179846000526101c6602052604060002054431090565b156132c4565b6001600160a01b038061219185612d48565b1691169181831461227b57813314801561225a575b156121f057508284526101c76020526040842080546001600160a01b031916831790557fbd5378dc6d0395c338ca88b324966808490d6a9983bbc7a0f7a8429a44a317628480a480f35b60849060206040519162461bcd60e51b8352820152603e60248201527f455243353035383a206c6f636b20617070726f76652063616c6c65722069732060448201527f6e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152fd5b508185526101c86020526040852033865260205260ff6040862054166121a6565b60849060206040519162461bcd60e51b8352820152602760248201527f455243353035383a206c6f636b20617070726f76616c20746f2063757272656e6044820152663a1037bbb732b960c91b6064820152fd5b5090346102e4576122df36612967565b600082815260cb6020526040902054919290916001600160a01b031615612579576001600160a01b03908161231385612d48565b16803314908115612557575b508015612544575b156124e9574383111561247f5761234f612179856000526101c6602052604060002054431090565b61235884612d48565b9083159081159182612474575b156124265750156123f7577f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16116020604051868152a15b8385526101c66020528260408620556101c760205260408520336001600160601b0360a01b82541617905560405192835216907f967ad762aa9070ada8db64577288e214771e89667066ae38e8750cb8a86c542960203392a480f35b7ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f18426020604051868152a161239b565b60849060206040519162461bcd60e51b8352820152602160248201527f4175746f2065787069726174696f6e206973206e6f7420737570706f727465646044820152601760f91b6064820152fd5b506000198514612365565b60849060206040519162461bcd60e51b8352820152603f60248201527f455243353035383a20657870697265642074696d65206d75737420626520677260448201527f6561746572207468616e2063757272656e7420626c6f636b206e756d626572006064820152fd5b60849060206040519162461bcd60e51b8352820152602e60248201527f455243353035383a206c6f636b2063616c6c6572206973206e6f74206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152fd5b50338261255086613310565b1614612327565b905085526101c86020526040852033865260205260ff6040862054163861231f565b60849060206040519162461bcd60e51b8352820152603260248201527f455243353035383a206c6f636b206f70657261746f7220717565727920666f72604482015271103737b732bc34b9ba32b73a103a37b5b2b760711b6064820152fd5b503461021c57602036600319011261021c57602061189f83356133a9565b5090346102e45760403660031901126102e4576126116128ee565b602435916001600160a01b0390818061262986612d48565b1693169280841461271e578033149081156126fd575b5015612693575082845260cd6020526040842080546001600160a01b0319168317905561266b83612d48565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b60849060206040519162461bcd60e51b8352820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152fd5b9050855260ce6020526040852033865260205260ff6040862054163861263f565b60405162461bcd60e51b8152602081840152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b503461021c57602036600319011261021c57602061189f8335612da8565b503461021c578060031936011261021c57604051908060c9546127ac81612d6e565b8085529160019180831690811561160157506001146127d557610e788561159281870382612a19565b925060c983527f66be4f155c5ef2ebd3772b228f2f00681e4ed5826cdb3b1943cc11ad15ad1d285b82841061281857505050810160200161159282610e78611582565b805460208587018101919091529093019281016127fd565b503461021c57604036600319011261021c5761284a6128ee565b6024356001600160601b0381168103610c7157610f9a91611261612b21565b90508234610c71576020366003190112610c71573563ffffffff60e01b811690818103610c6d5760209350635a2d1e0760e11b82149182156128c5575b5081156128b5575b5015158152f35b6128bf915061371c565b836128ae565b909150630b5cbb1760e41b1480156128df575b90846128a6565b506128e98161371c565b6128d8565b600435906001600160a01b038216820361290457565b600080fd5b602435906001600160a01b038216820361290457565b60005b8381106129325750506000910152565b8181015183820152602001612922565b9060209161295b8151809281855285808601910161291f565b601f01601f1916010190565b6040906003190112612904576004359060243590565b6060906003190112612904576001600160a01b0390600435828116810361290457916024359081168103612904579060443590565b604081019081106001600160401b038211176129cd57604052565b634e487b7160e01b600052604160045260246000fd5b602081019081106001600160401b038211176129cd57604052565b606081019081106001600160401b038211176129cd57604052565b90601f801991011681019081106001600160401b038211176129cd57604052565b6001600160401b0381116129cd57601f01601f191660200190565b81601f8201121561290457803590612a6c82612a3a565b92612a7a6040519485612a19565b8284526020838301011161290457816000926020809301838601378301015290565b6040906003190112612904576004356001600160a01b0381168103612904579060243580151581036129045790565b61019180546001600160a01b031990811690915561015f80549182166001600160a01b0393841690811790915591167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b61015f546001600160a01b03163303612b3657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b15612b8157565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b15612be257565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b803b15612c71576000805160206137a983398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b3d15612cf7573d90612cdd82612a3a565b91612ceb6040519384612a19565b82523d6000602084013e565b606090565b15612d0357565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b600090815260cb60205260409020546001600160a01b0316612d6b811515612cfc565b90565b90600182811c92168015612d9e575b6020831014612d8857565b634e487b7160e01b600052602260045260246000fd5b91607f1691612d7d565b600081815260cb6020526040902054612dcb906001600160a01b03161515612cfc565b600090815260cd60205260409020546001600160a01b031690565b15612ded57565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b15612ea257565b60405162461bcd60e51b81528061099060048201612e48565b906001600160a01b038080612ecf84612d48565b16931691838314938415612f02575b508315612eec575b50505090565b612ef891929350612da8565b1614388080612ee6565b90935060005260ce60205260406000208260005260205260ff604060002054169238612ede565b15612f3057565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b91612fac92612f9182612d48565b6001600160a01b039182169491938492909183168614612f29565b169081156130bf57612fcc816000526101c6602052604060002054431090565b61306e57612fe784604094612fe084612d48565b1614612f29565b60009181835260cd602052838320946001600160601b0360a01b9586815416905580845260cc60205284842060001981540190558184528484206001815401905582845260cb60205284842082878254161790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8480a46101c760205220908154169055565b60405162461bcd60e51b8152602060048201526024808201527f455243353035383a20746f6b656e207472616e73666572207768696c65206c6f60448201526318dad95960e21b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9091600091803b156131fb5761315b6020918493604051948580948193630a85bd0160e11b9a8b84523360048501528460248501526044840152608060648401526084830190612942565b03926001600160a01b03165af1908290826131b3575b50506131a55761317f612ccc565b805190816131a05760405162461bcd60e51b81528061099060048201612e48565b602001fd5b6001600160e01b0319161490565b909192506020813d82116131f3575b816131cf60209383612a19565b810103126102e45751906001600160e01b03198216820361021c5750903880613171565b3d91506131c2565b50505050600190565b91926000929190813b156132755760209161325a9185604051958680958194630a85bd0160e11b9b8c845233600485015260018060a01b0380951660248501526044840152608060648401526084830190612942565b0393165af1908290826131b35750506131a55761317f612ccc565b5050505050600190565b9091901561328b575090565b905b8051909190156132a05750805190602001fd5b60405162461bcd60e51b815260206004820152908190610990906024830190612942565b156132cb57565b60405162461bcd60e51b815260206004820152601860248201527f455243353035383a20746f6b656e206973206c6f636b656400000000000000006044820152606490fd5b600081815260cb60205260409020546001600160a01b0316156133495760009081526101c760205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152603260248201527f455243353035383a206c6f636b20617070726f76656420717565727920666f72604482015271103737b732bc34b9ba32b73a103a37b5b2b760711b6064820152608490fd5b600081815260cb60205260409020546001600160a01b031615613457576133de816000526101c6602052604060002054431090565b156133ff5760009081526101c760205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152602a60248201527f455243353035383a206c6f636b657220717565727920666f72206e6f6e2d6c6f60448201526931b5b2b2103a37b5b2b760b11b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201527f455243353035383a206c6f636b657220717565727920666f72206e6f6e65786960448201526a39ba32b73a103a37b5b2b760a91b6064820152608490fd5b156134b757565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b1561351757565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b906001600160601b03811691613589612710841115613510565b6001600160a01b03169182156135c05760206040516135a7816129b2565b848152015260a01b6001600160a01b0319161761012d55565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b519060ff8216820361290457565b519063ffffffff8216820361290457565b9092919261363181612a3a565b9161363f6040519384612a19565b82948284528282011161290457602061365993019061291f565b565b5190811515820361290457565b1561366f57565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b9192901561371657508151156136c8575090565b3b156136d15790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8261328d565b63ffffffff60e01b1663152a902d60e11b811490811561373a575090565b6380ac58cd60e01b811491508115613765575b8115613757575090565b6301ffc9a760e01b14905090565b635b5e139f60e01b8114915061374d565b9061378082612a3a565b61378d6040519182612a19565b828152809261379e601f1991612a3a565b019060203691013756fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122002bd25c44fad0fb9692c19af13ce66b33986d66450a7d91382532a11a3ce68ac64736f6c6343000813003300000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b000000000000000000000000b5b1b659da79a2507c27aad509f15b4874edc0cce298490ef8d01f56d0460c07e60e753040fe2ca53f56d39925df0f654cd995bd0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001e68747470733a2f2f6d657461646174612e6465676f64732e636f6d2f672f0000

Deployed Bytecode

0x6080806040526004908136101561001557600080fd5b600090813560e01c90816301ffc9a7146128695750806304634d8d1461283057806306fdde031461278a578063081812fc1461276c578063095ea7b3146125f6578063121cba19146125d85780631338736f146122cf578063179a9c0f1461213e5780631ddae4f914610c7557806323b872dd146121195780632a55205a1461205c5780633659cfe614611e8e57806342842e0e14611e5b5780634ce17b8614611e3d5780634f1ef28614611b4557806352d1902d14611a815780635944c753146119a75780636198e339146118b15780636352211e146118815780636a76d4ae1461185a57806370a08231146117c3578063715018a61461175a57806379ba5097146116d35780638a616bc0146116a65780638da5cb5b1461167c57806391c79cd71461162b57806395d89b411461154657806397b33552146110d6578063a22cb46514611012578063aa1b103f14610ff1578063b128a29914610fce578063b45a3c0e14610fa1578063b88d4fde14610f2a578063c87b56dd14610ca0578063dcec329414610c75578063e02c792c146103d2578063e30c3978146103a8578063e985e9c514610358578063f2fde38b146102e8578063f4bbcb291461021f5763f6aacfb1146101e657600080fd5b3461021c57602036600319011261021c57602061021283356000526101c6602052604060002054431090565b6040519015158152f35b80fd5b5090346102e45761022f36612a9c565b6001600160a01b03909116913383146102a057503383526101c86020526040832082845260205261026f81604085209060ff801983541691151516179055565b60405190151581527fbb3b2937fc41058c97e1ad0d0bbac3c664894dd823924eb7717d814fe700f03460203392a380f35b60649060206040519162461bcd60e51b8352820152601f60248201527f455243353035383a206c6f636b20617070726f766520746f2063616c6c6572006044820152fd5b5080fd5b503461021c57602036600319011261021c576103026128ee565b61030a612b21565b61019180546001600160a01b0319166001600160a01b0392831690811790915561015f549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b503461021c57604036600319011261021c5760ff60406020926103796128ee565b610381612909565b6001600160a01b03918216835260ce86528383209116825284522054604051911615158152f35b503461021c578060031936011261021c57610191546040516001600160a01b039091168152602090f35b509060203660031901126102e45780356001600160401b038111610c715736602382011215610c7157808201356001600160401b038111610c6d57602491843684848401011161021c5783926040519283809263607ec5ef60e11b8252602089830152808783015280604498899401848401378181018301859052601f01601f191681010301817f00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b6001600160a01b03165afa8015610c6257859186908792610994575b501561096d575061ffff906001826060830151160361095c5760808101517fe298490ef8d01f56d0460c07e60e753040fe2ca53f56d39925df0f654cd995bd0361094b576101408101805187526101c5908160205260ff60408920541661093a5751875260205260408620805460ff1916600117905560e001518051909190601519016109295760028251106108f0576002820151169060168151106108b6576022015160601c9060405161054a816129e3565b868152821561087457600082815260cb6020526040902054610578906001600160a01b031615155b15613668565b610590826000526101c6602052604060002054431090565b61082557600082815260cb602052604090205461063591610630916105bf906001600160a01b03161515610572565b84895260cc602052604089206001815401905583895260cb602052604089206001600160601b0360a01b90868282541617905584868b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46101c760205260408a209081541690558385613110565b612e9b565b81604051917fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e8880a333821461080b57506101c45434036107fa57848034156107f1575b81808092853491f1156107e6576101c3546040519060208201926323b872dd60e01b845233858401528583015260648201526064815260a08101918183106001600160401b038411176107d457604083905261074792917f000000000000000000000000b5b1b659da79a2507c27aad509f15b4874edc0cc6001600160a01b0316918891829190610709866129b2565b602086527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460c0820152519082855af1610741612ccc565b916136b4565b805180610757575b505050505080f35b81602091810103126107d057602061076f910161365b565b1561077b57808061074f565b60849291602a7f5361666545524332303a204552433230206f7065726174696f6e20646964206e9260206040519562461bcd60e51b8752860152840152820152691bdd081cdd58d8d9595960b21b6064820152fd5b8480fd5b634e487b7160e01b8752604186528387fd5b6040513d86823e3d90fd5b506108fc610679565b604051631841b4e160e01b81528490fd5b925050503461081957505080f35b631841b4e160e01b8152fd5b60405162461bcd60e51b81526020818801528085018590527f455243353035383a20746f6b656e207472616e73666572207768696c65206c6f818701526318dad95960e21b6064820152608490fd5b60405162461bcd60e51b81526020818801819052818601527f4552433732313a206d696e7420746f20746865207a65726f206164647265737381870152606490fd5b60405162461bcd60e51b815260208187015260158185015274746f416464726573735f6f75744f66426f756e647360581b81860152606490fd5b60405162461bcd60e51b815260208187015260148185015273746f55696e7431365f6f75744f66426f756e647360601b81860152606490fd5b604051638d0242c960e01b81528590fd5b60405163032a925360e41b81528790fd5b604051636b99980160e11b81528590fd5b60405163eae0fb0960e01b81528590fd5b6040516366fd14ef60e01b81526020818701529081906109909082860190612942565b0390fd5b925050503d908186823e6109a88282612a19565b60609081818481010312610c5e5780516001600160401b038111610c5a5761016092838284018685010312610ba3576040519384018481106001600160401b03821117610c48576040526109fd828401613605565b8452610a0d602083850101613613565b6020850152610a20604083850101613613565b604085015280828401015161ffff81168103610c44578185015260808083850101518186015260a083850101516001600160401b0381168103610c405760a0860152610a7060c084860101613605565b60c086015260e083850101516001600160401b038111610c405783850101868501601f82011215610c4057610aae9087860190602081519101613624565b60e0860152610100610ac38185870101613613565b9086015261012083850101516001600160401b038111610c405783850101868501601f82011215610c40578051906001600160401b038211610c2e5760405193610b1360208460051b0186612a19565b828552602085019189880160208560071b83010111610c2a5760208101925b60208560071b8301018410610ba75750505050505061012084015261014080918301015190830152610b666020820161365b565b9260408201516001600160401b038111610ba357820190808301601f83011215610ba357610b9b920190602081519101613624565b909138610496565b8880fd5b85848c8b010312610c265760405180878101106001600160401b038883011117610c125760208093928289809401604052875181528288015183820152610bf060408901613605565b6040820152610c00878901613605565b87820152815201940193909150610b32565b5050634e487b7160e01b8e5260418d528a8efd5b8e80fd5b8d80fd5b634e487b7160e01b8c5260418b52888cfd5b8a80fd5b8980fd5b634e487b7160e01b8a5260418952868afd5b8780fd5b8680fd5b6040513d87823e3d90fd5b8380fd5b8280fd5b5090346102e45760203660031901126102e4576020916040913581526101c683522054604051908152f35b5090346102e4576020918260031936011261021c578135600081815260cb602052604090205484929190610cde906001600160a01b03161515612cfc565b610d0a60ff7f000000000000000000000000000000000000000000000000000000000000001e16613776565b93838501917f68747470733a2f2f6d657461646174612e6465676f64732e636f6d2f672f0000835285511515600014610f0f5780809285917a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000009081811015610f01575b5050866d04ee2d6d415b85acef810000000080861015610ef2575b5050662386f26fc1000080851015610ee3575b506305f5e10080851015610ed4575b5061271080851015610ec8575b50506064831015610eba575b600a80931015610eb2575b9060219160019281610ddd85809401613776565b9750870101905b610e7c575b5050505092610e299291610e09946040519586935180928686019061291f565b8201610e1d8251809386808501910161291f565b01038084520182612a19565b905b610e64602560405184610e47829651809287808601910161291f565b810164173539b7b760d91b85820152036005810185520183612a19565b610e78604051928284938452830190612942565b0390f35b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a835304918215610ead57919082610de4565b610de9565b600101610dc9565b916064600291049201610dbe565b90930492013880610db2565b60089192940493019038610da5565b60109192940493019038610d96565b90919294049301908638610d83565b049350604091503880610d68565b50505091505060405190610f22826129e3565b815290610e2b565b5090346102e45760803660031901126102e457610f456128ee565b90610f4e612909565b91604435606435936001600160401b038511610f9d57610f7761063094610f9a96369101612a55565b92610f8a610f858433612ebb565b612de6565b610f95838383612f83565b613204565b80f35b8580fd5b503461021c57602036600319011261021c57602061021283356000526101c6602052604060002054431090565b503461021c57610fdd36612967565b90610fe6612b21565b6101c3556101c45580f35b503461021c578060031936011261021c5761100a612b21565b8061012d5580f35b5090346102e45761102236612a9c565b6001600160a01b0390911691338314611092575033835260ce6020526040832082845260205261106181604085209060ff801983541691151516179055565b60405190151581527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b60649060206040519162461bcd60e51b8352820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152fd5b5090346102e45760c03660031901126102e4576001600160401b03908035828111610c6d576111089036908301612a55565b6024358381116107d05761111f9036908401612a55565b92608435906001600160a01b0382168203610f9d5760a435926001600160601b0384168403610c5e5786549560ff8760081c161595868097611539575b8015611522575b156114c757600197878960ff198316178b556114b6575b506044356101c3556064356101c4556111ab60ff8a5460081c1661119d816134b0565b6111a6816134b0565b6134b0565b82518481116114a357806111c060c954612d6e565b94601f95868111611435575b506020908683116001146113b6578c926113ab575b5050600019600383901b1c191690891b1760c9555b8151938411611398575061120b60ca54612d6e565b828111611335575b5060209183116001146112b057611266949392918891836112a5575b5050600019600383901b1c191690861b1760ca555b61125860ff875460081c1661119d816134b0565b61126133612acb565b61356f565b61126e575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff00198454168455604051908152a180f35b01519050388061122f565b60ca885293929186917f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee190601f1983168a5b81811061131d575096836112669810611304575b505050811b0160ca55611244565b015160001960f88460031b161c191690553880806112f6565b8289015184558a9590930192602092830192016112e2565b60ca89527f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee18380860160051c8201926020871061138f575b0160051c019088905b828110611384575050611213565b8a8155018890611376565b9250819261136d565b634e487b7160e01b895260419052602488fd5b0151905038806111e1565b60c98d528b93507f66be4f155c5ef2ebd3772b228f2f00681e4ed5826cdb3b1943cc11ad15ad1d289190601f1984168e5b81811061141d57508411611404575b505050811b0160c9556111f6565b015160001960f88460031b161c191690553880806113f6565b8284015185558e9690940193602093840193016113e7565b90915060c98c527f66be4f155c5ef2ebd3772b228f2f00681e4ed5826cdb3b1943cc11ad15ad1d288680850160051c8201926020861061149a575b918d91869594930160051c01915b82811061148c5750506111cc565b8e81558594508d910161147e565b92508192611470565b634e487b7160e01b8a526041825260248afd5b61ffff19166101011789553861117a565b60849060206040519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156111635750600160ff891614611163565b50600160ff89161061115c565b503461021c578060031936011261021c57604051908060ca5461156881612d6e565b8085529160019180831690811561160157506001146115a6575b610e788561159281870382612a19565b604051918291602083526020830190612942565b925060ca83527f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee15b8284106115e957505050810160200161159282610e78611582565b805460208587018101919091529093019281016115ce565b869550610e789693506020925061159294915060ff191682840152151560051b8201019293611582565b503461021c57604036600319011261021c5760ff604060209261164c6128ee565b611654612909565b6001600160a01b0391821683526101c886528383209116825284522054604051911615158152f35b503461021c578060031936011261021c5761015f546040516001600160a01b039091168152602090f35b5090346102e45760203660031901126102e4576116c1612b21565b35815261012e60205280604081205580f35b5090346102e457816003193601126102e45761019154336001600160a01b03909116036117045750610f9a33612acb565b60849060206040519162461bcd60e51b8352820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152fd5b503461021c578060031936011261021c57611773612b21565b61019180546001600160a01b031990811690915561015f8054918216905581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5090346102e45760203660031901126102e4576001600160a01b036117e66128ee565b1690811561180457602060408484815260cc83522054604051908152f35b60849060206040519162461bcd60e51b8352820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152fd5b503461021c578060031936011261021c5760406101c3546101c45482519182526020820152f35b503461021c57602036600319011261021c57602061189f8335612d48565b6040516001600160a01b039091168152f35b5090346102e45760203660031901126102e4578035906118d0826133a9565b6001600160a01b039190339083160361194f57506118ed82612d48565b7ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f18426020604051858152a18284526101c660205283604081205516337fe6e0ef9cd056ca98561ca60e347ada61e1ede2f1142a078951b7a52e1e508e608480a480f35b60849060206040519162461bcd60e51b8352820152602b60248201527f455243353035383a20756e6c6f636b2063616c6c6572206973206e6f74206c6f60448201526a31b59037b832b930ba37b960a91b6064820152fd5b5090346102e45760603660031901126102e4576119c2612909565b604435906001600160601b038216809203610c6d576119df612b21565b6119ed612710831115613510565b6001600160a01b03908116928315611a3d5760405193611a0c856129b2565b84526020840192835235845261012e60205260408420925116906001600160601b0360a01b905160a01b1617905580f35b60649060206040519162461bcd60e51b8352820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b503461021c578060031936011261021c57507f000000000000000000000000870851be6e03db864c804898a3cdce89579c65b86001600160a01b03163003611adb5760206040516000805160206137a98339815191528152f35b60849060206040519162461bcd60e51b8352820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152fd5b509060403660031901126102e457611b5b6128ee565b906024356001600160401b038111610c6d57611b7a9036908301612a55565b906001600160a01b037f000000000000000000000000870851be6e03db864c804898a3cdce89579c65b8811690611bb330831415612b7a565b611bd06000805160206137a9833981519152928284541614612bdb565b611bd8612b21565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c0f5750505050610f9a90612c3c565b84919395929416604051936352d1902d60e01b855260209485818881865afa859181611e0e575b50611c965760405162461bcd60e51b8152808801879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b959192939503611db857611ca983612c3c565b604051917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a2855115801590611db0575b611cea575b50505050905080f35b823b15611d61575050918084611d5694848397519201905af4611d0b612ccc565b907f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60405193611d3a856129fe565b60278552840152660819985a5b195960ca1b604084015261327f565b508038808080611ce1565b62461bcd60e51b82528101839052602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b506001611cdc565b60405162461bcd60e51b8152908101849052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d8311611e36575b611e268183612a19565b81010312610f9d57519038611c36565b503d611e1c565b503461021c57602036600319011261021c57602061189f8335613310565b503461021c57610f9a610630611e703661297d565b9060405192611e7e846129e3565b868452610f8a610f858433612ebb565b5090346102e457602080600319360112610c7157611eaa6128ee565b916001600160a01b03917f000000000000000000000000870851be6e03db864c804898a3cdce89579c65b88316611ee330821415612b7a565b611f006000805160206137a9833981519152918583541614612bdb565b611f08612b21565b60405193611f15856129e3565b8685527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611f50575050505050610f9a90612c3c565b85929496939516906040516352d1902d60e01b815285818881865afa85918161202d575b50611fd45760405162461bcd60e51b8152808801879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b959192939503611db857611fe783612c3c565b604051917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a285511580159061202657611cea5750505050905080f35b5084611cdc565b9091508681813d8311612055575b6120458183612a19565b81010312610f9d57519038611f74565b503d61203b565b503461021c5761206b36612967565b9190815261012e602052604081209060405191612087836129b2565b546001600160a01b0380821680855260a09290921c6020850152929190156120f4575b6001600160601b03602083015116938481029481860414901517156120e15760408461271085855116918351928352046020820152f35b634e487b7160e01b815260118552602490fd5b9050604051612102816129b2565b61012d54838116825260a01c6020820152906120aa565b503461021c57610f9a61212b3661297d565b91612139610f858433612ebb565b612f83565b5090346102e45760403660031901126102e4576121596128ee565b906024359161217f612179846000526101c6602052604060002054431090565b156132c4565b6001600160a01b038061219185612d48565b1691169181831461227b57813314801561225a575b156121f057508284526101c76020526040842080546001600160a01b031916831790557fbd5378dc6d0395c338ca88b324966808490d6a9983bbc7a0f7a8429a44a317628480a480f35b60849060206040519162461bcd60e51b8352820152603e60248201527f455243353035383a206c6f636b20617070726f76652063616c6c65722069732060448201527f6e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152fd5b508185526101c86020526040852033865260205260ff6040862054166121a6565b60849060206040519162461bcd60e51b8352820152602760248201527f455243353035383a206c6f636b20617070726f76616c20746f2063757272656e6044820152663a1037bbb732b960c91b6064820152fd5b5090346102e4576122df36612967565b600082815260cb6020526040902054919290916001600160a01b031615612579576001600160a01b03908161231385612d48565b16803314908115612557575b508015612544575b156124e9574383111561247f5761234f612179856000526101c6602052604060002054431090565b61235884612d48565b9083159081159182612474575b156124265750156123f7577f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16116020604051868152a15b8385526101c66020528260408620556101c760205260408520336001600160601b0360a01b82541617905560405192835216907f967ad762aa9070ada8db64577288e214771e89667066ae38e8750cb8a86c542960203392a480f35b7ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f18426020604051868152a161239b565b60849060206040519162461bcd60e51b8352820152602160248201527f4175746f2065787069726174696f6e206973206e6f7420737570706f727465646044820152601760f91b6064820152fd5b506000198514612365565b60849060206040519162461bcd60e51b8352820152603f60248201527f455243353035383a20657870697265642074696d65206d75737420626520677260448201527f6561746572207468616e2063757272656e7420626c6f636b206e756d626572006064820152fd5b60849060206040519162461bcd60e51b8352820152602e60248201527f455243353035383a206c6f636b2063616c6c6572206973206e6f74206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152fd5b50338261255086613310565b1614612327565b905085526101c86020526040852033865260205260ff6040862054163861231f565b60849060206040519162461bcd60e51b8352820152603260248201527f455243353035383a206c6f636b206f70657261746f7220717565727920666f72604482015271103737b732bc34b9ba32b73a103a37b5b2b760711b6064820152fd5b503461021c57602036600319011261021c57602061189f83356133a9565b5090346102e45760403660031901126102e4576126116128ee565b602435916001600160a01b0390818061262986612d48565b1693169280841461271e578033149081156126fd575b5015612693575082845260cd6020526040842080546001600160a01b0319168317905561266b83612d48565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b60849060206040519162461bcd60e51b8352820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152fd5b9050855260ce6020526040852033865260205260ff6040862054163861263f565b60405162461bcd60e51b8152602081840152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b503461021c57602036600319011261021c57602061189f8335612da8565b503461021c578060031936011261021c57604051908060c9546127ac81612d6e565b8085529160019180831690811561160157506001146127d557610e788561159281870382612a19565b925060c983527f66be4f155c5ef2ebd3772b228f2f00681e4ed5826cdb3b1943cc11ad15ad1d285b82841061281857505050810160200161159282610e78611582565b805460208587018101919091529093019281016127fd565b503461021c57604036600319011261021c5761284a6128ee565b6024356001600160601b0381168103610c7157610f9a91611261612b21565b90508234610c71576020366003190112610c71573563ffffffff60e01b811690818103610c6d5760209350635a2d1e0760e11b82149182156128c5575b5081156128b5575b5015158152f35b6128bf915061371c565b836128ae565b909150630b5cbb1760e41b1480156128df575b90846128a6565b506128e98161371c565b6128d8565b600435906001600160a01b038216820361290457565b600080fd5b602435906001600160a01b038216820361290457565b60005b8381106129325750506000910152565b8181015183820152602001612922565b9060209161295b8151809281855285808601910161291f565b601f01601f1916010190565b6040906003190112612904576004359060243590565b6060906003190112612904576001600160a01b0390600435828116810361290457916024359081168103612904579060443590565b604081019081106001600160401b038211176129cd57604052565b634e487b7160e01b600052604160045260246000fd5b602081019081106001600160401b038211176129cd57604052565b606081019081106001600160401b038211176129cd57604052565b90601f801991011681019081106001600160401b038211176129cd57604052565b6001600160401b0381116129cd57601f01601f191660200190565b81601f8201121561290457803590612a6c82612a3a565b92612a7a6040519485612a19565b8284526020838301011161290457816000926020809301838601378301015290565b6040906003190112612904576004356001600160a01b0381168103612904579060243580151581036129045790565b61019180546001600160a01b031990811690915561015f80549182166001600160a01b0393841690811790915591167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b61015f546001600160a01b03163303612b3657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b15612b8157565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b15612be257565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b803b15612c71576000805160206137a983398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b3d15612cf7573d90612cdd82612a3a565b91612ceb6040519384612a19565b82523d6000602084013e565b606090565b15612d0357565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b600090815260cb60205260409020546001600160a01b0316612d6b811515612cfc565b90565b90600182811c92168015612d9e575b6020831014612d8857565b634e487b7160e01b600052602260045260246000fd5b91607f1691612d7d565b600081815260cb6020526040902054612dcb906001600160a01b03161515612cfc565b600090815260cd60205260409020546001600160a01b031690565b15612ded57565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b15612ea257565b60405162461bcd60e51b81528061099060048201612e48565b906001600160a01b038080612ecf84612d48565b16931691838314938415612f02575b508315612eec575b50505090565b612ef891929350612da8565b1614388080612ee6565b90935060005260ce60205260406000208260005260205260ff604060002054169238612ede565b15612f3057565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b91612fac92612f9182612d48565b6001600160a01b039182169491938492909183168614612f29565b169081156130bf57612fcc816000526101c6602052604060002054431090565b61306e57612fe784604094612fe084612d48565b1614612f29565b60009181835260cd602052838320946001600160601b0360a01b9586815416905580845260cc60205284842060001981540190558184528484206001815401905582845260cb60205284842082878254161790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8480a46101c760205220908154169055565b60405162461bcd60e51b8152602060048201526024808201527f455243353035383a20746f6b656e207472616e73666572207768696c65206c6f60448201526318dad95960e21b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9091600091803b156131fb5761315b6020918493604051948580948193630a85bd0160e11b9a8b84523360048501528460248501526044840152608060648401526084830190612942565b03926001600160a01b03165af1908290826131b3575b50506131a55761317f612ccc565b805190816131a05760405162461bcd60e51b81528061099060048201612e48565b602001fd5b6001600160e01b0319161490565b909192506020813d82116131f3575b816131cf60209383612a19565b810103126102e45751906001600160e01b03198216820361021c5750903880613171565b3d91506131c2565b50505050600190565b91926000929190813b156132755760209161325a9185604051958680958194630a85bd0160e11b9b8c845233600485015260018060a01b0380951660248501526044840152608060648401526084830190612942565b0393165af1908290826131b35750506131a55761317f612ccc565b5050505050600190565b9091901561328b575090565b905b8051909190156132a05750805190602001fd5b60405162461bcd60e51b815260206004820152908190610990906024830190612942565b156132cb57565b60405162461bcd60e51b815260206004820152601860248201527f455243353035383a20746f6b656e206973206c6f636b656400000000000000006044820152606490fd5b600081815260cb60205260409020546001600160a01b0316156133495760009081526101c760205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152603260248201527f455243353035383a206c6f636b20617070726f76656420717565727920666f72604482015271103737b732bc34b9ba32b73a103a37b5b2b760711b6064820152608490fd5b600081815260cb60205260409020546001600160a01b031615613457576133de816000526101c6602052604060002054431090565b156133ff5760009081526101c760205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152602a60248201527f455243353035383a206c6f636b657220717565727920666f72206e6f6e2d6c6f60448201526931b5b2b2103a37b5b2b760b11b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201527f455243353035383a206c6f636b657220717565727920666f72206e6f6e65786960448201526a39ba32b73a103a37b5b2b760a91b6064820152608490fd5b156134b757565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b1561351757565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b906001600160601b03811691613589612710841115613510565b6001600160a01b03169182156135c05760206040516135a7816129b2565b848152015260a01b6001600160a01b0319161761012d55565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b519060ff8216820361290457565b519063ffffffff8216820361290457565b9092919261363181612a3a565b9161363f6040519384612a19565b82948284528282011161290457602061365993019061291f565b565b5190811515820361290457565b1561366f57565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b9192901561371657508151156136c8575090565b3b156136d15790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8261328d565b63ffffffff60e01b1663152a902d60e11b811490811561373a575090565b6380ac58cd60e01b811491508115613765575b8115613757575090565b6301ffc9a760e01b14905090565b635b5e139f60e01b8114915061374d565b9061378082612a3a565b61378d6040519182612a19565b828152809261379e601f1991612a3a565b019060203691013756fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122002bd25c44fad0fb9692c19af13ce66b33986d66450a7d91382532a11a3ce68ac64736f6c63430008130033

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

00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b000000000000000000000000b5b1b659da79a2507c27aad509f15b4874edc0cce298490ef8d01f56d0460c07e60e753040fe2ca53f56d39925df0f654cd995bd0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001e68747470733a2f2f6d657461646174612e6465676f64732e636f6d2f672f0000

-----Decoded View---------------
Arg [0] : wormhole (address): 0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B
Arg [1] : dustToken (address): 0xB5b1b659dA79A2507C27AaD509f15B4874EDc0Cc
Arg [2] : emitterAddress (bytes32): 0xe298490ef8d01f56d0460c07e60e753040fe2ca53f56d39925df0f654cd995bd
Arg [3] : baseUri (bytes): 0x68747470733a2f2f6d657461646174612e6465676f64732e636f6d2f672f

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b
Arg [1] : 000000000000000000000000b5b1b659da79a2507c27aad509f15b4874edc0cc
Arg [2] : e298490ef8d01f56d0460c07e60e753040fe2ca53f56d39925df0f654cd995bd
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [5] : 68747470733a2f2f6d657461646174612e6465676f64732e636f6d2f672f0000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.