ETH Price: $2,488.16 (+2.27%)

Token

 

Overview

Max Total Supply

10

Holders

10

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
mik-j.eth
0x4bc5f73a9a3f7210ad9bc3f0dad3f1ae66f20c91
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
TokenBundler

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : TokenBundler.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "MultiToken/MultiToken.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
import "openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol";
import "openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol";
import "openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol";
import "./ITokenBundler.sol";


contract TokenBundler is Ownable, ERC1155, IERC1155Receiver, IERC721Receiver, ITokenBundler {
    using MultiToken for MultiToken.Asset;

    /*----------------------------------------------------------*|
    |*  # VARIABLES & CONSTANTS DEFINITIONS                     *|
    |*----------------------------------------------------------*/

    /**
     * Global incremental bundle id variable
     */
    uint256 private _id;

    /**
     * Global incremental token nonce variable
     */
    uint256 private _nonce;

    /**
     * Mapping of bundle id to token nonce list
     */
    mapping (uint256 => uint256[]) private _bundles;

    /**
     * Mapping of token nonce to asset struct
     */
    mapping (uint256 => MultiToken.Asset) private _tokens;

    /*----------------------------------------------------------*|
    |*  # EVENTS & ERRORS DEFINITIONS                           *|
    |*----------------------------------------------------------*/

    // No custom events nor errors

    /*----------------------------------------------------------*|
    |*  # CONSTRUCTOR & FUNCTIONS                               *|
    |*----------------------------------------------------------*/

    /**
     * Token Bundler constructor
     * @param _uri Bundlers metadata URI
     */
    constructor(string memory _uri) ERC1155(_uri) {

    }


    /**
     * @dev See {ITokenBundler-create}.
     */
    function create(MultiToken.Asset[] memory _assets) override external returns (uint256 bundleId) {
        uint256 length = _assets.length;
        require(length > 0, "Need to bundle at least one asset");
        require(length <= type(uint256).max - _nonce, "Bundler out of capacity");

        bundleId = ++_id;
        uint256 _bundleNonce = _nonce;
        unchecked { _nonce += length; }

        for (uint i; i < length;) {
            unchecked { ++_bundleNonce; }

            _tokens[_bundleNonce] = _assets[i];
            _bundles[bundleId].push(_bundleNonce);

            _assets[i].transferAssetFrom(msg.sender, address(this));

            unchecked { ++i; }
        }

        _mint(msg.sender, bundleId, 1, "");

        emit BundleCreated(bundleId, msg.sender);
    }

    /**
     * @dev See {ITokenBundler-unwrap}.
     */
    function unwrap(uint256 _bundleId) override external {
        require(balanceOf(msg.sender, _bundleId) == 1, "Sender is not bundle owner");

        uint256[] memory tokenList = _bundles[_bundleId];

        uint256 length = tokenList.length;
        for (uint i; i < length;) {
            _tokens[tokenList[i]].transferAsset(msg.sender);
            delete _tokens[tokenList[i]];

            unchecked { ++i; }
        }

        delete _bundles[_bundleId];

        _burn(msg.sender, _bundleId, 1);

        emit BundleUnwrapped(_bundleId);
    }

    /**
     * @dev See {ITokenBundler-token}.
     */
    function token(uint256 _tokenId) override external view returns (MultiToken.Asset memory) {
        return _tokens[_tokenId];
    }

    /**
     * @dev See {ITokenBundler-bundle}.
     */
    function bundle(uint256 _bundleId) override external view returns (uint256[] memory) {
        return _bundles[_bundleId];
    }

    /**
     * @dev See {ITokenBundler-tokensInBundle}.
     */
    function tokensInBundle(uint256 _bundleId) override external view returns (MultiToken.Asset[] memory) {
        uint256[] memory tokenList = _bundles[_bundleId];
        uint256 length = tokenList.length;

        MultiToken.Asset[] memory tokens = new MultiToken.Asset[](length);

        for (uint256 i; i < length;) {
            tokens[i] = _tokens[tokenList[i]];

            unchecked { ++i; }
        }

        return tokens;
    }

    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     */
    function onERC721Received(
        address operator,
        address /*from*/,
        uint256 /*tokenId*/,
        bytes calldata /*data*/
    ) override external view returns (bytes4) {
        require(operator == address(this), "Unsupported transfer function");
        return IERC721Receiver.onERC721Received.selector;
    }

    /**
     * @dev See {IERC1155Receiver-onERC1155Received}.
     */
    function onERC1155Received(
        address operator,
        address /*from*/,
        uint256 /*id*/,
        uint256 /*value*/,
        bytes calldata /*data*/
    ) override external view returns (bytes4) {
        require(operator == address(this), "Unsupported transfer function");
        return 0xf23a6e61;
    }

    /**
     * @dev See {IERC1155Receiver-onERC1155BatchReceived}.
     */
    function onERC1155BatchReceived(
        address /*operator*/,
        address /*from*/,
        uint256[] calldata /*ids*/,
        uint256[] calldata /*values*/,
        bytes calldata /*data*/
    ) override external pure returns (bytes4) {
        revert("Unsupported transfer function");
    }

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

    /**
     * setUri
     * @dev An non-essential setup function. Can be called to adjust the bundler token metadata URI
     * @param _newUri setting the new origin of bundler metadata
     */
    function setUri(string memory _newUri) external onlyOwner {
        _setURI(_newUri);
    }

}

File 2 of 19 : MultiToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "openzeppelin-contracts/contracts/interfaces/IERC20.sol";
import "openzeppelin-contracts/contracts/interfaces/IERC721.sol";
import "openzeppelin-contracts/contracts/interfaces/IERC1155.sol";
import "openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol";


