ETH Price: $3,274.27 (-10.98%)

Contract

0x0A178F86e06929ea4960b9cb2b6427Bb82CE1981
 

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:
y00ts

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
File 1 of 29 : y00tsV3.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 {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 {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {IWormhole} from "wormhole-solidity/IWormhole.sol";
import {BytesLib} from "wormhole-solidity/BytesLib.sol";
import {UpdatableOperatorFilterer} from "operator-filter-registry/UpdatableOperatorFilterer.sol";

//                                                      @@@@@@              @@
//   @@@@@@    @@@@@   @@@@@@@@@@@      @@@@@@@@@@@     @@@@@@
//   @@@@@@   @@@@@@ @@@@@@@@@@@@@@   @@@@@@@@@@@@@@  @@@@@@@@@@@  @@@@@@@@@@
//    @@@@@@  @@@@@/@@@@@@    @@@@@@ @@@@@@    @@@@@@ @@@@@@@@@@@ @@@@@@(@@@
//     @@@@@%@@@@@@ @@@@@      @@@@@ @@@@@      @@@@@   @@@@@@    @@@@@@@@
//     @@@@@@@@@@@@ @@@@@@     @@@@@ @@@@@@     @@@@@   @@@@@@     @@@@@@@@@@
//      @@@@@@@@@@   @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@   @@@@@@         @@@@@@@
//      &@@@@@@@@     @@@@@@@@@@@@&    @@@@@@@@@@@@&     @@@@@@@@ @@@@@@@@@@@
//  @@@@@@@@@@@.        &@@@@@@@         &@@@@@@@          @@@@@@ @@@@@@@@@
//  @@@@@@@@

/**
 * @title  y00ts ERC-721 Smart Contract
 */
contract y00ts is
	UUPSUpgradeable,
	ERC2981Upgradeable,
	Ownable2StepUpgradeable,
	ERC721Upgradeable,
	UpdatableOperatorFilterer
{
	using BytesLib for bytes;
	using SafeERC20 for IERC20;

	// Wormhole chain id that valid vaas must have -- must be Polygon.
	// NOTE: safe to remove as it is a constant, so it does not take up storage space
	// uint16 constant SOURCE_CHAIN_ID = 5;

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

	// Core layer Wormhole contract. Exposed so higher-level contract can
	// interact with the wormhole interface.
	IWormhole immutable _wormhole;
	// 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;

	// Dictionary of VAA hash => flag that keeps track of claimed VAAs
	mapping(bytes32 => bool) private _claimedVaas;

	uint16 private constant CHAIN_ID_POLYGON = 5;
	uint16 private constant CHAIN_ID_SOLANA = 1;

	// NOTE: batch size will depend on Solana ability to handle the batch in one transaction
	uint16 constant MAX_BATCH_SIZE = 10;
	uint16 constant MIN_BATCH_SIZE = 2;
	uint8 private constant FINALITY = 201; //Finalized

	bool private _multiChainInitialized = false;
	bytes32 private _emitterAddressSolana;

	// Storage gap so that future upgrades to the contract can add new storage variables.
	uint256[50] __gap;

	error WrongEmitterChainId();
	error WrongEmitterAddress();
	error FailedVaaParseAndVerification(string reason);
	error VaaAlreadyClaimed();
	error InvalidMessageLength();
	error BaseUriEmpty();
	error BaseUriTooLong();
	error InvalidMsgValue();
	error FailedToSend();
	error MultiChainAlreadyInitialized();
	error BurnNotApproved();
	error InvalidBatchCount();
	error NotAscendingOrDuplicated();

	event Minted(uint256 indexed tokenId, address indexed receiver);
	event BatchMinted(uint256[] tokenIds, address indexed receiver);

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

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

		//brick logic contract
		initialize("", "", 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,
		address royaltyReceiver,
		uint96 royaltyFeeNumerator
	) public initializer {
		__UUPSUpgradeable_init();
		__ERC721_init(name, symbol);
		__ERC2981_init();
		__Ownable_init();

		_setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator);
	}

	// Initialize the contract to be able to receive VAAs from Solana
	function upgrateToMultiChain(bytes32 emitterAddressSolana) public onlyOwner {
		if (_multiChainInitialized) revert MultiChainAlreadyInitialized();
		_emitterAddressSolana = emitterAddressSolana;

		// Prevent this from being called again
		_multiChainInitialized = true;
	}

	// ---- BRIDGE - MINT LOGIC ----
	/**
	 * @notice Mints an NFT based on a valid VAA
	 * @param vaa Wormhole message that must have been published by the Polygon Y00tsV2 instance
	 * of the NFT collection with the specified emitter on Polygon (chainId = 5). The VAA contains
	 * a single token ID and a recipient address.
	 */
	function receiveAndMint(bytes calldata vaa) external {
		IWormhole.VM memory vm = _verifyMintMessage(vaa);

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

	/**
	 * @notice Mints a batch of NFTs based on a valid VAA
	 * @param vaa Wormhole message that must have been published by the Polygon Y00tsV2 instance
	 * of the NFT collection with the specified emitter on Polygon (chainId = 5). The VAA contains
	 * a list of token IDs and a recipient address.
	 */
	function receiveAndMintBatch(bytes calldata vaa) external {
		IWormhole.VM memory vm = _verifyMintMessage(vaa);

		(uint256[] memory tokenIds, address evmRecipient) = parseBatchPayload(vm.payload);

		uint256 tokenCount = tokenIds.length;
		for (uint256 i = 0; i < tokenCount; ) {
			_safeMint(evmRecipient, tokenIds[i]);

			unchecked {
				i += 1;
			}
		}
		emit BatchMinted(tokenIds, evmRecipient);
	}

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

	function parseBatchPayload(
		bytes memory message
	) internal pure returns (uint256[] memory, address) {
		uint256 messageLength = message.length;
		uint256 endTokenIndex = messageLength - BytesLib.addressSize;
		uint256 batchSize = endTokenIndex / BytesLib.uint16Size;

		if (
			messageLength <= BytesLib.uint16Size + BytesLib.addressSize ||
			endTokenIndex % BytesLib.uint16Size != 0
		) {
			revert InvalidMessageLength();
		}

		//parse the recipient
		address evmRecipient = message.toAddress(endTokenIndex);

		//parse the tokenIds
		uint256[] memory tokenIds = new uint256[](batchSize);
		for (uint256 i = 0; i < batchSize; ) {
			unchecked {
				tokenIds[i] = message.toUint16(i * BytesLib.uint16Size);
				i += 1;
			}
		}

		return (tokenIds, evmRecipient);
	}

	function _verifyMintMessage(bytes calldata vaa) internal returns (IWormhole.VM memory) {
		(IWormhole.VM memory vm, bool valid, string memory reason) = _wormhole.parseAndVerifyVM(
			vaa
		);
		if (!valid) revert FailedVaaParseAndVerification(reason);

		if (vm.emitterChainId != CHAIN_ID_POLYGON && vm.emitterChainId != CHAIN_ID_SOLANA)
			revert WrongEmitterChainId();

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

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

		_claimedVaas[vm.hash] = true;

		return vm;
	}

	// ---- BRIDGE - BURN LOGIC ----
	/**
	 * @notice Burns an existing y00t NFT and sends a VAA to Solana to mint
	 * a new y00t NFT with the same token ID.
	 * @param tokenId ID of the token to be burned by Ethereum and minted on Solana.
	 * @param recipient Address of the recipient of the new token on Solana.
	 */
	function burnAndSend(uint256 tokenId, bytes32 recipient) external payable {
		uint256[] memory tokenIds = new uint256[](1);
		tokenIds[0] = tokenId;

		_burnAndSend(tokenIds, 1, recipient);
	}

	/**
	 * @notice Burns a list of existing y00t NFTs and sends a VAA to Solana to mint
	 * new y00t NFTs with the same token IDs.
	 * @param tokenIds Array of token IDs to be burned on Ethereum and minted on Solana.
	 * @param recipient Address of the recipient of the new token on Solana.
	 */
	function burnAndSend(uint256[] calldata tokenIds, bytes32 recipient) external payable {
		uint256 tokenCount = tokenIds.length;
		if (tokenCount < MIN_BATCH_SIZE || tokenCount > MAX_BATCH_SIZE) {
			revert InvalidBatchCount();
		}

		_burnAndSend(tokenIds, tokenCount, recipient);
	}

	function _burnAndSend(
		uint256[] memory tokenIds,
		uint256 tokenCount,
		bytes32 recipient
	) internal {
		uint256 lastTokenId;
		bytes memory payload;
		for (uint256 i = 0; i < tokenCount; ) {
			uint256 tokenId = tokenIds[i];

			//tokenIds must be ascending and unique
			if (i != 0 && tokenId <= lastTokenId) {
				revert NotAscendingOrDuplicated();
			}

			if (!_isApprovedOrOwner(_msgSender(), tokenId)) {
				revert BurnNotApproved();
			}

			_burn(tokenId);

			//add tokenId to the message payload
			payload = abi.encodePacked(payload, uint16(tokenId));

			unchecked {
				lastTokenId = tokenId;
				i += 1;
			}
		}

		//append the recipient to the payload and send the message
		_wormhole.publishMessage{value: msg.value}(
			0, //nonce
			abi.encodePacked(payload, recipient),
			FINALITY
		);
	}

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

	// ---- ERC165 ----

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

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

	// ---- OperatorFilterer ----
	function initializeOperatorFilterer(
		address registry,
		address subscriptionOrRegistrantToCopy,
		bool subscribe
	) public onlyOwner {
		_initializeOperatorFilterer(registry, subscriptionOrRegistrantToCopy, subscribe);
	}

	function owner()
		public
		view
		override(OwnableUpgradeable, UpdatableOperatorFilterer)
		returns (address)
	{
		return OwnableUpgradeable.owner();
	}

	function transferFrom(
		address from,
		address to,
		uint256 tokenId
	) public override(ERC721Upgradeable) onlyAllowedOperator(from) {
		super.transferFrom(from, to, tokenId);
	}

	function safeTransferFrom(
		address from,
		address to,
		uint256 tokenId
	) public override(ERC721Upgradeable) onlyAllowedOperator(from) {
		super.safeTransferFrom(from, to, tokenId);
	}

	function safeTransferFrom(
		address from,
		address to,
		uint256 tokenId,
		bytes memory data
	) public override(ERC721Upgradeable) onlyAllowedOperator(from) {
		super.safeTransferFrom(from, to, tokenId, data);
	}
}

File 2 of 29 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

File 3 of 29 : UpdatableOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  UpdatableOperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the
 *         OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address,
 *         which will bypass registry checks.
 *         Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract UpdatableOperatorFilterer is Initializable {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);
    /// @dev Emitted when someone other than the owner is trying to call an only owner function.
    error OnlyOwner();

    event OperatorFilterRegistryAddressUpdated(address newRegistry);

    IOperatorFilterRegistry public operatorFilterRegistry;

    function _initializeOperatorFilterer(
				address _registry, address subscriptionOrRegistrantToCopy, bool subscribe
		) internal {
				IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry);
				operatorFilterRegistry = registry;
				// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
				// will not revert, but the contract will need to be registered with the registry once it is deployed in
				// order for the modifier to filter addresses.
				if (address(registry).code.length > 0) {
						if (subscribe) {
								registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
						} else {
								if (subscriptionOrRegistrantToCopy != address(0)) {
										registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
								} else {
										registry.register(address(this));
								}
						}
				}
		}

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    /**
     * @dev A helper function to check if the operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero
     *         address, checks will be bypassed. OnlyOwner.
     */
    function updateOperatorFilterRegistryAddress(address newRegistry) public virtual {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
        emit OperatorFilterRegistryAddressUpdated(newRegistry);
    }

    /**
     * @dev Assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract.
     */
    function owner() public view virtual returns (address);

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        IOperatorFilterRegistry registry = operatorFilterRegistry;
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(registry) != address(0) && address(registry).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!registry.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

File 4 of 29 : 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 5 of 29 : 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 6 of 29 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 7 of 29 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/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.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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 8 of 29 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 9 of 29 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 10 of 29 : 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 11 of 29 : 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 12 of 29 : 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 13 of 29 : 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 14 of 29 : 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 15 of 29 : 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 16 of 29 : 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 17 of 29 : 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 18 of 29 : 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 19 of 29 : 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 20 of 29 : 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 21 of 29 : 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 22 of 29 : 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 23 of 29 : 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 24 of 29 : 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 25 of 29 : 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 26 of 29 : 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 27 of 29 : 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 28 of 29 : 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 29 of 29 : 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);
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=node_modules/@openzeppelin/",
    "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/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "operator-filter-registry/=modules/operator-filter-registry/",
    "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":"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":[],"name":"BurnNotApproved","type":"error"},{"inputs":[],"name":"FailedToSend","type":"error"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"FailedVaaParseAndVerification","type":"error"},{"inputs":[],"name":"InvalidBatchCount","type":"error"},{"inputs":[],"name":"InvalidMessageLength","type":"error"},{"inputs":[],"name":"InvalidMsgValue","type":"error"},{"inputs":[],"name":"MultiChainAlreadyInitialized","type":"error"},{"inputs":[],"name":"NotAscendingOrDuplicated","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","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":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"}],"name":"BatchMinted","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":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRegistry","type":"address"}],"name":"OperatorFilterRegistryAddressUpdated","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":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":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes32","name":"recipient","type":"bytes32"}],"name":"burnAndSend","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes32","name":"recipient","type":"bytes32"}],"name":"burnAndSend","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"deleteDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"address","name":"subscriptionOrRegistrantToCopy","type":"address"},{"internalType":"bool","name":"subscribe","type":"bool"}],"name":"initializeOperatorFilterer","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":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"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":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"vaa","type":"bytes"}],"name":"receiveAndMintBatch","outputs":[],"stateMutability":"nonpayable","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":"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":"address","name":"newRegistry","type":"address"}],"name":"updateOperatorFilterRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"emitterAddressSolana","type":"bytes32"}],"name":"upgrateToMultiChain","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6040610120815234620006005762003bc19081380380620000208162000625565b938439820191606081840312620006005780516001600160a01b03908181168103620006005760209485840151918585015160018060401b039586821162000600570196601f9383858a011215620006005788518781116200035157601f1999620000918288018c16850162000625565b958287528483830101116200060057839060005b838110620005eb575050600091860101523060805260ff1992610193848154169055845115620005da5782855111620005c95760a05260c05282518184015190828110620005b7575b5060e05260ff80935116976101009889526200010962000605565b94600086526200011862000605565b916000835260005496868860081c161597888099620005aa575b801562000592575b156200053757886001809883161760005562000524575b506200017a8760005460081c1662000169816200064b565b62000174816200064b565b6200064b565b80518a8111620003515761015f918254908882811c9216801562000519575b8883101462000432578186849311620004c3575b5087908683116001146200045f5760009262000453575b5050600019600383901b1c191690871b1790555b8251918983116200035157610160938454928784811c9416801562000448575b8785101462000432578383869511620003d8575b508692841160011462000373575060009262000367575b5050600019600383901b1c191690841b1790555b6200024f600054938460081c1662000169816200064b565b60018060a01b03199261012d91848354169360fb54967f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e098339089168a600080a38a51808c019a8b11818c101762000351578360009b918c928e5284815201528160c95562000319575b5050505580331691161760fb5533908280a3516135149182620006ad833960805182818161189d0152818161198e0152611ccb015260a0518281816108e90152612d9f015260c05182612e04015260e051826105d3015251816105a70152f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989261ff00191689558951908152a1388080620002b9565b634e487b7160e01b600052604160045260246000fd5b01519050388062000223565b8794929192169185600052866000209260005b88828210620003c15750508411620003a7575b505050811b01905562000237565b015160001960f88460031b161c1916905538808062000399565b8385015186558a9790950194938401930162000386565b909192935085600052866000208480870160051c82019289881062000428575b9187968b92969594930160051c01915b828110620004185750506200020c565b600081558796508a910162000408565b92508192620003f8565b634e487b7160e01b600052602260045260246000fd5b93607f1693620001f8565b015190503880620001c4565b90858a94169185600052896000209260005b8b828210620004ac575050841162000492575b505050811b019055620001d8565b015160001960f88460031b161c1916905538808062000484565b8385015186558d9790950194938401930162000471565b90915083600052876000208680850160051c8201928a86106200050f575b918b91869594930160051c01915b828110620004ff575050620001ad565b600081558594508b9101620004ef565b92508192620004e1565b91607f169162000199565b61ffff1916610101176000553862000151565b8b5162461bcd60e51b815260048101879052602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156200013a57506001888216146200013a565b5060018882161062000132565b60001990830360031b1b1638620000ee565b885163d1eae93360e01b8152600490fd5b8851633b0187cd60e21b8152600490fd5b818101830151888201840152859201620000a5565b600080fd5b60405190602082016001600160401b038111838210176200035157604052565b6040519190601f01601f191682016001600160401b038111838210176200035157604052565b156200065357565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146121db5750806304634d8d146121a257806306fdde031461210b578063081812fc146120ec578063095ea7b314611f7557806323b872dd14611f315780632a55205a14611e6e5780633659cfe614611ca457806342842e0e14611c495780634f1ef2861461194e57806352d1902d1461188a5780635944c753146117b25780636352211e1461178157806370a08231146116ea578063715018a61461168257806379ba5097146115fc57806379ce0a131461146d5780637cad62a8146112f85780638a616bc0146112cb5780638da5cb5b146112a25780638fb8a45e1461125657806395d89b411461116b578063a22cb46514611098578063aa1b103f14611078578063b0ccc31e1461104e578063b7e31add14610bd5578063b88d4fde14610b3a578063b8d1e53214610ab4578063c490e914146107e1578063c87b56dd14610561578063cef9a20214610397578063e02c792c14610292578063e30c397814610268578063e985e9c5146102135763f2fde38b146101a257600080fd5b34610210576020366003190112610210576101bb612276565b6101c36124d6565b61012d80546001600160a01b0319166001600160a01b0392831690811790915560fb549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b80fd5b50346102105760403660031901126102105761022d612276565b604061023761228c565b9260018060a01b038093168152610164602052209116600052602052602060ff604060002054166040519015158152f35b503461021057806003193601126102105761012d546040516001600160a01b039091168152602090f35b50346102105760e06102ac6102a636612438565b90612d0c565b015160168151036103855760028151106103495761ffff60028201511690601681511061030c576022015160601c906102e58183612935565b7fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e8380a380f35b60405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606490fd5b60405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606490fd5b604051638d0242c960e01b8152600490fd5b50346102105760e06103ab6102a636612438565b01518051601319808201929180841161054d57600193841c91601682119081159161053f575b50610385578083511061030c578201600c015160601c92916103f282612c80565b9261040060405194856123b5565b82845261040c83612c80565b9260209283860194601f1901368637875b8281106104b3575050508351865b818110610490575050604051938285019083865251809152604085019392875b82811061047d5788887f03594fecb8a9aaa7406dd20a32bce98ef745336eb214761b085e7c924b71bda68989038aa280f35b845186529481019493810193830161044b565b91826104a96104a28895849799612c6c565b5189612935565b019492919461042b565b80849597941b600290818101808211610529578451106104ed578301015185919061ffff166104e28287612c6c565b52019593929561041d565b60405162461bcd60e51b8152600481018a90526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6002915082081515386103d1565b634e487b7160e01b85526011600452602485fd5b503461021057602090816003193601126102105760043560008181526101616020526040902054909183916105a0906001600160a01b031615156126b0565b6105cc60ff7f0000000000000000000000000000000000000000000000000000000000000000166131c8565b92828401907f00000000000000000000000000000000000000000000000000000000000000008252845115156000146107c75780837a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000082818110156107b9575b5050856d04ee2d6d415b85acef8100000000808510156107ad575b5050662386f26fc10000808410156107a0575b506305f5e10080841015610793575b5061271080841015610786575b506064831015610778575b600a80931015610770575b906021916001928161069b858094016131c8565b9750870101905b61073a575b50505050926106e792916106c794604051958693518092868601906122a2565b82016106db825180938680850191016122a2565b010380845201826123b5565b905b61072260256040518461070582965180928780860191016122a2565b810164173539b7b760d91b858201520360058101855201836123b5565b6107366040519282849384528301906122c5565b0390f35b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a83530491821561076b579190826106a2565b6106a7565b600101610687565b91606460029104920161067c565b6004919304920138610671565b6008919304920138610664565b6010919304920138610655565b90930492018538610642565b049250604090503880610627565b5050915050604051906107d98261237f565b8152906106e9565b506040366003190112610210576001600160401b0390600435828111610ab05736602382011215610ab0578060040135928311610ab05760248360051b82010192368411610aac576002908181108015610aa2575b610a905761084681959295612c80565b9161085460405193846123b5565b8183526020936024018484015b828210610a81575050506000906060956000905b82821061096557866108dd87808b6108b4604080518361089e82955180928880860191016122a2565b81016024358682015203848101845201826123b5565b604051809481926358cd21bf60e11b8352600060048401526060602484015260648301906122c5565b60c960448301520381347f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561095957610921578280f35b81813d8311610952575b61093581836123b5565b8101031261094d5761094690612cb6565b5081808280f35b600080fd5b503d61092b565b6040513d6000823e3d90fd5b90919293966109748389612c6c565b51948315159081610a76575b50610a645761098f8533613159565b15610a52576000610a4760226001936109a7896126fc565b506109b1896126fc565b908985526101638b5260408520916001600160601b0360a01b92838154169055868060a01b0316918286526101628c5260408620861981540190558a86526101618c52604086209081541690558960405195869360008051602061349f8339815191528280a4610a29815180928d80860191016122a2565b810161ffff60f01b8a60f01b168b82015203858101845201826123b5565b979493920190610875565b60405163c5a640a960e01b8152600490fd5b604051636c837c1360e11b8152600490fd5b905085111538610980565b81358152908501908501610861565b60405163dab8a20760e01b8152600490fd5b50600a8111610836565b8280fd5b5080fd5b503461021057602036600319011261021057610ace612276565b60fb546001600160a01b03919082163303610b28577f9f513fe86dc42fdbac355fa4d9b1d5be7b5e6cd2df67e30db8003766568de4769160209116610191816001600160601b0360a01b825416179055604051908152a180f35b604051635fc483c560e01b8152600490fd5b503461021057608036600319011261021057610b54612276565b610b5c61228c565b90606435906044356001600160401b038311610bd157610bc093610b87610bbb9436906004016123f1565b92336001600160a01b03821603610bc3575b610bab610ba68433613159565b6132c0565b610bb683838361337c565b612bf1565b612a91565b80f35b610bcc336131fa565b610b99565b8480fd5b5034610210576080366003190112610210576004356001600160401b038111610ab057610c069036906004016123f1565b906024356001600160401b038111610ab057610c269036906004016123f1565b916044356001600160a01b038116810361094d57606435906001600160601b038216820361094d5783549260ff8460081c161593848095611041575b801561102a575b15610fce5760ff198116600117865584610fbd575b50610ca160ff865460081c16610c93816127e1565b610c9c816127e1565b6127e1565b8051906001600160401b038211610fa9578190610cc061015f54612723565b601f8111610f33575b50602090601f8311600114610ec0578792610eb5575b50508160011b916000199060031b1c19161761015f555b84516001600160401b038111610ea15761016090610d148254612723565b601f8111610e3f575b506020601f8211600114610dba5781908798610d71979892610daf575b50508160011b916000199060031b1c19161790555b610d6360ff865460081c16610c93816127e1565b610d6c33612481565b6128a0565b610d785780f35b61ff001981541681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b015190503880610d3a565b8287527fec7e130cdeeae65215fabbcddb1de429e603c4887cc659532eda903e4933966397601f198316885b818110610e27575091610d7197989991846001959410610e0e575b505050811b019055610d4f565b015160001960f88460031b161c19169055388080610e01565b838301518b556001909a019960209384019301610de6565b8287527fec7e130cdeeae65215fabbcddb1de429e603c4887cc659532eda903e49339663601f830160051c81019160208410610e97575b601f0160051c01905b818110610e8c5750610d1d565b878155600101610e7f565b9091508190610e76565b634e487b7160e01b85526041600452602485fd5b015190503880610cdf565b61015f88526000805160206134bf8339815191529250601f198416885b818110610f1b5750908460019594939210610f02575b505050811b0161015f55610cf6565b015160001960f88460031b161c19169055388080610ef3565b92936020600181928786015181550195019301610edd565b90915061015f8752601f830160051c6000805160206134bf833981519152019060208410610f93575b90601f8493920160051c6000805160206134bf83398151915201905b818110610f855750610cc9565b888155849350600101610f78565b6000805160206134bf8339815191529150610f5c565b634e487b7160e01b86526041600452602486fd5b61ffff191661010117855538610c7e565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b158015610c695750600160ff821614610c69565b50600160ff821610610c62565b5034610210578060031936011261021057610191546040516001600160a01b039091168152602090f35b50346102105780600319360112610210576110916124d6565b8060c95580f35b5034610210576040366003190112610210576110b2612276565b6024359081151580920361094d576001600160a01b031690338214611126573383526101646020526040832082600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b503461021057806003193601126102105760405190806101609081549061119182612723565b8086529260019280841690811561122957506001146111cf575b610736866111bb818803826123b5565b6040519182916020835260208301906122c5565b815292507fec7e130cdeeae65215fabbcddb1de429e603c4887cc659532eda903e493396635b8284106112115750505081016020016111bb82610736386111ab565b805460208587018101919091529093019281016111f5565b9050869550610736969350602092506111bb94915060ff191682840152151560051b8201019293386111ab565b5034610210576020366003190112610210576112706124d6565b610193805460ff8116611290576004356101945560ff1916600117905580f35b604051639a26098d60e01b8152600490fd5b503461021057806003193601126102105760fb546040516001600160a01b039091168152602090f35b5034610210576020366003190112610210576112e56124d6565b600435815260ca60205280604081205580f35b506040366003190112610210576040516113118161231f565b6001908181526020918282018336823782511561145757600435905260009060609260005b82811061135f57866108dd8780886108b4604080518361089e82955180928880860191016122a2565b9091929361136d8284612c6c565b5194821515908161144c575b50610a64576113888533613159565b15610a525760006114426022869361139f896126fc565b506113a9896126fc565b8985526101638b52604080862080546001600160a01b03199081169091556001600160a01b039092168087526101628d52818720805488190190558b87526101618d52818720805490931690925551948592918b919060008051602061349f8339815191528280a4611423815180928d80860191016122a2565b810161ffff60f01b8a60f01b168b8201520360028101845201826123b5565b9493929101611336565b905085111538611379565b634e487b7160e01b600052603260045260246000fd5b50346102105760603660031901126102105780611488612276565b61149061228c565b906044359081151582036115f7576114a66124d6565b61019180546001600160a01b0319166001600160a01b0392831690811790915591823b6114d1578480f35b156115495750803b1561154557604051633e9f1edf60e11b81523060048201526001600160a01b0392909216602483015282908290604490829084905af1801561153a57611526575b50505b80388080808480f35b61152f90612350565b61021057803861151a565b6040513d84823e3d90fd5b5050fd5b8216156115ae57803b156115455760405163a0af290360e01b81523060048201526001600160a01b0392909216602483015282908290604490829084905af1801561153a5761159a575b505061151d565b6115a390612350565b610210578038611593565b8091503b156115f4578190602460405180948193632210724360e11b83523060048401525af1801561153a576115e5575b5061151d565b6115ee90612350565b386115df565b50fd5b505050fd5b503461021057806003193601126102105761012d54336001600160a01b039091160361162b57610bc033612481565b60405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608490fd5b503461021057806003193601126102105761169b6124d6565b61012d80546001600160a01b031990811690915560fb8054918216905581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5034610210576020366003190112610210576001600160a01b0361170c612276565b16801561172a57816040916020935261016283522054604051908152f35b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b50346102105760203660031901126102105760206117a06004356126fc565b6040516001600160a01b039091168152f35b5034610210576060366003190112610210576117cc61228c565b6044356001600160601b038116809103610aac576117e86124d6565b6117f6612710821115612841565b6001600160a01b0391821691821561184557604051926118158461231f565b83526020808401928352600435855260ca9052604084209251915160a01b6001600160a01b031916911617905580f35b60405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606490fd5b50346102105780600319360112610210577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036118e357602060405160008051602061347f8339815191528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b50604036600319011261021057611963612276565b906024356001600160401b038111610ab0576119839036906004016123f1565b916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116906119bc3083141561252e565b6119d960008051602061347f83398151915292828454161461258f565b6119e16124d6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611a18575050610bc09192506125f0565b6040516352d1902d60e01b8152602094939291831691908581600481865afa859181611c16575b50611aa05760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b94939403611bbf57611ab1826125f0565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2845115801590611bb7575b611af1575b505050905080f35b813b15611b665750918084611b5c94848397519201905af4611b11612680565b907f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60405193611b408561239a565b60278552840152660819985a5b195960ca1b604084015261279d565b5080388080611ae9565b62461bcd60e51b815260048101839052602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b506001611ae4565b60405162461bcd60e51b815260048101849052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d8311611c42575b611c2e81836123b5565b81010312611c3e57519038611a3f565b8580fd5b503d611c24565b503461021057610bc0610bbb611c5e366122ea565b6001600160a01b0383163314159290919083611c96575b60405193611c828561237f565b878552610bc357610bab610ba68433613159565b611c9f336131fa565b611c75565b5034610210576020908160031936011261021057611cc0612276565b6001600160a01b03927f00000000000000000000000000000000000000000000000000000000000000008416611cf83082141561252e565b611d1560008051602061347f83398151915291868354161461258f565b611d1d6124d6565b60405194611d2a8661237f565b8486527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611d6557505050610bc09192506125f0565b8392949316906040516352d1902d60e01b81528581600481865afa859181611e3f575b50611de95760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b94939403611bbf57611dfa826125f0565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2845115801590611e3857611af157505050905080f35b5083611ae4565b9091508681813d8311611e67575b611e5781836123b5565b81010312611c3e57519038611d88565b503d611e4d565b503461021057604036600319011261021057602435600435825260ca602052604082209160405192611e9f8461231f565b546001600160a01b0380821680865260a09290921c602086015293919015611f0d575b6001600160601b0360208301511692838102938185041490151715611ef95750604092612710915116918351928352046020820152f35b634e487b7160e01b81526011600452602490fd5b9050604051611f1b8161231f565b60c954848116825260a01c602082015290611ec2565b503461021057610bc0611f43366122ea565b91336001600160a01b03821603611f67575b611f62610ba68433613159565b61337c565b611f70336131fa565b611f55565b503461021057604036600319011261021057611f8f612276565b602435906001600160a01b038080611fa6856126fc565b1692169180831461209d5780331490811561207b575b5015612010578284526101636020526040842080546001600160a01b03191683179055611fe8836126fc565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b905084526101646020526040842033855260205260ff60408520541638611fbc565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b50346102105760203660031901126102105760206117a060043561275d565b5034610210578060031936011261021057604051908061015f9081549061213182612723565b80865292600192808416908115611229575060011461215a57610736866111bb818803826123b5565b815292506000805160206134bf8339815191525b82841061218a5750505081016020016111bb82610736386111ab565b8054602085870181019190915290930192810161216e565b5034610210576040366003190112610210576121bc612276565b6024356001600160601b0381168103610aac57610bc091610d6c6124d6565b905034610ab0576020366003190112610ab05760043563ffffffff60e01b8116809103610aac576020925063152a902d60e11b8114908115612265575b818015612228575b505015158152f35b6380ac58cd60e01b82149250908215612254575b50811561224c575b503880612220565b905038612244565b635b5e139f60e01b1491503861223c565b6301ffc9a760e01b81149150612218565b600435906001600160a01b038216820361094d57565b602435906001600160a01b038216820361094d57565b60005b8381106122b55750506000910152565b81810151838201526020016122a5565b906020916122de815180928185528580860191016122a2565b601f01601f1916010190565b606090600319011261094d576001600160a01b0390600435828116810361094d5791602435908116810361094d579060443590565b604081019081106001600160401b0382111761233a57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161233a57604052565b61016081019081106001600160401b0382111761233a57604052565b602081019081106001600160401b0382111761233a57604052565b606081019081106001600160401b0382111761233a57604052565b90601f801991011681019081106001600160401b0382111761233a57604052565b6001600160401b03811161233a57601f01601f191660200190565b81601f8201121561094d57803590612408826123d6565b9261241660405194856123b5565b8284526020838301011161094d57816000926020809301838601378301015290565b90602060031983011261094d576004356001600160401b039283821161094d578060238301121561094d57816004013593841161094d576024848301011161094d576024019190565b61012d80546001600160a01b031990811690915560fb80549182166001600160a01b0393841690811790915591167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b60fb546001600160a01b031633036124ea57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561253557565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b1561259657565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b803b156126255760008051602061347f83398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b3d156126ab573d90612691826123d6565b9161269f60405193846123b5565b82523d6000602084013e565b606090565b156126b757565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b600090815261016160205260409020546001600160a01b03166127208115156126b0565b90565b90600182811c92168015612753575b602083101461273d57565b634e487b7160e01b600052602260045260246000fd5b91607f1691612732565b60008181526101616020526040902054612781906001600160a01b031615156126b0565b600090815261016360205260409020546001600160a01b031690565b909190156127a9575090565b8151156127b95750805190602001fd5b60405162461bcd60e51b8152602060048201529081906127dd9060248301906122c5565b0390fd5b156127e857565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b1561284857565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b906001600160601b038116916128ba612710841115612841565b6001600160a01b03169182156128f05760206040516128d88161231f565b848152015260a01b6001600160a01b0319161760c955565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b6040516129418161237f565b6000808252926001600160a01b0383169283156129fa5781610bbb946129f89661298a6129848460005261016160205260018060a01b0360406000205416151590565b15612ab1565b600083815261016160205260409020546129ae906001600160a01b03161515612984565b818152610162602052604081206001815401905582815261016160205260408120826001600160601b0360a01b82541617905560008051602061349f8339815191528180a4612afd565b565b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b15612a9857565b60405162461bcd60e51b8152806127dd60048201612a3e565b15612ab857565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b9091600091803b15612be857612b486020918493604051948580948193630a85bd0160e11b9a8b845233600485015284602485015260448401526080606484015260848301906122c5565b03926001600160a01b03165af190829082612ba0575b5050612b9257612b6c612680565b80519081612b8d5760405162461bcd60e51b8152806127dd60048201612a3e565b602001fd5b6001600160e01b0319161490565b909192506020813d8211612be0575b81612bbc602093836123b5565b81010312610ab05751906001600160e01b0319821682036102105750903880612b5e565b3d9150612baf565b50505050600190565b91926000929190813b15612c6257602091612c479185604051958680958194630a85bd0160e11b9b8c845233600485015260018060a01b03809516602485015260448401526080606484015260848301906122c5565b0393165af190829082612ba0575050612b9257612b6c612680565b5050505050600190565b80518210156114575760209160051b010190565b6001600160401b03811161233a5760051b60200190565b519060ff8216820361094d57565b519063ffffffff8216820361094d57565b51906001600160401b038216820361094d57565b90929192612cd7816123d6565b91612ce560405193846123b5565b82948284528282011161094d5760206129f89301906122a2565b5190811515820361094d57565b604051604491612d1b82612363565b8360009384928385528360208601528360408601528360608601528360808601528360a08601528360c0860152606060e08601528361014061010096828882015260606101208201520152604051968793849263607ec5ef60e11b845260206004850152816024850152848401378181018301859052601f01601f191681010301817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa90811561153a57829383918493612edc575b505015612eb7575061ffff60608301511660058114159081612eab575b50612e995760808201517f00000000000000000000000000000000000000000000000000000000000000008114159081612e8b575b50612e7957610140820190815181526101928060205260ff604083205416612e675760409251825260205220600160ff1982541617905590565b60405163032a925360e41b8152600490fd5b604051636b99980160e11b8152600490fd5b905061019454141538612e2d565b60405163eae0fb0960e01b8152600490fd5b60019150141538612df8565b6040516366fd14ef60e01b8152602060048201529081906127dd9060248301906122c5565b92509350503d928383823e612ef184826123b5565b6060818581010312610aac5780516001600160401b0381116131555761016081830186840103126131555760405192612f2984612363565b612f34828401612c97565b8452612f44602083850101612ca5565b6020850152612f57604083850101612ca5565b60408501526060828401015161ffff81168103611c3e576060850152608082840101516080850152612f8d60a083850101612cb6565b60a0850152612fa060c083850101612c97565b60c085015260e082840101516001600160401b038111611c3e5782840101868401601f82011215611c3e57612fde9087850190602081519101612cca565b60e0850152612ff08183850101612ca5565b9084015261012081830101516001600160401b038111610bd15781830101858301601f82011215610bd15780519061302782612c80565b9161303560405193846123b5565b808352602083019188860160208360071b830101116131515760208101925b60208360071b83010184106130c8575050505090610140916101208501528201015161014083015261308860208201612cff565b9360408201516001600160401b038111610bd157820191818101601f84011215610bd157906130bf92910190602081519101612cca565b90923880612ddb565b6080848b8901031261314d576040518060808101106001600160401b0360808301111761313957602080939282608080940160405287518152828801518382015261311560408901612c97565b604082015261312660608901612c97565b6060820152815201940193909150613054565b634e487b7160e01b8a52604160045260248afd5b8880fd5b8780fd5b8380fd5b906001600160a01b03808061316d846126fc565b169316918383149384156131a0575b50831561318a575b50505090565b6131969192935061275d565b1614388080613184565b90935060005261016460205260406000208260005260205260ff60406000205416923861317c565b906131d2826123d6565b6131df60405191826123b5565b82815280926131f0601f19916123d6565b0190602036910137565b610191546001600160a01b03908116801515806132b6575b61321b57505050565b604051633185c44d60e21b81523060048201526001600160a01b038416602482015290602090829060449082905afa9081156109595760009161327d575b5015613263575050565b604051633b79c77360e21b81529116600482015260249150fd5b906020823d82116132ae575b81613296602093836123b5565b8101031261021057506132a890612cff565b38613259565b3d9150613289565b50803b1515613212565b156132c757565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b1561332957565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b906133a49161338a846126fc565b6001600160a01b0393918416928492909183168414613322565b1691821561342d57816133c1916133ba866126fc565b1614613322565b60008051602061349f8339815191526000848152610163602052604081206001600160601b0360a01b90818154169055838252610162602052604082206000198154019055848252604082206001815401905585825261016160205284604083209182541617905580a4565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c9815a58669fc89297bdc7dd447c098116f98e79093735c0992d0967b696ed9a2646970667358221220867edc9591b929c9c1bf04182676e9e90a1fa35f95621e3a2d360d3742904c5d64736f6c6343000813003300000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b000000000000000000000000670fd103b1a08628e9557cd66b87ded8411151900000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001d68747470733a2f2f6d657461646174612e79303074732e636f6d2f792f000000

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146121db5750806304634d8d146121a257806306fdde031461210b578063081812fc146120ec578063095ea7b314611f7557806323b872dd14611f315780632a55205a14611e6e5780633659cfe614611ca457806342842e0e14611c495780634f1ef2861461194e57806352d1902d1461188a5780635944c753146117b25780636352211e1461178157806370a08231146116ea578063715018a61461168257806379ba5097146115fc57806379ce0a131461146d5780637cad62a8146112f85780638a616bc0146112cb5780638da5cb5b146112a25780638fb8a45e1461125657806395d89b411461116b578063a22cb46514611098578063aa1b103f14611078578063b0ccc31e1461104e578063b7e31add14610bd5578063b88d4fde14610b3a578063b8d1e53214610ab4578063c490e914146107e1578063c87b56dd14610561578063cef9a20214610397578063e02c792c14610292578063e30c397814610268578063e985e9c5146102135763f2fde38b146101a257600080fd5b34610210576020366003190112610210576101bb612276565b6101c36124d6565b61012d80546001600160a01b0319166001600160a01b0392831690811790915560fb549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b80fd5b50346102105760403660031901126102105761022d612276565b604061023761228c565b9260018060a01b038093168152610164602052209116600052602052602060ff604060002054166040519015158152f35b503461021057806003193601126102105761012d546040516001600160a01b039091168152602090f35b50346102105760e06102ac6102a636612438565b90612d0c565b015160168151036103855760028151106103495761ffff60028201511690601681511061030c576022015160601c906102e58183612935565b7fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e8380a380f35b60405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606490fd5b60405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606490fd5b604051638d0242c960e01b8152600490fd5b50346102105760e06103ab6102a636612438565b01518051601319808201929180841161054d57600193841c91601682119081159161053f575b50610385578083511061030c578201600c015160601c92916103f282612c80565b9261040060405194856123b5565b82845261040c83612c80565b9260209283860194601f1901368637875b8281106104b3575050508351865b818110610490575050604051938285019083865251809152604085019392875b82811061047d5788887f03594fecb8a9aaa7406dd20a32bce98ef745336eb214761b085e7c924b71bda68989038aa280f35b845186529481019493810193830161044b565b91826104a96104a28895849799612c6c565b5189612935565b019492919461042b565b80849597941b600290818101808211610529578451106104ed578301015185919061ffff166104e28287612c6c565b52019593929561041d565b60405162461bcd60e51b8152600481018a90526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6002915082081515386103d1565b634e487b7160e01b85526011600452602485fd5b503461021057602090816003193601126102105760043560008181526101616020526040902054909183916105a0906001600160a01b031615156126b0565b6105cc60ff7f000000000000000000000000000000000000000000000000000000000000001d166131c8565b92828401907f68747470733a2f2f6d657461646174612e79303074732e636f6d2f792f0000008252845115156000146107c75780837a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000082818110156107b9575b5050856d04ee2d6d415b85acef8100000000808510156107ad575b5050662386f26fc10000808410156107a0575b506305f5e10080841015610793575b5061271080841015610786575b506064831015610778575b600a80931015610770575b906021916001928161069b858094016131c8565b9750870101905b61073a575b50505050926106e792916106c794604051958693518092868601906122a2565b82016106db825180938680850191016122a2565b010380845201826123b5565b905b61072260256040518461070582965180928780860191016122a2565b810164173539b7b760d91b858201520360058101855201836123b5565b6107366040519282849384528301906122c5565b0390f35b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a83530491821561076b579190826106a2565b6106a7565b600101610687565b91606460029104920161067c565b6004919304920138610671565b6008919304920138610664565b6010919304920138610655565b90930492018538610642565b049250604090503880610627565b5050915050604051906107d98261237f565b8152906106e9565b506040366003190112610210576001600160401b0390600435828111610ab05736602382011215610ab0578060040135928311610ab05760248360051b82010192368411610aac576002908181108015610aa2575b610a905761084681959295612c80565b9161085460405193846123b5565b8183526020936024018484015b828210610a81575050506000906060956000905b82821061096557866108dd87808b6108b4604080518361089e82955180928880860191016122a2565b81016024358682015203848101845201826123b5565b604051809481926358cd21bf60e11b8352600060048401526060602484015260648301906122c5565b60c960448301520381347f00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b6001600160a01b03165af1801561095957610921578280f35b81813d8311610952575b61093581836123b5565b8101031261094d5761094690612cb6565b5081808280f35b600080fd5b503d61092b565b6040513d6000823e3d90fd5b90919293966109748389612c6c565b51948315159081610a76575b50610a645761098f8533613159565b15610a52576000610a4760226001936109a7896126fc565b506109b1896126fc565b908985526101638b5260408520916001600160601b0360a01b92838154169055868060a01b0316918286526101628c5260408620861981540190558a86526101618c52604086209081541690558960405195869360008051602061349f8339815191528280a4610a29815180928d80860191016122a2565b810161ffff60f01b8a60f01b168b82015203858101845201826123b5565b979493920190610875565b60405163c5a640a960e01b8152600490fd5b604051636c837c1360e11b8152600490fd5b905085111538610980565b81358152908501908501610861565b60405163dab8a20760e01b8152600490fd5b50600a8111610836565b8280fd5b5080fd5b503461021057602036600319011261021057610ace612276565b60fb546001600160a01b03919082163303610b28577f9f513fe86dc42fdbac355fa4d9b1d5be7b5e6cd2df67e30db8003766568de4769160209116610191816001600160601b0360a01b825416179055604051908152a180f35b604051635fc483c560e01b8152600490fd5b503461021057608036600319011261021057610b54612276565b610b5c61228c565b90606435906044356001600160401b038311610bd157610bc093610b87610bbb9436906004016123f1565b92336001600160a01b03821603610bc3575b610bab610ba68433613159565b6132c0565b610bb683838361337c565b612bf1565b612a91565b80f35b610bcc336131fa565b610b99565b8480fd5b5034610210576080366003190112610210576004356001600160401b038111610ab057610c069036906004016123f1565b906024356001600160401b038111610ab057610c269036906004016123f1565b916044356001600160a01b038116810361094d57606435906001600160601b038216820361094d5783549260ff8460081c161593848095611041575b801561102a575b15610fce5760ff198116600117865584610fbd575b50610ca160ff865460081c16610c93816127e1565b610c9c816127e1565b6127e1565b8051906001600160401b038211610fa9578190610cc061015f54612723565b601f8111610f33575b50602090601f8311600114610ec0578792610eb5575b50508160011b916000199060031b1c19161761015f555b84516001600160401b038111610ea15761016090610d148254612723565b601f8111610e3f575b506020601f8211600114610dba5781908798610d71979892610daf575b50508160011b916000199060031b1c19161790555b610d6360ff865460081c16610c93816127e1565b610d6c33612481565b6128a0565b610d785780f35b61ff001981541681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b015190503880610d3a565b8287527fec7e130cdeeae65215fabbcddb1de429e603c4887cc659532eda903e4933966397601f198316885b818110610e27575091610d7197989991846001959410610e0e575b505050811b019055610d4f565b015160001960f88460031b161c19169055388080610e01565b838301518b556001909a019960209384019301610de6565b8287527fec7e130cdeeae65215fabbcddb1de429e603c4887cc659532eda903e49339663601f830160051c81019160208410610e97575b601f0160051c01905b818110610e8c5750610d1d565b878155600101610e7f565b9091508190610e76565b634e487b7160e01b85526041600452602485fd5b015190503880610cdf565b61015f88526000805160206134bf8339815191529250601f198416885b818110610f1b5750908460019594939210610f02575b505050811b0161015f55610cf6565b015160001960f88460031b161c19169055388080610ef3565b92936020600181928786015181550195019301610edd565b90915061015f8752601f830160051c6000805160206134bf833981519152019060208410610f93575b90601f8493920160051c6000805160206134bf83398151915201905b818110610f855750610cc9565b888155849350600101610f78565b6000805160206134bf8339815191529150610f5c565b634e487b7160e01b86526041600452602486fd5b61ffff191661010117855538610c7e565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b158015610c695750600160ff821614610c69565b50600160ff821610610c62565b5034610210578060031936011261021057610191546040516001600160a01b039091168152602090f35b50346102105780600319360112610210576110916124d6565b8060c95580f35b5034610210576040366003190112610210576110b2612276565b6024359081151580920361094d576001600160a01b031690338214611126573383526101646020526040832082600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b503461021057806003193601126102105760405190806101609081549061119182612723565b8086529260019280841690811561122957506001146111cf575b610736866111bb818803826123b5565b6040519182916020835260208301906122c5565b815292507fec7e130cdeeae65215fabbcddb1de429e603c4887cc659532eda903e493396635b8284106112115750505081016020016111bb82610736386111ab565b805460208587018101919091529093019281016111f5565b9050869550610736969350602092506111bb94915060ff191682840152151560051b8201019293386111ab565b5034610210576020366003190112610210576112706124d6565b610193805460ff8116611290576004356101945560ff1916600117905580f35b604051639a26098d60e01b8152600490fd5b503461021057806003193601126102105760fb546040516001600160a01b039091168152602090f35b5034610210576020366003190112610210576112e56124d6565b600435815260ca60205280604081205580f35b506040366003190112610210576040516113118161231f565b6001908181526020918282018336823782511561145757600435905260009060609260005b82811061135f57866108dd8780886108b4604080518361089e82955180928880860191016122a2565b9091929361136d8284612c6c565b5194821515908161144c575b50610a64576113888533613159565b15610a525760006114426022869361139f896126fc565b506113a9896126fc565b8985526101638b52604080862080546001600160a01b03199081169091556001600160a01b039092168087526101628d52818720805488190190558b87526101618d52818720805490931690925551948592918b919060008051602061349f8339815191528280a4611423815180928d80860191016122a2565b810161ffff60f01b8a60f01b168b8201520360028101845201826123b5565b9493929101611336565b905085111538611379565b634e487b7160e01b600052603260045260246000fd5b50346102105760603660031901126102105780611488612276565b61149061228c565b906044359081151582036115f7576114a66124d6565b61019180546001600160a01b0319166001600160a01b0392831690811790915591823b6114d1578480f35b156115495750803b1561154557604051633e9f1edf60e11b81523060048201526001600160a01b0392909216602483015282908290604490829084905af1801561153a57611526575b50505b80388080808480f35b61152f90612350565b61021057803861151a565b6040513d84823e3d90fd5b5050fd5b8216156115ae57803b156115455760405163a0af290360e01b81523060048201526001600160a01b0392909216602483015282908290604490829084905af1801561153a5761159a575b505061151d565b6115a390612350565b610210578038611593565b8091503b156115f4578190602460405180948193632210724360e11b83523060048401525af1801561153a576115e5575b5061151d565b6115ee90612350565b386115df565b50fd5b505050fd5b503461021057806003193601126102105761012d54336001600160a01b039091160361162b57610bc033612481565b60405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608490fd5b503461021057806003193601126102105761169b6124d6565b61012d80546001600160a01b031990811690915560fb8054918216905581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5034610210576020366003190112610210576001600160a01b0361170c612276565b16801561172a57816040916020935261016283522054604051908152f35b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b50346102105760203660031901126102105760206117a06004356126fc565b6040516001600160a01b039091168152f35b5034610210576060366003190112610210576117cc61228c565b6044356001600160601b038116809103610aac576117e86124d6565b6117f6612710821115612841565b6001600160a01b0391821691821561184557604051926118158461231f565b83526020808401928352600435855260ca9052604084209251915160a01b6001600160a01b031916911617905580f35b60405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606490fd5b50346102105780600319360112610210577f0000000000000000000000000a178f86e06929ea4960b9cb2b6427bb82ce19816001600160a01b031630036118e357602060405160008051602061347f8339815191528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b50604036600319011261021057611963612276565b906024356001600160401b038111610ab0576119839036906004016123f1565b916001600160a01b037f0000000000000000000000000a178f86e06929ea4960b9cb2b6427bb82ce19818116906119bc3083141561252e565b6119d960008051602061347f83398151915292828454161461258f565b6119e16124d6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611a18575050610bc09192506125f0565b6040516352d1902d60e01b8152602094939291831691908581600481865afa859181611c16575b50611aa05760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b94939403611bbf57611ab1826125f0565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2845115801590611bb7575b611af1575b505050905080f35b813b15611b665750918084611b5c94848397519201905af4611b11612680565b907f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60405193611b408561239a565b60278552840152660819985a5b195960ca1b604084015261279d565b5080388080611ae9565b62461bcd60e51b815260048101839052602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b506001611ae4565b60405162461bcd60e51b815260048101849052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d8311611c42575b611c2e81836123b5565b81010312611c3e57519038611a3f565b8580fd5b503d611c24565b503461021057610bc0610bbb611c5e366122ea565b6001600160a01b0383163314159290919083611c96575b60405193611c828561237f565b878552610bc357610bab610ba68433613159565b611c9f336131fa565b611c75565b5034610210576020908160031936011261021057611cc0612276565b6001600160a01b03927f0000000000000000000000000a178f86e06929ea4960b9cb2b6427bb82ce19818416611cf83082141561252e565b611d1560008051602061347f83398151915291868354161461258f565b611d1d6124d6565b60405194611d2a8661237f565b8486527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611d6557505050610bc09192506125f0565b8392949316906040516352d1902d60e01b81528581600481865afa859181611e3f575b50611de95760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b94939403611bbf57611dfa826125f0565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2845115801590611e3857611af157505050905080f35b5083611ae4565b9091508681813d8311611e67575b611e5781836123b5565b81010312611c3e57519038611d88565b503d611e4d565b503461021057604036600319011261021057602435600435825260ca602052604082209160405192611e9f8461231f565b546001600160a01b0380821680865260a09290921c602086015293919015611f0d575b6001600160601b0360208301511692838102938185041490151715611ef95750604092612710915116918351928352046020820152f35b634e487b7160e01b81526011600452602490fd5b9050604051611f1b8161231f565b60c954848116825260a01c602082015290611ec2565b503461021057610bc0611f43366122ea565b91336001600160a01b03821603611f67575b611f62610ba68433613159565b61337c565b611f70336131fa565b611f55565b503461021057604036600319011261021057611f8f612276565b602435906001600160a01b038080611fa6856126fc565b1692169180831461209d5780331490811561207b575b5015612010578284526101636020526040842080546001600160a01b03191683179055611fe8836126fc565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b905084526101646020526040842033855260205260ff60408520541638611fbc565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b50346102105760203660031901126102105760206117a060043561275d565b5034610210578060031936011261021057604051908061015f9081549061213182612723565b80865292600192808416908115611229575060011461215a57610736866111bb818803826123b5565b815292506000805160206134bf8339815191525b82841061218a5750505081016020016111bb82610736386111ab565b8054602085870181019190915290930192810161216e565b5034610210576040366003190112610210576121bc612276565b6024356001600160601b0381168103610aac57610bc091610d6c6124d6565b905034610ab0576020366003190112610ab05760043563ffffffff60e01b8116809103610aac576020925063152a902d60e11b8114908115612265575b818015612228575b505015158152f35b6380ac58cd60e01b82149250908215612254575b50811561224c575b503880612220565b905038612244565b635b5e139f60e01b1491503861223c565b6301ffc9a760e01b81149150612218565b600435906001600160a01b038216820361094d57565b602435906001600160a01b038216820361094d57565b60005b8381106122b55750506000910152565b81810151838201526020016122a5565b906020916122de815180928185528580860191016122a2565b601f01601f1916010190565b606090600319011261094d576001600160a01b0390600435828116810361094d5791602435908116810361094d579060443590565b604081019081106001600160401b0382111761233a57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161233a57604052565b61016081019081106001600160401b0382111761233a57604052565b602081019081106001600160401b0382111761233a57604052565b606081019081106001600160401b0382111761233a57604052565b90601f801991011681019081106001600160401b0382111761233a57604052565b6001600160401b03811161233a57601f01601f191660200190565b81601f8201121561094d57803590612408826123d6565b9261241660405194856123b5565b8284526020838301011161094d57816000926020809301838601378301015290565b90602060031983011261094d576004356001600160401b039283821161094d578060238301121561094d57816004013593841161094d576024848301011161094d576024019190565b61012d80546001600160a01b031990811690915560fb80549182166001600160a01b0393841690811790915591167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b60fb546001600160a01b031633036124ea57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561253557565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b1561259657565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b803b156126255760008051602061347f83398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b3d156126ab573d90612691826123d6565b9161269f60405193846123b5565b82523d6000602084013e565b606090565b156126b757565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b600090815261016160205260409020546001600160a01b03166127208115156126b0565b90565b90600182811c92168015612753575b602083101461273d57565b634e487b7160e01b600052602260045260246000fd5b91607f1691612732565b60008181526101616020526040902054612781906001600160a01b031615156126b0565b600090815261016360205260409020546001600160a01b031690565b909190156127a9575090565b8151156127b95750805190602001fd5b60405162461bcd60e51b8152602060048201529081906127dd9060248301906122c5565b0390fd5b156127e857565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b1561284857565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b906001600160601b038116916128ba612710841115612841565b6001600160a01b03169182156128f05760206040516128d88161231f565b848152015260a01b6001600160a01b0319161760c955565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b6040516129418161237f565b6000808252926001600160a01b0383169283156129fa5781610bbb946129f89661298a6129848460005261016160205260018060a01b0360406000205416151590565b15612ab1565b600083815261016160205260409020546129ae906001600160a01b03161515612984565b818152610162602052604081206001815401905582815261016160205260408120826001600160601b0360a01b82541617905560008051602061349f8339815191528180a4612afd565b565b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b15612a9857565b60405162461bcd60e51b8152806127dd60048201612a3e565b15612ab857565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b9091600091803b15612be857612b486020918493604051948580948193630a85bd0160e11b9a8b845233600485015284602485015260448401526080606484015260848301906122c5565b03926001600160a01b03165af190829082612ba0575b5050612b9257612b6c612680565b80519081612b8d5760405162461bcd60e51b8152806127dd60048201612a3e565b602001fd5b6001600160e01b0319161490565b909192506020813d8211612be0575b81612bbc602093836123b5565b81010312610ab05751906001600160e01b0319821682036102105750903880612b5e565b3d9150612baf565b50505050600190565b91926000929190813b15612c6257602091612c479185604051958680958194630a85bd0160e11b9b8c845233600485015260018060a01b03809516602485015260448401526080606484015260848301906122c5565b0393165af190829082612ba0575050612b9257612b6c612680565b5050505050600190565b80518210156114575760209160051b010190565b6001600160401b03811161233a5760051b60200190565b519060ff8216820361094d57565b519063ffffffff8216820361094d57565b51906001600160401b038216820361094d57565b90929192612cd7816123d6565b91612ce560405193846123b5565b82948284528282011161094d5760206129f89301906122a2565b5190811515820361094d57565b604051604491612d1b82612363565b8360009384928385528360208601528360408601528360608601528360808601528360a08601528360c0860152606060e08601528361014061010096828882015260606101208201520152604051968793849263607ec5ef60e11b845260206004850152816024850152848401378181018301859052601f01601f191681010301817f00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b6001600160a01b03165afa90811561153a57829383918493612edc575b505015612eb7575061ffff60608301511660058114159081612eab575b50612e995760808201517f000000000000000000000000670fd103b1a08628e9557cd66b87ded8411151908114159081612e8b575b50612e7957610140820190815181526101928060205260ff604083205416612e675760409251825260205220600160ff1982541617905590565b60405163032a925360e41b8152600490fd5b604051636b99980160e11b8152600490fd5b905061019454141538612e2d565b60405163eae0fb0960e01b8152600490fd5b60019150141538612df8565b6040516366fd14ef60e01b8152602060048201529081906127dd9060248301906122c5565b92509350503d928383823e612ef184826123b5565b6060818581010312610aac5780516001600160401b0381116131555761016081830186840103126131555760405192612f2984612363565b612f34828401612c97565b8452612f44602083850101612ca5565b6020850152612f57604083850101612ca5565b60408501526060828401015161ffff81168103611c3e576060850152608082840101516080850152612f8d60a083850101612cb6565b60a0850152612fa060c083850101612c97565b60c085015260e082840101516001600160401b038111611c3e5782840101868401601f82011215611c3e57612fde9087850190602081519101612cca565b60e0850152612ff08183850101612ca5565b9084015261012081830101516001600160401b038111610bd15781830101858301601f82011215610bd15780519061302782612c80565b9161303560405193846123b5565b808352602083019188860160208360071b830101116131515760208101925b60208360071b83010184106130c8575050505090610140916101208501528201015161014083015261308860208201612cff565b9360408201516001600160401b038111610bd157820191818101601f84011215610bd157906130bf92910190602081519101612cca565b90923880612ddb565b6080848b8901031261314d576040518060808101106001600160401b0360808301111761313957602080939282608080940160405287518152828801518382015261311560408901612c97565b604082015261312660608901612c97565b6060820152815201940193909150613054565b634e487b7160e01b8a52604160045260248afd5b8880fd5b8780fd5b8380fd5b906001600160a01b03808061316d846126fc565b169316918383149384156131a0575b50831561318a575b50505090565b6131969192935061275d565b1614388080613184565b90935060005261016460205260406000208260005260205260ff60406000205416923861317c565b906131d2826123d6565b6131df60405191826123b5565b82815280926131f0601f19916123d6565b0190602036910137565b610191546001600160a01b03908116801515806132b6575b61321b57505050565b604051633185c44d60e21b81523060048201526001600160a01b038416602482015290602090829060449082905afa9081156109595760009161327d575b5015613263575050565b604051633b79c77360e21b81529116600482015260249150fd5b906020823d82116132ae575b81613296602093836123b5565b8101031261021057506132a890612cff565b38613259565b3d9150613289565b50803b1515613212565b156132c757565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b1561332957565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b906133a49161338a846126fc565b6001600160a01b0393918416928492909183168414613322565b1691821561342d57816133c1916133ba866126fc565b1614613322565b60008051602061349f8339815191526000848152610163602052604081206001600160601b0360a01b90818154169055838252610162602052604082206000198154019055848252604082206001815401905585825261016160205284604083209182541617905580a4565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c9815a58669fc89297bdc7dd447c098116f98e79093735c0992d0967b696ed9a2646970667358221220867edc9591b929c9c1bf04182676e9e90a1fa35f95621e3a2d360d3742904c5d64736f6c63430008130033

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

00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b000000000000000000000000670fd103b1a08628e9557cd66b87ded8411151900000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001d68747470733a2f2f6d657461646174612e79303074732e636f6d2f792f000000

-----Decoded View---------------
Arg [0] : wormhole (address): 0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B
Arg [1] : emitterAddress (bytes32): 0x000000000000000000000000670fd103b1a08628e9557cd66b87ded841115190
Arg [2] : baseUri (bytes): 0x68747470733a2f2f6d657461646174612e79303074732e636f6d2f792f

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b
Arg [1] : 000000000000000000000000670fd103b1a08628e9557cd66b87ded841115190
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 000000000000000000000000000000000000000000000000000000000000001d
Arg [4] : 68747470733a2f2f6d657461646174612e79303074732e636f6d2f792f000000


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.