library MultiToken {

    /**
     * @title Category
     * @dev enum representation Asset category
     */
    enum Category {
        ERC20,
        ERC721,
        ERC1155
    }

    /**
     * @title Asset
     * @param category Corresponding asset category
     * @param assetAddress Address of the token contract defining the asset
     * @param id TokenID of an NFT or 0
     * @param amount Amount of fungible tokens or 0 -> 1
     */
    struct Asset {
        Category category;
        address assetAddress;
        uint256 id;
        uint256 amount;
    }


    /*----------------------------------------------------------*|
    |*  # TRANSFER ASSET                                        *|
    |*----------------------------------------------------------*/

    /**
     * transferAsset
     * @dev wrapping function for transfer calls on various token interfaces
     * @param _asset Struct defining all necessary context of a token
     * @param _dest Destination address
     */
    function transferAsset(Asset memory _asset, address _dest) internal {
        _transferAssetFrom(_asset, address(this), _dest);
    }

    /**
     * transferAssetFrom
     * @dev wrapping function for transferFrom calls on various token interfaces
     * @param _asset Struct defining all necessary context of a token
     * @param _source Account/address that provided the allowance
     * @param _dest Destination address
     */
    function transferAssetFrom(Asset memory _asset, address _source, address _dest) internal {
        _transferAssetFrom(_asset, _source, _dest);
    }

    function _transferAssetFrom(Asset memory _asset, address _source, address _dest) private {
        if (_asset.category == Category.ERC20) {
            if (_source == address(this))
                require(IERC20(_asset.assetAddress).transfer(_dest, _asset.amount), "MultiToken: ERC20 transfer failed");
            else
                require(IERC20(_asset.assetAddress).transferFrom(_source, _dest, _asset.amount), "MultiToken: ERC20 transferFrom failed");

        } else if (_asset.category == Category.ERC721) {
            IERC721(_asset.assetAddress).safeTransferFrom(_source, _dest, _asset.id);

        } else if (_asset.category == Category.ERC1155) {
            IERC1155(_asset.assetAddress).safeTransferFrom(_source, _dest, _asset.id, _asset.amount == 0 ? 1 : _asset.amount, "");

        } else {
            revert("MultiToken: Unsupported category");
        }
    }


    /*----------------------------------------------------------*|
    |*  # TRANSFER ASSET CALLDATA                               *|
    |*----------------------------------------------------------*/

    /**
     * transferAssetCalldata
     * @dev wrapping function for transfer calldata on various token interfaces
     * @param _asset Struct defining all necessary context of a token
     * @param _source Account/address that should initiate the transfer
     * @param _dest Destination address
     */
    function transferAssetCalldata(Asset memory _asset, address _source, address _dest) pure internal returns (bytes memory) {
        return _transferAssetFromCalldata(true, _asset, _source, _dest);
    }

    /**
     * transferAssetFromCalldata
     * @dev wrapping function for transferFrom calladata on various token interfaces
     * @param _asset Struct defining all necessary context of a token
     * @param _source Account/address that provided the allowance
     * @param _dest Destination address
     */
    function transferAssetFromCalldata(Asset memory _asset, address _source, address _dest) pure internal returns (bytes memory) {
        return _transferAssetFromCalldata(false, _asset, _source, _dest);
    }

    function _transferAssetFromCalldata(bool fromSender, Asset memory _asset, address _source, address _dest) pure private returns (bytes memory) {
        if (_asset.category == Category.ERC20) {
            if (fromSender) {
                return abi.encodeWithSelector(
                    IERC20.transfer.selector,
                    _dest, _asset.amount
                );
            } else {
                return abi.encodeWithSelector(
                    IERC20.transferFrom.selector,
                    _source, _dest, _asset.amount
                );
            }
        } else if (_asset.category == Category.ERC721) {
            return abi.encodeWithSignature(
                "safeTransferFrom(address,address,uint256)",
                _source, _dest, _asset.id
            );

        } else if (_asset.category == Category.ERC1155) {
            return abi.encodeWithSelector(
                IERC1155.safeTransferFrom.selector,
                _source, _dest, _asset.id, _asset.amount == 0 ? 1 : _asset.amount, ""
            );


        } else {
            revert("MultiToken: Unsupported category");
        }
    }


    /*----------------------------------------------------------*|
    |*  # PERMIT                                                *|
    |*----------------------------------------------------------*/

    /**
     * permit
     * @dev wrapping function for granting approval via permit signature
     * @param _asset Struct defining all necessary context of a token
     * @param _owner Account/address that signed the permit
     * @param _spender Account/address that would be granted approval to `_asset`
     * @param _permit Data about permit deadline (uint256) and permit signature (64/65 bytes).
     * Deadline and signature should be pack encoded together.
     * Signature can be standard (65 bytes) or compact (64 bytes) defined in EIP-2098.
     */
    function permit(Asset memory _asset, address _owner, address _spender, bytes memory _permit) internal {
        if (_asset.category == Category.ERC20) {

            // Parse deadline and permit signature parameters
            uint256 deadline;
            bytes32 r;
            bytes32 s;
            uint8 v;

            // Parsing signature parameters used from OpenZeppelins ECDSA library
            // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/83277ff916ac4f58fec072b8f28a252c1245c2f1/contracts/utils/cryptography/ECDSA.sol

            // Deadline (32 bytes) + standard signature data (65 bytes) -> 97 bytes
            if (_permit.length == 97) {
                assembly {
                    deadline := mload(add(_permit, 0x20))
                    r := mload(add(_permit, 0x40))
                    s := mload(add(_permit, 0x60))
                    v := byte(0, mload(add(_permit, 0x80)))
                }
            }
            // Deadline (32 bytes) + compact signature data (64 bytes) -> 96 bytes
            else if (_permit.length == 96) {
                bytes32 vs;

                assembly {
                    deadline := mload(add(_permit, 0x20))
                    r := mload(add(_permit, 0x40))
                    vs := mload(add(_permit, 0x60))
                }

                s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
                v = uint8((uint256(vs) >> 255) + 27);
            } else {
                revert("MultiToken::Permit: Invalid permit length");
            }

            // Call permit with parsed parameters
            IERC20Permit(_asset.assetAddress).permit(_owner, _spender, _asset.amount, deadline, v, r, s);

        } else {
            // Currently supporting only ERC20 signed approvals via ERC2612
            revert("MultiToken::Permit: Unsupported category");
        }
    }


    /*----------------------------------------------------------*|
    |*  # BALANCE OF                                            *|
    |*----------------------------------------------------------*/

    /**
     * balanceOf
     * @dev wrapping function for checking balances on various token interfaces
     * @param _asset Struct defining all necessary context of a token
     * @param _target Target address to be checked
     */
    function balanceOf(Asset memory _asset, address _target) internal view returns (uint256) {
        if (_asset.category == Category.ERC20) {
            return IERC20(_asset.assetAddress).balanceOf(_target);

        } else if (_asset.category == Category.ERC721) {
            if (IERC721(_asset.assetAddress).ownerOf(_asset.id) == _target) {
                return 1;
            } else {
                return 0;
            }

        } else if (_asset.category == Category.ERC1155) {
            return IERC1155(_asset.assetAddress).balanceOf(_target, _asset.id);

        } else {
            revert("MultiToken: Unsupported category");
        }
    }


    /*----------------------------------------------------------*|
    |*  # APPROVE ASSET                                         *|
    |*----------------------------------------------------------*/

    /**
     * approveAsset
     * @dev wrapping function for approve calls on various token interfaces
     * @param _asset Struct defining all necessary context of a token
     * @param _target Account/address that would be granted approval to `_asset`
     */
    function approveAsset(Asset memory _asset, address _target) internal {
        if (_asset.category == Category.ERC20) {
            IERC20(_asset.assetAddress).approve(_target, _asset.amount);

        } else if (_asset.category == Category.ERC721) {
            IERC721(_asset.assetAddress).approve(_target, _asset.id);

        } else if (_asset.category == Category.ERC1155) {
            IERC1155(_asset.assetAddress).setApprovalForAll(_target, true);

        } else {
            revert("MultiToken: Unsupported category");
        }
    }


    /*----------------------------------------------------------*|
    |*  # ASSET CHECKS                                          *|
    |*----------------------------------------------------------*/

    /**
     * isValid
     * @dev checks that assets amount and id is valid in stated category
     * @dev this function don't check that stated category is indeed the category of a contract on a stated address
     * @param _asset Asset that is examined
     * @return True if assets amount and id is valid in stated category
     */
    function isValid(Asset memory _asset) internal pure returns (bool) {
        // ERC20 token has to have id set to 0
        if (_asset.category == Category.ERC20 && _asset.id != 0)
            return false;

        // ERC721 token has to have amount set to 1
        if (_asset.category == Category.ERC721 && _asset.amount != 1)
            return false;

        // Any categories have to have non-zero amount
        if (_asset.amount == 0)
            return false;

        return true;
    }

    /**
     * isSameAs
     * @dev compare two assets, ignoring their amounts
     * @param _asset First asset to examine
     * @param _otherAsset Second asset to examine
     * @return True if both structs represents the same asset
     */
    function isSameAs(Asset memory _asset, Asset memory _otherAsset) internal pure returns (bool) {
        return
            _asset.category == _otherAsset.category &&
            _asset.assetAddress == _otherAsset.assetAddress &&
            _asset.id == _otherAsset.id;
    }
}

File 3 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * 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 Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _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);
    }
}

File 4 of 19 : IERC721Receiver.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 IERC721Receiver {
    /**
     * @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 5 of 19 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: address zero is not a valid owner");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @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, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 6 of 19 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 7 of 19 : ITokenBundler.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "MultiToken/MultiToken.sol";

interface ITokenBundler {

    /**
     * BundleCreated
     * @dev Emitted when new bundle is created.
     */
    event BundleCreated(uint256 indexed id, address indexed creator);

    /**
     * BundleUnwrapped
     * @dev Emitted when bundle is unwrapped and burned.
     */
    event BundleUnwrapped(uint256 indexed id);

    /**
     * create
     * @dev Cannot create empty bundle or exceed maximum bundle size.
     * @dev Mint bundle token and transfers assets to Bundler contract.
     * @dev Emits a {BundleCreated} event.
     * @param _assets List of assets to include in a bundle
     * @return Bundle id
     */
    function create(MultiToken.Asset[] memory _assets) external returns (uint256);

    /**
     * unwrap
     * @dev Sender has to be a bundle owner.
     * @dev Burns bundle token and transfers assets to sender.
     * @dev Emits a {BundleUnwrapped} event.
     * @param _bundleId Bundle id to unwrap
     */
    function unwrap(uint256 _bundleId) external;

    /**
     * token
     * @param _tokenId Token nounce from bundle asset list.
     * @return MultiToken.Asset struct
     */
    function token(uint256 _tokenId) external view returns (MultiToken.Asset memory);

    /**
     * bundle
     * @param _bundleId Bundle id.
     * @return List of assets in a bundle.
     */
    function bundle(uint256 _bundleId) external view returns (uint256[] memory);

    /**
     * tokensInBundle
     * @param _bundleId Bundle id.
     * @return List of MultiToken.Asset structs in a bundle.
     */
    function tokensInBundle(uint256 _bundleId) external view returns (MultiToken.Asset[] memory);

}

File 8 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 9 of 19 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 10 of 19 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol)

pragma solidity ^0.8.0;

import "../token/ERC1155/IERC1155.sol";

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

pragma solidity ^0.8.0;

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

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

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

File 12 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 13 of 19 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 14 of 19 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.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 ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 17 of 19 : IERC165.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 IERC165 {
    /**
     * @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 18 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"creator","type":"address"}],"name":"BundleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"BundleUnwrapped","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":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bundleId","type":"uint256"}],"name":"bundle","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum MultiToken.Category","name":"category","type":"uint8"},{"internalType":"address","name":"assetAddress","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct MultiToken.Asset[]","name":"_assets","type":"tuple[]"}],"name":"create","outputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"string","name":"_newUri","type":"string"}],"name":"setUri","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":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"token","outputs":[{"components":[{"internalType":"enum MultiToken.Category","name":"category","type":"uint8"},{"internalType":"address","name":"assetAddress","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct MultiToken.Asset","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bundleId","type":"uint256"}],"name":"tokensInBundle","outputs":[{"components":[{"internalType":"enum MultiToken.Category","name":"category","type":"uint8"},{"internalType":"address","name":"assetAddress","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct MultiToken.Asset[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bundleId","type":"uint256"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162002d5638038062002d568339810160408190526200003491620000cb565b80620000403362000053565b6200004b81620000a3565b5050620002fb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6003620000b182826200022f565b5050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215620000df57600080fd5b82516001600160401b0380821115620000f757600080fd5b818501915085601f8301126200010c57600080fd5b815181811115620001215762000121620000b5565b604051601f8201601f19908116603f011681019083821181831017156200014c576200014c620000b5565b8160405282815288868487010111156200016557600080fd5b600093505b828410156200018957848401860151818501870152928501926200016a565b600086848301015280965050505050505092915050565b600181811c90821680620001b557607f821691505b602082108103620001d657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200022a57600081815260208120601f850160051c81016020861015620002055750805b601f850160051c820191505b81811015620002265782815560010162000211565b5050505b505050565b81516001600160401b038111156200024b576200024b620000b5565b62000263816200025c8454620001a0565b84620001dc565b602080601f8311600181146200029b5760008415620002825750858301515b600019600386901b1c1916600185901b17855562000226565b600085815260208120601f198616915b82811015620002cc57888601518255948401946001909101908401620002ab565b5085821015620002eb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612a4b806200030b6000396000f3fe608060405234801561001057600080fd5b506004361061012b5760003560e01c80638da5cb5b116100ad578063de0e9a3e11610071578063de0e9a3e146102bc578063e985e9c5146102cf578063f23a6e611461030b578063f242432a1461031e578063f2fde38b1461033157600080fd5b80638da5cb5b146102555780639b642de114610270578063a22cb46514610283578063bc197c8114610296578063bef9ed3e146102a957600080fd5b8063150b7a02116100f4578063150b7a02146101d95780632eb2c2d6146102055780634ab815801461021a5780634e1273f41461023a578063715018a61461024d57600080fd5b8062fdd58e1461013057806301ffc9a714610156578063044215c6146101795780630e89341c1461019957806313578f26146101b9575b600080fd5b61014361013e366004611c41565b610344565b6040519081526020015b60405180910390f35b610169610164366004611c81565b6103df565b604051901515815260200161014d565b61018c610187366004611ca5565b61043a565b60405161014d9190611d1e565b6101ac6101a7366004611ca5565b6104d3565b60405161014d9190611d72565b6101cc6101c7366004611ca5565b610567565b60405161014d9190611dc0565b6101ec6101e7366004611e1b565b6105c8565b6040516001600160e01b0319909116815260200161014d565b610218610213366004612001565b610604565b005b61022d610228366004611ca5565b610650565b60405161014d91906120aa565b6101cc6102483660046120f8565b6107f5565b61021861091e565b6000546040516001600160a01b03909116815260200161014d565b61021861027e3660046121c2565b610932565b610218610291366004612220565b610946565b6101ec6102a436600461229b565b610955565b6101436102b7366004612355565b61096f565b6102186102ca366004611ca5565b610b97565b6101696102dd366004612441565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6101ec610319366004612474565b610daa565b61021861032c3660046124eb565b610de7565b61021861033f36600461254f565b610e2c565b60006001600160a01b0383166103b45760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526001602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216630271189760e51b148061041057506001600160e01b03198216630a85bd0160e11b145b8061042b57506001600160e01b031982166301ead7c360e51b145b806103d957506103d982610ea2565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260076020526040908190208151608081019092528054829060ff16600281111561048f5761048f611cbe565b60028111156104a0576104a0611cbe565b8152815461010090046001600160a01b031660208201526001820154604082015260029091015460609091015292915050565b6060600380546104e29061256a565b80601f016020809104026020016040519081016040528092919081815260200182805461050e9061256a565b801561055b5780601f106105305761010080835404028352916020019161055b565b820191906000526020600020905b81548152906001019060200180831161053e57829003601f168201915b50505050509050919050565b60008181526006602090815260409182902080548351818402810184019094528084526060939283018282801561055b57602002820191906000526020600020905b8154815260200190600101908083116105a95750505050509050919050565b60006001600160a01b03861630146105f25760405162461bcd60e51b81526004016103ab906125a4565b50630a85bd0160e11b95945050505050565b6001600160a01b038516331480610620575061062085336102dd565b61063c5760405162461bcd60e51b81526004016103ab906125db565b6106498585858585610ef2565b5050505050565b60008181526006602090815260408083208054825181850281018501909352808352606094938301828280156106a557602002820191906000526020600020905b815481526020019060010190808311610691575b505050505090506000815190506000816001600160401b038111156106cc576106cc611e89565b60405190808252806020026020018201604052801561071e57816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816106ea5790505b50905060005b828110156107ec57600760008583815181106107425761074261262a565b602002602001015181526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff16600281111561078757610787611cbe565b600281111561079857610798611cbe565b8152815461010090046001600160a01b031660208201526001820154604082015260029091015460609091015282518390839081106107d9576107d961262a565b6020908102919091010152600101610724565b50949350505050565b6060815183511461085a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016103ab565b600083516001600160401b0381111561087557610875611e89565b60405190808252806020026020018201604052801561089e578160200160208202803683370190505b50905060005b8451811015610916576108e98582815181106108c2576108c261262a565b60200260200101518583815181106108dc576108dc61262a565b6020026020010151610344565b8282815181106108fb576108fb61262a565b602090810291909101015261090f81612656565b90506108a4565b509392505050565b6109266110d2565b610930600061112c565b565b61093a6110d2565b6109438161117c565b50565b610951338383611188565b5050565b600060405162461bcd60e51b81526004016103ab906125a4565b8051600090806109cb5760405162461bcd60e51b815260206004820152602160248201527f4e65656420746f2062756e646c65206174206c65617374206f6e6520617373656044820152601d60fa1b60648201526084016103ab565b6005546109da9060001961266f565b811115610a295760405162461bcd60e51b815260206004820152601760248201527f42756e646c6572206f7574206f6620636170616369747900000000000000000060448201526064016103ab565b600460008154610a3890612656565b91829055506005805483810190915590925060005b82811015610b4657816001019150848181518110610a6d57610a6d61262a565b60209081029190910181015160008481526007909252604090912081518154829060ff19166001836002811115610aa657610aa6611cbe565b021790555060208281015182546001600160a01b0390911661010002610100600160a81b03199091161782556040808401516001808501919091556060909401516002909301929092556000878152600682529182208054938401815582529020018290558451610b3e9033903090889085908110610b2757610b2761262a565b60200260200101516112689092919063ffffffff16565b600101610a4d565b50610b633384600160405180602001604052806000815250611278565b604051339084907f70840306de89dda231cb16a2feaa0e2a8dbff922cd2500962c55607b4f339b7690600090a35050919050565b610ba13382610344565b600114610bf05760405162461bcd60e51b815260206004820152601a60248201527f53656e646572206973206e6f742062756e646c65206f776e657200000000000060448201526064016103ab565b600081815260066020908152604080832080548251818502810185019093528083529192909190830182828015610c4657602002820191906000526020600020905b815481526020019060010190808311610c32575b505083519394506000925050505b81811015610d5657610cff3360076000868581518110610c7657610c7661262a565b602002602001015181526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff166002811115610cbb57610cbb611cbe565b6002811115610ccc57610ccc611cbe565b8152815461010090046001600160a01b03166020820152600182015460408201526002909101546060909101529061138e565b60076000848381518110610d1557610d1561262a565b6020908102919091018101518252810191909152604001600090812080546001600160a81b0319168155600180820183905560029091019190915501610c54565b506000838152600660205260408120610d6e91611bf3565b610d7a33846001611399565b60405183907f083b7f60229c363199299fbd24e0c26e19121ff62b346c18f9b68a755c60267790600090a2505050565b60006001600160a01b0387163014610dd45760405162461bcd60e51b81526004016103ab906125a4565b5063f23a6e6160e01b9695505050505050565b6001600160a01b038516331480610e035750610e0385336102dd565b610e1f5760405162461bcd60e51b81526004016103ab906125db565b6106498585858585611518565b610e346110d2565b6001600160a01b038116610e995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ab565b6109438161112c565b60006001600160e01b03198216636cdb3d1360e11b1480610ed357506001600160e01b031982166303a24d0760e21b145b806103d957506301ffc9a760e01b6001600160e01b03198316146103d9565b8151835114610f545760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016103ab565b6001600160a01b038416610f7a5760405162461bcd60e51b81526004016103ab90612682565b3360005b8451811015611064576000858281518110610f9b57610f9b61262a565b602002602001015190506000858381518110610fb957610fb961262a565b60209081029190910181015160008481526001835260408082206001600160a01b038e16835290935291909120549091508181101561100a5760405162461bcd60e51b81526004016103ab906126c7565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611049908490612711565b925050819055505050508061105d90612656565b9050610f7e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516110b4929190612724565b60405180910390a46110ca818787878787611646565b505050505050565b6000546001600160a01b031633146109305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ab565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60036109518282612798565b816001600160a01b0316836001600160a01b0316036111fb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016103ab565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6112738383836117a1565b505050565b6001600160a01b0384166112d85760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016103ab565b3360006112e485611aed565b905060006112f185611aed565b905060008681526001602090815260408083206001600160a01b038b16845290915281208054879290611325908490612711565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461138583600089898989611b38565b50505050505050565b6109518230836117a1565b6001600160a01b0383166113fb5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016103ab565b33600061140784611aed565b9050600061141484611aed565b6040805160208082018352600091829052888252600181528282206001600160a01b038b168352905220549091508481101561149e5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016103ab565b60008681526001602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611385565b6001600160a01b03841661153e5760405162461bcd60e51b81526004016103ab90612682565b33600061154a85611aed565b9050600061155785611aed565b905060008681526001602090815260408083206001600160a01b038c1684529091529020548581101561159c5760405162461bcd60e51b81526004016103ab906126c7565b60008781526001602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906115db908490612711565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461163b848a8a8a8a8a611b38565b505050505050505050565b6001600160a01b0384163b156110ca5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061168a9089908990889088908890600401612857565b6020604051808303816000875af19250505080156116c5575060408051601f3d908101601f191682019092526116c2918101906128a9565b60015b611771576116d16128c6565b806308c379a00361170a57506116e56128e2565b806116f0575061170c565b8060405162461bcd60e51b81526004016103ab9190611d72565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016103ab565b6001600160e01b0319811663bc197c8160e01b146113855760405162461bcd60e51b81526004016103ab9061296b565b6000835160028111156117b6576117b6611cbe565b0361197f57306001600160a01b0383160361189f576020830151606084015160405163a9059cbb60e01b81526001600160a01b038481166004830152602482019290925291169063a9059cbb906044016020604051808303816000875af1158015611825573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184991906129b3565b6112735760405162461bcd60e51b815260206004820152602160248201527f4d756c7469546f6b656e3a204552433230207472616e73666572206661696c656044820152601960fa1b60648201526084016103ab565b602083015160608401516040516323b872dd60e01b81526001600160a01b038581166004830152848116602483015260448201929092529116906323b872dd906064016020604051808303816000875af1158015611901573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192591906129b3565b6112735760405162461bcd60e51b815260206004820152602560248201527f4d756c7469546f6b656e3a204552433230207472616e7366657246726f6d2066604482015264185a5b195960da1b60648201526084016103ab565b60018351600281111561199457611994611cbe565b03611a0b5760208301516040808501519051632142170760e11b81526001600160a01b038581166004830152848116602483015260448201929092529116906342842e0e906064015b600060405180830381600087803b1580156119f757600080fd5b505af1158015611385573d6000803e3d6000fd5b600283516002811115611a2057611a20611cbe565b03611aa55782602001516001600160a01b031663f242432a838386604001518760600151600014611a55578760600151611a58565b60015b6040516001600160e01b031960e087901b1681526001600160a01b0394851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c4016119dd565b60405162461bcd60e51b815260206004820181905260248201527f4d756c7469546f6b656e3a20556e737570706f727465642063617465676f727960448201526064016103ab565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611b2757611b2761262a565b602090810291909101015292915050565b6001600160a01b0384163b156110ca5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611b7c90899089908890889088906004016129d0565b6020604051808303816000875af1925050508015611bb7575060408051601f3d908101601f19168201909252611bb4918101906128a9565b60015b611bc3576116d16128c6565b6001600160e01b0319811663f23a6e6160e01b146113855760405162461bcd60e51b81526004016103ab9061296b565b508054600082559060005260206000209081019061094391905b80821115611c215760008155600101611c0d565b5090565b80356001600160a01b0381168114611c3c57600080fd5b919050565b60008060408385031215611c5457600080fd5b611c5d83611c25565b946020939093013593505050565b6001600160e01b03198116811461094357600080fd5b600060208284031215611c9357600080fd5b8135611c9e81611c6b565b9392505050565b600060208284031215611cb757600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b805160038110611cf457634e487b7160e01b600052602160045260246000fd5b82526020818101516001600160a01b03169083015260408082015190830152606090810151910152565b608081016103d98284611cd4565b6000815180845260005b81811015611d5257602081850181015186830182015201611d36565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611c9e6020830184611d2c565b600081518084526020808501945080840160005b83811015611db557815187529582019590820190600101611d99565b509495945050505050565b602081526000611c9e6020830184611d85565b60008083601f840112611de557600080fd5b5081356001600160401b03811115611dfc57600080fd5b602083019150836020828501011115611e1457600080fd5b9250929050565b600080600080600060808688031215611e3357600080fd5b611e3c86611c25565b9450611e4a60208701611c25565b93506040860135925060608601356001600160401b03811115611e6c57600080fd5b611e7888828901611dd3565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b608081018181106001600160401b0382111715611ebe57611ebe611e89565b60405250565b601f8201601f191681016001600160401b0381118282101715611ee957611ee9611e89565b6040525050565b60006001600160401b03821115611f0957611f09611e89565b5060051b60200190565b600082601f830112611f2457600080fd5b81356020611f3182611ef0565b604051611f3e8282611ec4565b83815260059390931b8501820192828101915086841115611f5e57600080fd5b8286015b84811015611f795780358352918301918301611f62565b509695505050505050565b60006001600160401b03831115611f9d57611f9d611e89565b604051611fb4601f8501601f191660200182611ec4565b809150838152848484011115611fc957600080fd5b83836020830137600060208583010152509392505050565b600082601f830112611ff257600080fd5b611c9e83833560208501611f84565b600080600080600060a0868803121561201957600080fd5b61202286611c25565b945061203060208701611c25565b935060408601356001600160401b038082111561204c57600080fd5b61205889838a01611f13565b9450606088013591508082111561206e57600080fd5b61207a89838a01611f13565b9350608088013591508082111561209057600080fd5b5061209d88828901611fe1565b9150509295509295909350565b6020808252825182820181905260009190848201906040850190845b818110156120ec576120d9838551611cd4565b92840192608092909201916001016120c6565b50909695505050505050565b6000806040838503121561210b57600080fd5b82356001600160401b038082111561212257600080fd5b818501915085601f83011261213657600080fd5b8135602061214382611ef0565b6040516121508282611ec4565b83815260059390931b850182019282810191508984111561217057600080fd5b948201945b838610156121955761218686611c25565b82529482019490820190612175565b965050860135925050808211156121ab57600080fd5b506121b885828601611f13565b9150509250929050565b6000602082840312156121d457600080fd5b81356001600160401b038111156121ea57600080fd5b8201601f810184136121fb57600080fd5b61220a84823560208401611f84565b949350505050565b801515811461094357600080fd5b6000806040838503121561223357600080fd5b61223c83611c25565b9150602083013561224c81612212565b809150509250929050565b60008083601f84011261226957600080fd5b5081356001600160401b0381111561228057600080fd5b6020830191508360208260051b8501011115611e1457600080fd5b60008060008060008060008060a0898b0312156122b757600080fd5b6122c089611c25565b97506122ce60208a01611c25565b965060408901356001600160401b03808211156122ea57600080fd5b6122f68c838d01612257565b909850965060608b013591508082111561230f57600080fd5b61231b8c838d01612257565b909650945060808b013591508082111561233457600080fd5b506123418b828c01611dd3565b999c989b5096995094979396929594505050565b6000602080838503121561236857600080fd5b82356001600160401b0381111561237e57600080fd5b8301601f8101851361238f57600080fd5b803561239a81611ef0565b604080516123a88382611ec4565b83815260079390931b84018501928581019250888411156123c857600080fd5b938501935b83851015612435576080858a0312156123e65760008081fd5b81516123f181611e9f565b8535600381106124015760008081fd5b815261240e868801611c25565b818801528583013583820152606080870135908201528352608090940193918501916123cd565b98975050505050505050565b6000806040838503121561245457600080fd5b61245d83611c25565b915061246b60208401611c25565b90509250929050565b60008060008060008060a0878903121561248d57600080fd5b61249687611c25565b95506124a460208801611c25565b9450604087013593506060870135925060808701356001600160401b038111156124cd57600080fd5b6124d989828a01611dd3565b979a9699509497509295939492505050565b600080600080600060a0868803121561250357600080fd5b61250c86611c25565b945061251a60208701611c25565b9350604086013592506060860135915060808601356001600160401b0381111561254357600080fd5b61209d88828901611fe1565b60006020828403121561256157600080fd5b611c9e82611c25565b600181811c9082168061257e57607f821691505b60208210810361259e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601d908201527f556e737570706f72746564207472616e736665722066756e6374696f6e000000604082015260600190565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161266857612668612640565b5060010190565b818103818111156103d9576103d9612640565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156103d9576103d9612640565b6040815260006127376040830185611d85565b82810360208401526127498185611d85565b95945050505050565b601f82111561127357600081815260208120601f850160051c810160208610156127795750805b601f850160051c820191505b818110156110ca57828155600101612785565b81516001600160401b038111156127b1576127b1611e89565b6127c5816127bf845461256a565b84612752565b602080601f8311600181146127fa57600084156127e25750858301515b600019600386901b1c1916600185901b1785556110ca565b600085815260208120601f198616915b828110156128295788860151825594840194600190910190840161280a565b50858210156128475787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0386811682528516602082015260a06040820181905260009061288390830186611d85565b82810360608401526128958186611d85565b905082810360808401526124358185611d2c565b6000602082840312156128bb57600080fd5b8151611c9e81611c6b565b600060033d11156128df5760046000803e5060005160e01c5b90565b600060443d10156128f05790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561291f57505050505090565b82850191508151818111156129375750505050505090565b843d87010160208285010111156129515750505050505090565b61296060208286010187611ec4565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6000602082840312156129c557600080fd5b8151611c9e81612212565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612a0a90830184611d2c565b97965050505050505056fea26469706673582212205db1df55d77be143753a029f6d1b244d87c52d52c613897e3a5d61bc1879bbc864736f6c634300081000330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005568747470733a2f2f6170692e70776e2e78797a2f62756e646c652f312f3078313965333239333139366165653939626233303830663238623964336234656137663233326238642f7b69647d2f6d657461646174610000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061012b5760003560e01c80638da5cb5b116100ad578063de0e9a3e11610071578063de0e9a3e146102bc578063e985e9c5146102cf578063f23a6e611461030b578063f242432a1461031e578063f2fde38b1461033157600080fd5b80638da5cb5b146102555780639b642de114610270578063a22cb46514610283578063bc197c8114610296578063bef9ed3e146102a957600080fd5b8063150b7a02116100f4578063150b7a02146101d95780632eb2c2d6146102055780634ab815801461021a5780634e1273f41461023a578063715018a61461024d57600080fd5b8062fdd58e1461013057806301ffc9a714610156578063044215c6146101795780630e89341c1461019957806313578f26146101b9575b600080fd5b61014361013e366004611c41565b610344565b6040519081526020015b60405180910390f35b610169610164366004611c81565b6103df565b604051901515815260200161014d565b61018c610187366004611ca5565b61043a565b60405161014d9190611d1e565b6101ac6101a7366004611ca5565b6104d3565b60405161014d9190611d72565b6101cc6101c7366004611ca5565b610567565b60405161014d9190611dc0565b6101ec6101e7366004611e1b565b6105c8565b6040516001600160e01b0319909116815260200161014d565b610218610213366004612001565b610604565b005b61022d610228366004611ca5565b610650565b60405161014d91906120aa565b6101cc6102483660046120f8565b6107f5565b61021861091e565b6000546040516001600160a01b03909116815260200161014d565b61021861027e3660046121c2565b610932565b610218610291366004612220565b610946565b6101ec6102a436600461229b565b610955565b6101436102b7366004612355565b61096f565b6102186102ca366004611ca5565b610b97565b6101696102dd366004612441565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6101ec610319366004612474565b610daa565b61021861032c3660046124eb565b610de7565b61021861033f36600461254f565b610e2c565b60006001600160a01b0383166103b45760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526001602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216630271189760e51b148061041057506001600160e01b03198216630a85bd0160e11b145b8061042b57506001600160e01b031982166301ead7c360e51b145b806103d957506103d982610ea2565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260076020526040908190208151608081019092528054829060ff16600281111561048f5761048f611cbe565b60028111156104a0576104a0611cbe565b8152815461010090046001600160a01b031660208201526001820154604082015260029091015460609091015292915050565b6060600380546104e29061256a565b80601f016020809104026020016040519081016040528092919081815260200182805461050e9061256a565b801561055b5780601f106105305761010080835404028352916020019161055b565b820191906000526020600020905b81548152906001019060200180831161053e57829003601f168201915b50505050509050919050565b60008181526006602090815260409182902080548351818402810184019094528084526060939283018282801561055b57602002820191906000526020600020905b8154815260200190600101908083116105a95750505050509050919050565b60006001600160a01b03861630146105f25760405162461bcd60e51b81526004016103ab906125a4565b50630a85bd0160e11b95945050505050565b6001600160a01b038516331480610620575061062085336102dd565b61063c5760405162461bcd60e51b81526004016103ab906125db565b6106498585858585610ef2565b5050505050565b60008181526006602090815260408083208054825181850281018501909352808352606094938301828280156106a557602002820191906000526020600020905b815481526020019060010190808311610691575b505050505090506000815190506000816001600160401b038111156106cc576106cc611e89565b60405190808252806020026020018201604052801561071e57816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816106ea5790505b50905060005b828110156107ec57600760008583815181106107425761074261262a565b602002602001015181526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff16600281111561078757610787611cbe565b600281111561079857610798611cbe565b8152815461010090046001600160a01b031660208201526001820154604082015260029091015460609091015282518390839081106107d9576107d961262a565b6020908102919091010152600101610724565b50949350505050565b6060815183511461085a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016103ab565b600083516001600160401b0381111561087557610875611e89565b60405190808252806020026020018201604052801561089e578160200160208202803683370190505b50905060005b8451811015610916576108e98582815181106108c2576108c261262a565b60200260200101518583815181106108dc576108dc61262a565b6020026020010151610344565b8282815181106108fb576108fb61262a565b602090810291909101015261090f81612656565b90506108a4565b509392505050565b6109266110d2565b610930600061112c565b565b61093a6110d2565b6109438161117c565b50565b610951338383611188565b5050565b600060405162461bcd60e51b81526004016103ab906125a4565b8051600090806109cb5760405162461bcd60e51b815260206004820152602160248201527f4e65656420746f2062756e646c65206174206c65617374206f6e6520617373656044820152601d60fa1b60648201526084016103ab565b6005546109da9060001961266f565b811115610a295760405162461bcd60e51b815260206004820152601760248201527f42756e646c6572206f7574206f6620636170616369747900000000000000000060448201526064016103ab565b600460008154610a3890612656565b91829055506005805483810190915590925060005b82811015610b4657816001019150848181518110610a6d57610a6d61262a565b60209081029190910181015160008481526007909252604090912081518154829060ff19166001836002811115610aa657610aa6611cbe565b021790555060208281015182546001600160a01b0390911661010002610100600160a81b03199091161782556040808401516001808501919091556060909401516002909301929092556000878152600682529182208054938401815582529020018290558451610b3e9033903090889085908110610b2757610b2761262a565b60200260200101516112689092919063ffffffff16565b600101610a4d565b50610b633384600160405180602001604052806000815250611278565b604051339084907f70840306de89dda231cb16a2feaa0e2a8dbff922cd2500962c55607b4f339b7690600090a35050919050565b610ba13382610344565b600114610bf05760405162461bcd60e51b815260206004820152601a60248201527f53656e646572206973206e6f742062756e646c65206f776e657200000000000060448201526064016103ab565b600081815260066020908152604080832080548251818502810185019093528083529192909190830182828015610c4657602002820191906000526020600020905b815481526020019060010190808311610c32575b505083519394506000925050505b81811015610d5657610cff3360076000868581518110610c7657610c7661262a565b602002602001015181526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff166002811115610cbb57610cbb611cbe565b6002811115610ccc57610ccc611cbe565b8152815461010090046001600160a01b03166020820152600182015460408201526002909101546060909101529061138e565b60076000848381518110610d1557610d1561262a565b6020908102919091018101518252810191909152604001600090812080546001600160a81b0319168155600180820183905560029091019190915501610c54565b506000838152600660205260408120610d6e91611bf3565b610d7a33846001611399565b60405183907f083b7f60229c363199299fbd24e0c26e19121ff62b346c18f9b68a755c60267790600090a2505050565b60006001600160a01b0387163014610dd45760405162461bcd60e51b81526004016103ab906125a4565b5063f23a6e6160e01b9695505050505050565b6001600160a01b038516331480610e035750610e0385336102dd565b610e1f5760405162461bcd60e51b81526004016103ab906125db565b6106498585858585611518565b610e346110d2565b6001600160a01b038116610e995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ab565b6109438161112c565b60006001600160e01b03198216636cdb3d1360e11b1480610ed357506001600160e01b031982166303a24d0760e21b145b806103d957506301ffc9a760e01b6001600160e01b03198316146103d9565b8151835114610f545760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016103ab565b6001600160a01b038416610f7a5760405162461bcd60e51b81526004016103ab90612682565b3360005b8451811015611064576000858281518110610f9b57610f9b61262a565b602002602001015190506000858381518110610fb957610fb961262a565b60209081029190910181015160008481526001835260408082206001600160a01b038e16835290935291909120549091508181101561100a5760405162461bcd60e51b81526004016103ab906126c7565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611049908490612711565b925050819055505050508061105d90612656565b9050610f7e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516110b4929190612724565b60405180910390a46110ca818787878787611646565b505050505050565b6000546001600160a01b031633146109305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ab565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60036109518282612798565b816001600160a01b0316836001600160a01b0316036111fb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016103ab565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6112738383836117a1565b505050565b6001600160a01b0384166112d85760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016103ab565b3360006112e485611aed565b905060006112f185611aed565b905060008681526001602090815260408083206001600160a01b038b16845290915281208054879290611325908490612711565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461138583600089898989611b38565b50505050505050565b6109518230836117a1565b6001600160a01b0383166113fb5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016103ab565b33600061140784611aed565b9050600061141484611aed565b6040805160208082018352600091829052888252600181528282206001600160a01b038b168352905220549091508481101561149e5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016103ab565b60008681526001602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611385565b6001600160a01b03841661153e5760405162461bcd60e51b81526004016103ab90612682565b33600061154a85611aed565b9050600061155785611aed565b905060008681526001602090815260408083206001600160a01b038c1684529091529020548581101561159c5760405162461bcd60e51b81526004016103ab906126c7565b60008781526001602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906115db908490612711565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461163b848a8a8a8a8a611b38565b505050505050505050565b6001600160a01b0384163b156110ca5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061168a9089908990889088908890600401612857565b6020604051808303816000875af19250505080156116c5575060408051601f3d908101601f191682019092526116c2918101906128a9565b60015b611771576116d16128c6565b806308c379a00361170a57506116e56128e2565b806116f0575061170c565b8060405162461bcd60e51b81526004016103ab9190611d72565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016103ab565b6001600160e01b0319811663bc197c8160e01b146113855760405162461bcd60e51b81526004016103ab9061296b565b6000835160028111156117b6576117b6611cbe565b0361197f57306001600160a01b0383160361189f576020830151606084015160405163a9059cbb60e01b81526001600160a01b038481166004830152602482019290925291169063a9059cbb906044016020604051808303816000875af1158015611825573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184991906129b3565b6112735760405162461bcd60e51b815260206004820152602160248201527f4d756c7469546f6b656e3a204552433230207472616e73666572206661696c656044820152601960fa1b60648201526084016103ab565b602083015160608401516040516323b872dd60e01b81526001600160a01b038581166004830152848116602483015260448201929092529116906323b872dd906064016020604051808303816000875af1158015611901573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192591906129b3565b6112735760405162461bcd60e51b815260206004820152602560248201527f4d756c7469546f6b656e3a204552433230207472616e7366657246726f6d2066604482015264185a5b195960da1b60648201526084016103ab565b60018351600281111561199457611994611cbe565b03611a0b5760208301516040808501519051632142170760e11b81526001600160a01b038581166004830152848116602483015260448201929092529116906342842e0e906064015b600060405180830381600087803b1580156119f757600080fd5b505af1158015611385573d6000803e3d6000fd5b600283516002811115611a2057611a20611cbe565b03611aa55782602001516001600160a01b031663f242432a838386604001518760600151600014611a55578760600151611a58565b60015b6040516001600160e01b031960e087901b1681526001600160a01b0394851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c4016119dd565b60405162461bcd60e51b815260206004820181905260248201527f4d756c7469546f6b656e3a20556e737570706f727465642063617465676f727960448201526064016103ab565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611b2757611b2761262a565b602090810291909101015292915050565b6001600160a01b0384163b156110ca5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611b7c90899089908890889088906004016129d0565b6020604051808303816000875af1925050508015611bb7575060408051601f3d908101601f19168201909252611bb4918101906128a9565b60015b611bc3576116d16128c6565b6001600160e01b0319811663f23a6e6160e01b146113855760405162461bcd60e51b81526004016103ab9061296b565b508054600082559060005260206000209081019061094391905b80821115611c215760008155600101611c0d565b5090565b80356001600160a01b0381168114611c3c57600080fd5b919050565b60008060408385031215611c5457600080fd5b611c5d83611c25565b946020939093013593505050565b6001600160e01b03198116811461094357600080fd5b600060208284031215611c9357600080fd5b8135611c9e81611c6b565b9392505050565b600060208284031215611cb757600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b805160038110611cf457634e487b7160e01b600052602160045260246000fd5b82526020818101516001600160a01b03169083015260408082015190830152606090810151910152565b608081016103d98284611cd4565b6000815180845260005b81811015611d5257602081850181015186830182015201611d36565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611c9e6020830184611d2c565b600081518084526020808501945080840160005b83811015611db557815187529582019590820190600101611d99565b509495945050505050565b602081526000611c9e6020830184611d85565b60008083601f840112611de557600080fd5b5081356001600160401b03811115611dfc57600080fd5b602083019150836020828501011115611e1457600080fd5b9250929050565b600080600080600060808688031215611e3357600080fd5b611e3c86611c25565b9450611e4a60208701611c25565b93506040860135925060608601356001600160401b03811115611e6c57600080fd5b611e7888828901611dd3565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b608081018181106001600160401b0382111715611ebe57611ebe611e89565b60405250565b601f8201601f191681016001600160401b0381118282101715611ee957611ee9611e89565b6040525050565b60006001600160401b03821115611f0957611f09611e89565b5060051b60200190565b600082601f830112611f2457600080fd5b81356020611f3182611ef0565b604051611f3e8282611ec4565b83815260059390931b8501820192828101915086841115611f5e57600080fd5b8286015b84811015611f795780358352918301918301611f62565b509695505050505050565b60006001600160401b03831115611f9d57611f9d611e89565b604051611fb4601f8501601f191660200182611ec4565b809150838152848484011115611fc957600080fd5b83836020830137600060208583010152509392505050565b600082601f830112611ff257600080fd5b611c9e83833560208501611f84565b600080600080600060a0868803121561201957600080fd5b61202286611c25565b945061203060208701611c25565b935060408601356001600160401b038082111561204c57600080fd5b61205889838a01611f13565b9450606088013591508082111561206e57600080fd5b61207a89838a01611f13565b9350608088013591508082111561209057600080fd5b5061209d88828901611fe1565b9150509295509295909350565b6020808252825182820181905260009190848201906040850190845b818110156120ec576120d9838551611cd4565b92840192608092909201916001016120c6565b50909695505050505050565b6000806040838503121561210b57600080fd5b82356001600160401b038082111561212257600080fd5b818501915085601f83011261213657600080fd5b8135602061214382611ef0565b6040516121508282611ec4565b83815260059390931b850182019282810191508984111561217057600080fd5b948201945b838610156121955761218686611c25565b82529482019490820190612175565b965050860135925050808211156121ab57600080fd5b506121b885828601611f13565b9150509250929050565b6000602082840312156121d457600080fd5b81356001600160401b038111156121ea57600080fd5b8201601f810184136121fb57600080fd5b61220a84823560208401611f84565b949350505050565b801515811461094357600080fd5b6000806040838503121561223357600080fd5b61223c83611c25565b9150602083013561224c81612212565b809150509250929050565b60008083601f84011261226957600080fd5b5081356001600160401b0381111561228057600080fd5b6020830191508360208260051b8501011115611e1457600080fd5b60008060008060008060008060a0898b0312156122b757600080fd5b6122c089611c25565b97506122ce60208a01611c25565b965060408901356001600160401b03808211156122ea57600080fd5b6122f68c838d01612257565b909850965060608b013591508082111561230f57600080fd5b61231b8c838d01612257565b909650945060808b013591508082111561233457600080fd5b506123418b828c01611dd3565b999c989b5096995094979396929594505050565b6000602080838503121561236857600080fd5b82356001600160401b0381111561237e57600080fd5b8301601f8101851361238f57600080fd5b803561239a81611ef0565b604080516123a88382611ec4565b83815260079390931b84018501928581019250888411156123c857600080fd5b938501935b83851015612435576080858a0312156123e65760008081fd5b81516123f181611e9f565b8535600381106124015760008081fd5b815261240e868801611c25565b818801528583013583820152606080870135908201528352608090940193918501916123cd565b98975050505050505050565b6000806040838503121561245457600080fd5b61245d83611c25565b915061246b60208401611c25565b90509250929050565b60008060008060008060a0878903121561248d57600080fd5b61249687611c25565b95506124a460208801611c25565b9450604087013593506060870135925060808701356001600160401b038111156124cd57600080fd5b6124d989828a01611dd3565b979a9699509497509295939492505050565b600080600080600060a0868803121561250357600080fd5b61250c86611c25565b945061251a60208701611c25565b9350604086013592506060860135915060808601356001600160401b0381111561254357600080fd5b61209d88828901611fe1565b60006020828403121561256157600080fd5b611c9e82611c25565b600181811c9082168061257e57607f821691505b60208210810361259e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601d908201527f556e737570706f72746564207472616e736665722066756e6374696f6e000000604082015260600190565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161266857612668612640565b5060010190565b818103818111156103d9576103d9612640565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156103d9576103d9612640565b6040815260006127376040830185611d85565b82810360208401526127498185611d85565b95945050505050565b601f82111561127357600081815260208120601f850160051c810160208610156127795750805b601f850160051c820191505b818110156110ca57828155600101612785565b81516001600160401b038111156127b1576127b1611e89565b6127c5816127bf845461256a565b84612752565b602080601f8311600181146127fa57600084156127e25750858301515b600019600386901b1c1916600185901b1785556110ca565b600085815260208120601f198616915b828110156128295788860151825594840194600190910190840161280a565b50858210156128475787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0386811682528516602082015260a06040820181905260009061288390830186611d85565b82810360608401526128958186611d85565b905082810360808401526124358185611d2c565b6000602082840312156128bb57600080fd5b8151611c9e81611c6b565b600060033d11156128df5760046000803e5060005160e01c5b90565b600060443d10156128f05790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561291f57505050505090565b82850191508151818111156129375750505050505090565b843d87010160208285010111156129515750505050505090565b61296060208286010187611ec4565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6000602082840312156129c557600080fd5b8151611c9e81612212565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612a0a90830184611d2c565b97965050505050505056fea26469706673582212205db1df55d77be143753a029f6d1b244d87c52d52c613897e3a5d61bc1879bbc864736f6c63430008100033

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005568747470733a2f2f6170692e70776e2e78797a2f62756e646c652f312f3078313965333239333139366165653939626233303830663238623964336234656137663233326238642f7b69647d2f6d657461646174610000000000000000000000

-----Decoded View---------------
Arg [0] : _uri (string): https://api.pwn.xyz/bundle/1/0x19e3293196aee99bb3080f28b9d3b4ea7f232b8d/{id}/metadata

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000055
Arg [2] : 68747470733a2f2f6170692e70776e2e78797a2f62756e646c652f312f307831
Arg [3] : 3965333239333139366165653939626233303830663238623964336234656137
Arg [4] : 663233326238642f7b69647d2f6d657461646174610000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.