Contract 0x554FFA20c7cF0A7C1B282C58Aeb1b3032bd3F6cD

Contract Overview

Balance:
0 MATIC
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x42ec770d83ac6f70bbe1504247cf4e815f4de89ffda8e99ca0bdd2b1879ab446Mint ERC1155264154342022-05-22 5:02:13259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000398677639 5.73513111
0xddf1bd5a88c73c8d333b62c02a09106e7c12a5c2a29c3f79dd36f03dab098619Deploy ERC1155264154302022-05-22 5:01:33259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.010934140073 4.910625018
0xc3a1fe61637dcb2cf242d9bd366722b8a4b261170813aa8d9ce185de5919e109Mint ERC1155264153892022-05-22 4:57:32259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000352162688 5.062500019
0x0d84e57ca2158c57cd5d66255fbadeacd7a406dbd941aaeb84075cdfc9dd4145Mint ERC1155264153872022-05-22 4:57:22259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000347635001 5.00000002
0x68a3afd251c0f7e6214e8df1788e25b813f04c7c1acff41dfee01d15bfb93ab9Deploy ERC1155264153832022-05-22 4:57:02259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.011402820041 5.000000018
0xfe25f0074c96b5844a47113254d65de4f422a83f3e9a7f83ed23a4184174a9edMint ERC1155264152312022-05-22 4:38:59259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000163516659 2.352250011
0x2983fe49bde170b4ce4dca24cd06e05e6cc8b235380fbd334f10034b7d09d8b7Deploy ERC1155264152292022-05-22 4:38:39259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.005237616316 2.352250011
0xbcd43d7771d0bf6d841ebbf66f9143be3e6b898f2ae5adeabbb9f44377200d24Mint ERC1155264152072022-05-22 4:34:59259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000163516659 2.35225001
0x27971d1e083a0642e4d2c6fcbb75c5a3432a1a190427c485fab8948f4cfde88cDeploy ERC1155264152012022-05-22 4:33:59259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.004373658021 2.00000001
0x54825f437304e67ff3900065e9fd45617236fd7882b2f73fb73624acbe7f7ca7Mint ERC1155264151452022-05-22 4:26:28259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000793049487 11.390625041
0x8c4da680d5038078b3cf17bc911316a40934533cc88333ac212cba2f462ac332Mint ERC1155264151422022-05-22 4:26:13259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000703960877 10.125000037
0xddd9eb5b1a7e4328adf99cd7819e93afa568860d2909ed07f61d044ccf62995aDeploy ERC1155264151262022-05-22 4:24:53259 days 19 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.01924246132 8.437500031
0x234bad59ddcce71ea340e8ef51b89055749ab50e4f7168a7d23c101dcfc4dcf4Mint ERC1155264071022022-05-21 13:40:15260 days 10 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000347635001 5.000000028
0x9dd42081f556c91b1c3ee12a550604658792d53f701015c2650f2d6bdd59a9dbDeploy ERC1155264070982022-05-21 13:39:35260 days 10 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.010933785063 5.000000029
0x7db39cc6c9f84951c11574226bf3e8459d264e733df975dfab2183a3fd8546c9Mint ERC1155264005472022-05-21 3:32:52260 days 20 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.001184554925 17.037336948
0x36a8e908efdd2728b006b88ea8f6d44999ddd8c6546ff5dfcde61100f2ba59f6Deploy ERC1155264005452022-05-21 3:32:42260 days 20 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.037256311384 17.037336948
0x4d7261070f515734ac7da14fdc7332fb509a8033887778ab5b8c47b2c2d06b8bMint ERC1155264002182022-05-21 3:05:19260 days 21 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000168632076 2.425000022
0x3a4ddfa89372b8727cab62417befc53d7a51766438397bdeb631282a99d4691cDeploy ERC1155264002062022-05-21 3:04:19260 days 21 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.005302798481 2.425000026
0x252df34ae44ce37c5017dd68a2dc7079c004b5417c86b355e8221405c79746d0Mint ERC1155263998202022-05-21 2:26:43260 days 21 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.000556119999 7.999999995
0x097fd315616ed19c4a2cb4d4ffe2328a5d51a6ae77197351f3d9a684a820bb8bDeploy ERC1155263998042022-05-21 2:25:07260 days 21 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd0 MATIC0.015277631198 6.809400033
0x3302209b3130d3e08a4b1528404211546295b311162179a397b3c9cd0ac6073c0x60806040263996392022-05-21 2:06:15260 days 22 hrs ago0x308513519b7005f44c76c61d20c1d2f62c49de10 IN  Create: FactoryERC11550 MATIC0.1348793640
[ Download CSV Export 
Latest 9 internal transactions
Parent Txn Hash Block From To Value
0xddf1bd5a88c73c8d333b62c02a09106e7c12a5c2a29c3f79dd36f03dab098619264154302022-05-22 5:01:33259 days 19 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x68a3afd251c0f7e6214e8df1788e25b813f04c7c1acff41dfee01d15bfb93ab9264153832022-05-22 4:57:02259 days 19 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x2983fe49bde170b4ce4dca24cd06e05e6cc8b235380fbd334f10034b7d09d8b7264152292022-05-22 4:38:39259 days 19 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x27971d1e083a0642e4d2c6fcbb75c5a3432a1a190427c485fab8948f4cfde88c264152012022-05-22 4:33:59259 days 19 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0xddd9eb5b1a7e4328adf99cd7819e93afa568860d2909ed07f61d044ccf62995a264151262022-05-22 4:24:53259 days 19 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x9dd42081f556c91b1c3ee12a550604658792d53f701015c2650f2d6bdd59a9db264070982022-05-21 13:39:35260 days 10 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x36a8e908efdd2728b006b88ea8f6d44999ddd8c6546ff5dfcde61100f2ba59f6264005452022-05-21 3:32:42260 days 20 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x3a4ddfa89372b8727cab62417befc53d7a51766438397bdeb631282a99d4691c264002062022-05-21 3:04:19260 days 21 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
0x097fd315616ed19c4a2cb4d4ffe2328a5d51a6ae77197351f3d9a684a820bb8b263998042022-05-21 2:25:07260 days 21 hrs ago 0x554ffa20c7cf0a7c1b282c58aeb1b3032bd3f6cd  Contract Creation0 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FactoryERC1155

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : FactoryERC155.sol
pragma solidity ^0.8.4;

import "./ERC1155Token.sol";

contract FactoryERC1155 {

    ERC1155Token[] public tokens; //an array that contains different ERC1155 tokens deployed
    mapping(uint256 => address) public indexToContract; //index to contract address mapping
    mapping(uint256 => address) public indexToOwner; //index to ERC1155 owner address

    event ERC1155Created(address owner, address tokenContract); //emitted when ERC1155 token is deployed
    event ERC1155Minted(address owner, address tokenContract, uint amount); //emmited when ERC1155 token is minted

    /*
    deployERC1155 - deploys a ERC1155 token with given parameters - returns deployed address

    _contractName - name of our ERC1155 token
    _uri - URI resolving to our hosted metadata
    _ids - IDs the ERC1155 token should contain
    _name - Names each ID should map to. Case-sensitive.
    */
    function deployERC1155(string memory _contractName, string memory _uri, uint[] memory _ids, string[] memory _names) public returns (address) {
        ERC1155Token t = new ERC1155Token(_contractName, _uri, _names, _ids);
        tokens.push(t);
        indexToContract[tokens.length - 1] = address(t);
        indexToOwner[tokens.length - 1] = tx.origin;
        emit ERC1155Created(msg.sender,address(t));
        return address(t);
    }

    /*
    mintERC1155 - mints a ERC1155 token with given parameters

    _index - index position in our tokens array - represents which ERC1155 you want to interact with
    _name - Case-sensitive. Name of the token (this maps to the ID you created when deploying the token)
    _amount - amount of tokens you wish to mint
    */
    function mintERC1155(uint _index, string memory _name, uint256 amount) public {

        uint id = getIdByName(_index, _name);
        tokens[_index].mint(indexToOwner[_index], id, amount);
        emit ERC1155Minted(tokens[_index].owner(), address(tokens[_index]), amount);
    }

    /*
    Helper functions below retrieve contract data given an ID or name and index in the tokens array.
    */
    function getCountERC1155byIndex(uint256 _index, uint256 _id) public view returns (uint amount) {
        return tokens[_index].balanceOf(indexToOwner[_index], _id);
    }

    function getCountERC1155byName(uint256 _index, string calldata _name) public view returns (uint amount) {
        uint id = getIdByName(_index, _name);
        return tokens[_index].balanceOf(indexToOwner[_index], id);
    }

    function getIdByName(uint _index, string memory _name) public view returns (uint) {
        return tokens[_index].nameToId(_name);
    }

    function getNameById(uint _index, uint _id) public view returns (string memory) {
        return tokens[_index].idToName(_id);
    }

    function getERC1155byIndexAndId(uint _index, uint _id)
        public
        view
        returns (
            address _contract,
            address _owner,
            string memory _uri,
            uint supply
        )
    {
        ERC1155Token token = tokens[_index];
        return (address(token), token.owner(), token.uri(_id), token.balanceOf(indexToOwner[_index], _id));
    }
}

File 2 of 12 : ERC1155Token.sol
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract ERC1155Token is ERC1155, Ownable {

    string[] public names; //string array of names
    uint[] public ids; //uint array of ids
    string public baseMetadataURI; //the token metadata URI
    string public name; //the token mame
    uint public mintFee = 0 wei; //mintfee, 0 by default. only used in mint function, not batch.
    
    mapping(string => uint) public nameToId; //name to id mapping
    mapping(uint => string) public idToName; //id to name mapping

    /*
    constructor is executed when the factory contract calls its own deployERC1155 method
    */
    constructor(string memory _contractName, string memory _uri, string[] memory _names, uint[] memory _ids) ERC1155(_uri) {
        names = _names;
        ids = _ids;
        createMapping();
        setURI(_uri);
        baseMetadataURI = _uri;
        name = _contractName;
        transferOwnership(tx.origin);
    }   

    /*
    creates a mapping of strings to ids (i.e ["one","two"], [1,2] - "one" maps to 1, vice versa.)
    */
    function createMapping() private {
        for (uint id = 0; id < ids.length; id++) {
            nameToId[names[id]] = ids[id];
            idToName[ids[id]] = names[id];
        }
    }
    /*
    sets our URI and makes the ERC1155 OpenSea compatible
    */
    function uri(uint256 _tokenid) override public view returns (string memory) {
        return string(
            abi.encodePacked(
                baseMetadataURI,
                Strings.toString(_tokenid),".json"
            )
        );
    }

    function getNames() public view returns(string[] memory) {
        return names;
    }

    /*
    used to change metadata, only owner access
    */
    function setURI(string memory newuri) public onlyOwner {
        _setURI(newuri);
    }

    /*
    set a mint fee. only used for mint, not batch.
    */
    function setFee(uint _fee) public onlyOwner {
        mintFee = _fee;
    }

    /*
    mint(address account, uint _id, uint256 amount)

    account - address to mint the token to
    _id - the ID being minted
    amount - amount of tokens to mint
    */
    function mint(address account, uint _id, uint256 amount) 
        public payable returns (uint)
    {
        require(msg.value == mintFee);
        _mint(account, _id, amount, "");
        return _id;
    }

    /*
    mintBatch(address to, uint256[] memory _ids, uint256[] memory amounts, bytes memory data)

    to - address to mint the token to
    _ids - the IDs being minted
    amounts - amount of tokens to mint given ID
    bytes - additional field to pass data to function
    */
    function mintBatch(address to, uint256[] memory _ids, uint256[] memory amounts, bytes memory data)
        public
    {
        _mintBatch(to, _ids, amounts, data);
    }
}

File 3 of 12 : 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 4 of 12 : 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 5 of 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

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

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

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

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

File 6 of 12 : 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 7 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "Address: low-level call failed");
    }

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

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

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

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

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

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

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

    /**
     * @dev 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) {
        require(isContract(target), "Address: delegate call to non-contract");

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 12 : 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 9 of 12 : 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 10 of 12 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 be 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 11 of 12 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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: balance query for the zero address");
        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 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: transfer caller is not 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}.
     *
     * 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`
     *
     * 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}.
     *
     * 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 a {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 `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 _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 12 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"tokenContract","type":"address"}],"name":"ERC1155Created","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"tokenContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC1155Minted","type":"event"},{"inputs":[{"internalType":"string","name":"_contractName","type":"string"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"string[]","name":"_names","type":"string[]"}],"name":"deployERC1155","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getCountERC1155byIndex","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"getCountERC1155byName","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getERC1155byIndexAndId","outputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"getIdByName","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getNameById","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"indexToContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"indexToOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"contract ERC1155Token","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50613c1d806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620000ab5760003560e01c806388744682116200006e5780638874468214620001515780639575feab146200017a578063ba535b8e14620001a0578063cd78aefb14620001cc578063f075239914620001f857600080fd5b806316d839e314620000b05780634f64b2be14620000da57806351c8027b146200010a5780635673f0b814620001215780637e69bc441462000138575b600080fd5b620000c7620000c136600462000e5f565b6200020f565b6040519081526020015b60405180910390f35b620000f1620000eb36600462000d16565b620002d9565b6040516001600160a01b039091168152602001620000d1565b620000c76200011b36600462000d48565b62000304565b620000f16200013236600462000c05565b62000415565b6200014f6200014936600462000e0d565b62000574565b005b620001686200016236600462000e5f565b6200077a565b604051620000d1949392919062000eeb565b620001916200018b36600462000e5f565b6200095e565b604051620000d1919062000f2a565b620000f1620001b136600462000d16565b6001602052600090815260409020546001600160a01b031681565b620000f1620001dd36600462000d16565b6002602052600090815260409020546001600160a01b031681565b620000c76200020936600462000dc4565b62000a0f565b60008083815481106200023257634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101548583526002909152604091829020549151627eeac760e11b81526001600160a01b0392831660048201526024810185905291169062fdd58e906044015b60206040518083038186803b1580156200029757600080fd5b505afa158015620002ac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002d2919062000d2f565b9392505050565b60008181548110620002ea57600080fd5b6000918252602090912001546001600160a01b0316905081565b600080620003498585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525062000a0f92505050565b9050600085815481106200036d57634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101548783526002909152604091829020549151627eeac760e11b81526001600160a01b0392831660048201526024810184905291169062fdd58e9060440160206040518083038186803b158015620003d157600080fd5b505afa158015620003e6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200040c919062000d2f565b95945050505050565b600080858584866040516200042a9062000a6d565b62000439949392919062000f3f565b604051809103906000f08015801562000456573d6000803e3d6000fd5b5060008054600180820183558280527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56390910180546001600160a01b0319166001600160a01b03851617905581549293508392909190620004b990839062001068565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055503260026000600160008054905062000504919062001068565b8152602080820192909252604090810160002080546001600160a01b0319166001600160a01b039485161790558051338152928416918301919091527f7192d7c1a7c7914e1e82105dd5dcd5bdf88dc7eb0c2899d498664be8f0e406c5910160405180910390a195945050505050565b600062000582848462000a0f565b905060008481548110620005a657634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101548683526002909152604091829020549151630ab714fb60e11b81526001600160a01b039283166004820152602481018490526044810185905291169063156e29f690606401602060405180830381600087803b1580156200061557600080fd5b505af11580156200062a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000650919062000d2f565b507fe5935135c7f13720ede40cad8697b3295d1715ca8c2365a7aeefb65338ef2348600085815481106200069457634e487b7160e01b600052603260045260246000fd5b6000918252602091829020015460408051638da5cb5b60e01b815290516001600160a01b0390921692638da5cb5b92600480840193829003018186803b158015620006de57600080fd5b505afa158015620006f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000719919062000b69565b600086815481106200073b57634e487b7160e01b600052603260045260246000fd5b60009182526020918290200154604080516001600160a01b0394851681529390911691830191909152810184905260600160405180910390a150505050565b600080606060008060008781548110620007a457634e487b7160e01b600052603260045260246000fd5b9060005260206000200160009054906101000a90046001600160a01b0316905080816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015620007ff57600080fd5b505afa15801562000814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200083a919062000b69565b6040516303a24d0760e21b8152600481018990526001600160a01b03841690630e89341c9060240160006040518083038186803b1580156200087b57600080fd5b505afa15801562000890573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620008ba919081019062000b92565b60008a81526002602052604090819020549051627eeac760e11b81526001600160a01b039182166004820152602481018b90529085169062fdd58e9060440160206040518083038186803b1580156200091257600080fd5b505afa15801562000927573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200094d919062000d2f565b929a91995097509095509350505050565b6060600083815481106200098257634e487b7160e01b600052603260045260246000fd5b60009182526020909120015460405163364410b360e01b8152600481018490526001600160a01b039091169063364410b39060240160006040518083038186803b158015620009d057600080fd5b505afa158015620009e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002d2919081019062000b92565b600080838154811062000a3257634e487b7160e01b600052603260045260246000fd5b60009182526020909120015460405163f6d8f2cb60e01b81526001600160a01b039091169063f6d8f2cb906200027e90859060040162000f2a565b612b1280620010d683390190565b600082601f83011262000a8c578081fd5b8135602062000aa562000a9f8362001016565b62000fe2565b80838252828201915082860187848660051b890101111562000ac5578586fd5b855b8581101562000b0b57813567ffffffffffffffff81111562000ae7578788fd5b62000af78a87838c010162000b18565b855250928401929084019060010162000ac7565b5090979650505050505050565b600082601f83011262000b29578081fd5b813562000b3a62000a9f826200103d565b81815284602083860101111562000b4f578283fd5b816020850160208301379081016020019190915292915050565b60006020828403121562000b7b578081fd5b81516001600160a01b0381168114620002d2578182fd5b60006020828403121562000ba4578081fd5b815167ffffffffffffffff81111562000bbb578182fd5b8201601f8101841362000bcc578182fd5b805162000bdd62000a9f826200103d565b81815285602083850101111562000bf2578384fd5b6200040c8260208301602086016200108c565b6000806000806080858703121562000c1b578283fd5b843567ffffffffffffffff8082111562000c33578485fd5b62000c418883890162000b18565b955060209150818701358181111562000c58578586fd5b62000c6689828a0162000b18565b95505060408701358181111562000c7b578485fd5b8701601f8101891362000c8c578485fd5b803562000c9d62000a9f8262001016565b8082825285820191508584018c878560051b870101111562000cbd578889fd5b8894505b8385101562000ce157803583526001949094019391860191860162000cc1565b509650505050606087013591508082111562000cfb578283fd5b5062000d0a8782880162000a7b565b91505092959194509250565b60006020828403121562000d28578081fd5b5035919050565b60006020828403121562000d41578081fd5b5051919050565b60008060006040848603121562000d5d578283fd5b83359250602084013567ffffffffffffffff8082111562000d7c578384fd5b818601915086601f83011262000d90578384fd5b81358181111562000d9f578485fd5b87602082850101111562000db1578485fd5b6020830194508093505050509250925092565b6000806040838503121562000dd7578182fd5b82359150602083013567ffffffffffffffff81111562000df5578182fd5b62000e038582860162000b18565b9150509250929050565b60008060006060848603121562000e22578283fd5b83359250602084013567ffffffffffffffff81111562000e40578283fd5b62000e4e8682870162000b18565b925050604084013590509250925092565b6000806040838503121562000e72578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b8381101562000eb25781518752958201959082019060010162000e94565b509495945050505050565b6000815180845262000ed78160208601602086016200108c565b601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260806040820181905260009062000f199083018562000ebd565b905082606083015295945050505050565b602081526000620002d2602083018462000ebd565b60808152600062000f54608083018762000ebd565b60208382038185015262000f69828862000ebd565b915083820360408501528186518084528284019150828160051b850101838901865b8381101562000fbd57601f1987840301855262000faa83835162000ebd565b9486019492509085019060010162000f8b565b5050868103606088015262000fd3818962000e81565b9b9a5050505050505050505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156200100e576200100e620010bf565b604052919050565b600067ffffffffffffffff821115620010335762001033620010bf565b5060051b60200190565b600067ffffffffffffffff8211156200105a576200105a620010bf565b50601f01601f191660200190565b6000828210156200108757634e487b7160e01b81526011600452602481fd5b500390565b60005b83811015620010a95781810151838201526020016200108f565b83811115620010b9576000848401525b50505050565b634e487b7160e01b600052604160045260246000fdfe608060405260006008553480156200001657600080fd5b5060405162002b1238038062002b128339810160408190526200003991620006ac565b826200004581620000d3565b506200005133620000ec565b8151620000669060049060208501906200037d565b5080516200007c906005906020840190620003e1565b50620000876200013e565b620000928362000266565b8251620000a79060069060208601906200042d565b508351620000bd9060079060208701906200042d565b50620000c932620002c0565b505050506200094f565b8051620000e89060029060208401906200042d565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b6005548110156200026357600581815481106200016e57634e487b7160e01b600052603260045260246000fd5b90600052602060002001546009600483815481106200019d57634e487b7160e01b600052603260045260246000fd5b90600052602060002001604051620001b69190620007d8565b908152604051908190036020019020556004805482908110620001e957634e487b7160e01b600052603260045260246000fd5b90600052602060002001600a6000600584815481106200021957634e487b7160e01b600052603260045260246000fd5b906000526020600020015481526020019081526020016000209080546200024090620008d4565b6200024d929190620004a9565b50806200025a8162000911565b91505062000141565b50565b6003546001600160a01b03163314620002b55760405162461bcd60e51b8152602060048201819052602482015260008051602062002af283398151915260448201526064015b60405180910390fd5b6200026381620000d3565b6003546001600160a01b031633146200030b5760405162461bcd60e51b8152602060048201819052602482015260008051602062002af28339815191526044820152606401620002ac565b6001600160a01b038116620003725760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620002ac565b6200026381620000ec565b828054828255906000526020600020908101928215620003cf579160200282015b82811115620003cf5782518051620003be9184916020909101906200042d565b50916020019190600101906200039e565b50620003dd9291506200052d565b5090565b8280548282559060005260206000209081019282156200041f579160200282015b828111156200041f57825182559160200191906001019062000402565b50620003dd9291506200054e565b8280546200043b90620008d4565b90600052602060002090601f0160209004810192826200045f57600085556200041f565b82601f106200047a57805160ff19168380011785556200041f565b828001600101855582156200041f57918201828111156200041f57825182559160200191906001019062000402565b828054620004b790620008d4565b90600052602060002090601f016020900481019282620004db57600085556200041f565b82601f10620004ee57805485556200041f565b828001600101855582156200041f57600052602060002091601f016020900482015b828111156200041f57825482559160010191906001019062000510565b80821115620003dd57600062000544828262000565565b506001016200052d565b5b80821115620003dd57600081556001016200054f565b5080546200057390620008d4565b6000825580601f1062000584575050565b601f0160209004906000526020600020908101906200026391906200054e565b600082601f830112620005b5578081fd5b81516020620005ce620005c883620008ae565b6200087b565b80838252828201915082860187848660051b8901011115620005ee578586fd5b855b858110156200060e57815184529284019290840190600101620005f0565b5090979650505050505050565b600082601f8301126200062c578081fd5b81516001600160401b0381111562000648576200064862000939565b60206200065e601f8301601f191682016200087b565b828152858284870101111562000672578384fd5b835b838110156200069157858101830151828201840152820162000674565b83811115620006a257848385840101525b5095945050505050565b60008060008060808587031215620006c2578384fd5b84516001600160401b0380821115620006d9578586fd5b620006e7888389016200061b565b9550602091508187015181811115620006fe578586fd5b6200070c89828a016200061b565b95505060408701518181111562000721578485fd5b8701601f8101891362000732578485fd5b805162000743620005c882620008ae565b8082825285820191508584018c878560051b870101111562000763578889fd5b885b84811015620007a1578151878111156200077d578a8bfd5b6200078d8f8a838a01016200061b565b855250928701929087019060010162000765565b505060608b0151909750945050505080821115620007bd578283fd5b50620007cc87828801620005a4565b91505092959194509250565b600080835482600182811c915080831680620007f557607f831692505b60208084108214156200081657634e487b7160e01b87526022600452602487fd5b8180156200082d57600181146200083f576200086d565b60ff198616895284890196506200086d565b60008a815260209020885b86811015620008655781548b8201529085019083016200084a565b505084890196505b509498975050505050505050565b604051601f8201601f191681016001600160401b0381118282101715620008a657620008a662000939565b604052919050565b60006001600160401b03821115620008ca57620008ca62000939565b5060051b60200190565b600181811c90821680620008e957607f821691505b602082108114156200090b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156200093257634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b612193806200095f6000396000f3fe60806040526004361061013f5760003560e01c80634e1273f4116100b6578063cd838f0f1161006f578063cd838f0f14610373578063e985e9c514610395578063f242432a146103de578063f2fde38b146103fe578063f6d8f2cb1461041e578063fac333ac1461045657600080fd5b80634e1273f4146102b45780635b2bd79e146102e157806369fe0e2d146102f6578063715018a6146103165780638da5cb5b1461032b578063a22cb4651461035357600080fd5b806313966db51161010857806313966db51461020b578063156e29f6146102215780631f7fdffa146102345780632eb2c2d614610254578063364410b3146102745780634622ab031461029457600080fd5b8062fdd58e1461014457806301ffc9a71461017757806302fe5305146101a757806306fdde03146101c95780630e89341c146101eb575b600080fd5b34801561015057600080fd5b5061016461015f36600461195d565b610476565b6040519081526020015b60405180910390f35b34801561018357600080fd5b50610197610192366004611a83565b61050d565b604051901515815260200161016e565b3480156101b357600080fd5b506101c76101c2366004611abb565b61055f565b005b3480156101d557600080fd5b506101de610595565b60405161016e9190611d91565b3480156101f757600080fd5b506101de610206366004611b01565b610623565b34801561021757600080fd5b5061016460085481565b61016461022f366004611986565b610657565b34801561024057600080fd5b506101c761024f36600461188e565b61068a565b34801561026057600080fd5b506101c761026f366004611785565b61069c565b34801561028057600080fd5b506101de61028f366004611b01565b610733565b3480156102a057600080fd5b506101de6102af366004611b01565b61074c565b3480156102c057600080fd5b506102d46102cf3660046119b8565b610777565b60405161016e9190611d59565b3480156102ed57600080fd5b506101de6108d9565b34801561030257600080fd5b506101c7610311366004611b01565b6108e6565b34801561032257600080fd5b506101c7610915565b34801561033757600080fd5b506003546040516001600160a01b03909116815260200161016e565b34801561035f57600080fd5b506101c761036e366004611923565b61094b565b34801561037f57600080fd5b5061038861095a565b60405161016e9190611cf8565b3480156103a157600080fd5b506101976103b0366004611753565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b3480156103ea57600080fd5b506101c76103f936600461182b565b610a33565b34801561040a57600080fd5b506101c7610419366004611739565b610aba565b34801561042a57600080fd5b50610164610439366004611abb565b805160208183018101805160098252928201919093012091525481565b34801561046257600080fd5b50610164610471366004611b01565b610b52565b60006001600160a01b0383166104e75760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061053e57506001600160e01b031982166303a24d0760e21b145b8061055957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003546001600160a01b031633146105895760405162461bcd60e51b81526004016104de90611e7b565b61059281610b73565b50565b600780546105a290611fcc565b80601f01602080910402602001604051908101604052809291908181526020018280546105ce90611fcc565b801561061b5780601f106105f05761010080835404028352916020019161061b565b820191906000526020600020905b8154815290600101906020018083116105fe57829003601f168201915b505050505081565b6060600661063083610b86565b604051602001610641929190611b9b565b6040516020818303038152906040529050919050565b6000600854341461066757600080fd5b61068284848460405180602001604052806000815250610ca8565b509092915050565b61069684848484610d82565b50505050565b6001600160a01b0385163314806106b857506106b885336103b0565b61071f5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016104de565b61072c8585858585610ee9565b5050505050565b600a60205260009081526040902080546105a290611fcc565b6004818154811061075c57600080fd5b9060005260206000200160009150905080546105a290611fcc565b606081518351146107dc5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016104de565b6000835167ffffffffffffffff81111561080657634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561082f578160200160208202803683370190505b50905060005b84518110156108d15761089685828151811061086157634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061088957634e487b7160e01b600052603260045260246000fd5b6020026020010151610476565b8282815181106108b657634e487b7160e01b600052603260045260246000fd5b60209081029190910101526108ca81612034565b9050610835565b509392505050565b600680546105a290611fcc565b6003546001600160a01b031633146109105760405162461bcd60e51b81526004016104de90611e7b565b600855565b6003546001600160a01b0316331461093f5760405162461bcd60e51b81526004016104de90611e7b565b61094960006110a1565b565b6109563383836110f3565b5050565b60606004805480602002602001604051908101604052809291908181526020016000905b82821015610a2a57838290600052602060002001805461099d90611fcc565b80601f01602080910402602001604051908101604052809291908181526020018280546109c990611fcc565b8015610a165780601f106109eb57610100808354040283529160200191610a16565b820191906000526020600020905b8154815290600101906020018083116109f957829003601f168201915b50505050508152602001906001019061097e565b50505050905090565b6001600160a01b038516331480610a4f5750610a4f85336103b0565b610aad5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016104de565b61072c85858585856111d4565b6003546001600160a01b03163314610ae45760405162461bcd60e51b81526004016104de90611e7b565b6001600160a01b038116610b495760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104de565b610592816110a1565b60058181548110610b6257600080fd5b600091825260209091200154905081565b805161095690600290602084019061158c565b606081610baa5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610bd45780610bbe81612034565b9150610bcd9050600a83611f75565b9150610bae565b60008167ffffffffffffffff811115610bfd57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610c27576020820181803683370190505b5090505b8415610ca057610c3c600183611f89565b9150610c49600a8661204f565b610c54906030611f5d565b60f81b818381518110610c7757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350610c99600a86611f75565b9450610c2b565b949350505050565b6001600160a01b038416610cce5760405162461bcd60e51b81526004016104de90611ef8565b336000610cda856112fe565b90506000610ce7856112fe565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290610d19908490611f5d565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610d7983600089898989611357565b50505050505050565b6001600160a01b038416610da85760405162461bcd60e51b81526004016104de90611ef8565b8151835114610dc95760405162461bcd60e51b81526004016104de90611eb0565b3360005b8451811015610e8157838181518110610df657634e487b7160e01b600052603260045260246000fd5b6020026020010151600080878481518110610e2157634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610e699190611f5d565b90915550819050610e7981612034565b915050610dcd565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610ed2929190611d6c565b60405180910390a461072c816000878787876114c2565b8151835114610f0a5760405162461bcd60e51b81526004016104de90611eb0565b6001600160a01b038416610f305760405162461bcd60e51b81526004016104de90611dec565b3360005b8451811015611033576000858281518110610f5f57634e487b7160e01b600052603260045260246000fd5b602002602001015190506000858381518110610f8b57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015610fdb5760405162461bcd60e51b81526004016104de90611e31565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611018908490611f5d565b925050819055505050508061102c90612034565b9050610f34565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611083929190611d6c565b60405180910390a46110998187878787876114c2565b505050505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156111675760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016104de565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166111fa5760405162461bcd60e51b81526004016104de90611dec565b336000611206856112fe565b90506000611213856112fe565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156112565760405162461bcd60e51b81526004016104de90611e31565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611293908490611f5d565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46112f3848a8a8a8a8a611357565b505050505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061134657634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156110995760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061139b9089908990889088908890600401611cb3565b602060405180830381600087803b1580156113b557600080fd5b505af19250505080156113e5575060408051601f3d908101601f191682019092526113e291810190611a9f565b60015b611492576113f16120a5565b806308c379a0141561142b57506114066120bd565b80611411575061142d565b8060405162461bcd60e51b81526004016104de9190611d91565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016104de565b6001600160e01b0319811663f23a6e6160e01b14610d795760405162461bcd60e51b81526004016104de90611da4565b6001600160a01b0384163b156110995760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906115069089908990889088908890600401611c55565b602060405180830381600087803b15801561152057600080fd5b505af1925050508015611550575060408051601f3d908101601f1916820190925261154d91810190611a9f565b60015b61155c576113f16120a5565b6001600160e01b0319811663bc197c8160e01b14610d795760405162461bcd60e51b81526004016104de90611da4565b82805461159890611fcc565b90600052602060002090601f0160209004810192826115ba5760008555611600565b82601f106115d357805160ff1916838001178555611600565b82800160010185558215611600579182015b828111156116005782518255916020019190600101906115e5565b5061160c929150611610565b5090565b5b8082111561160c5760008155600101611611565b600067ffffffffffffffff83111561163f5761163f61208f565b604051611656601f8501601f191660200182612007565b80915083815284848401111561166b57600080fd5b83836020830137600060208583010152509392505050565b80356001600160a01b038116811461169a57600080fd5b919050565b600082601f8301126116af578081fd5b813560206116bc82611f39565b6040516116c98282612007565b8381528281019150858301600585901b870184018810156116e8578586fd5b855b85811015611706578135845292840192908401906001016116ea565b5090979650505050505050565b600082601f830112611723578081fd5b61173283833560208501611625565b9392505050565b60006020828403121561174a578081fd5b61173282611683565b60008060408385031215611765578081fd5b61176e83611683565b915061177c60208401611683565b90509250929050565b600080600080600060a0868803121561179c578081fd5b6117a586611683565b94506117b360208701611683565b9350604086013567ffffffffffffffff808211156117cf578283fd5b6117db89838a0161169f565b945060608801359150808211156117f0578283fd5b6117fc89838a0161169f565b93506080880135915080821115611811578283fd5b5061181e88828901611713565b9150509295509295909350565b600080600080600060a08688031215611842578081fd5b61184b86611683565b945061185960208701611683565b93506040860135925060608601359150608086013567ffffffffffffffff811115611882578182fd5b61181e88828901611713565b600080600080608085870312156118a3578384fd5b6118ac85611683565b9350602085013567ffffffffffffffff808211156118c8578485fd5b6118d48883890161169f565b945060408701359150808211156118e9578384fd5b6118f58883890161169f565b9350606087013591508082111561190a578283fd5b5061191787828801611713565b91505092959194509250565b60008060408385031215611935578182fd5b61193e83611683565b915060208301358015158114611952578182fd5b809150509250929050565b6000806040838503121561196f578182fd5b61197883611683565b946020939093013593505050565b60008060006060848603121561199a578081fd5b6119a384611683565b95602085013595506040909401359392505050565b600080604083850312156119ca578182fd5b823567ffffffffffffffff808211156119e1578384fd5b818501915085601f8301126119f4578384fd5b81356020611a0182611f39565b604051611a0e8282612007565b8381528281019150858301600585901b870184018b1015611a2d578889fd5b8896505b84871015611a5657611a4281611683565b835260019690960195918301918301611a31565b5096505086013592505080821115611a6c578283fd5b50611a798582860161169f565b9150509250929050565b600060208284031215611a94578081fd5b813561173281612147565b600060208284031215611ab0578081fd5b815161173281612147565b600060208284031215611acc578081fd5b813567ffffffffffffffff811115611ae2578182fd5b8201601f81018413611af2578182fd5b610ca084823560208401611625565b600060208284031215611b12578081fd5b5035919050565b6000815180845260208085019450808401835b83811015611b4857815187529582019590820190600101611b2c565b509495945050505050565b60008151808452611b6b816020860160208601611fa0565b601f01601f19169290920160200192915050565b60008151611b91818560208601611fa0565b9290920192915050565b600080845482600182811c915080831680611bb757607f831692505b6020808410821415611bd757634e487b7160e01b87526022600452602487fd5b818015611beb5760018114611bfc57611c28565b60ff19861689528489019650611c28565b60008b815260209020885b86811015611c205781548b820152908501908301611c07565b505084890196505b505050505050611c4c611c3b8286611b7f565b64173539b7b760d91b815260050190565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090611c8190830186611b19565b8281036060840152611c938186611b19565b90508281036080840152611ca78185611b53565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611ced90830184611b53565b979650505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b82811015611d4c57603f19888603018452611d3a858351611b53565b94509285019290850190600101611d1e565b5092979650505050505050565b6020815260006117326020830184611b19565b604081526000611d7f6040830185611b19565b8281036020840152611c4c8185611b19565b6020815260006117326020830184611b53565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b600067ffffffffffffffff821115611f5357611f5361208f565b5060051b60200190565b60008219821115611f7057611f70612063565b500190565b600082611f8457611f84612079565b500490565b600082821015611f9b57611f9b612063565b500390565b60005b83811015611fbb578181015183820152602001611fa3565b838111156106965750506000910152565b600181811c90821680611fe057607f821691505b6020821081141561200157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff8111828210171561202d5761202d61208f565b6040525050565b600060001982141561204857612048612063565b5060010190565b60008261205e5761205e612079565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156120ba57600481823e5160e01c5b90565b600060443d10156120cb5790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156120fb57505050505090565b82850191508151818111156121135750505050505090565b843d870101602082850101111561212d5750505050505090565b61213c60208286010187612007565b509095945050505050565b6001600160e01b03198116811461059257600080fdfea264697066735822122014a635ca0d8345d759737529824d421a5edaa07c91c5e57837a2ac99591c278464736f6c634300080400334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220d627ef07e25a12dd3b749f03c57514233995f0397bc020c12ff1ddbb71ddfefc64736f6c63430008040033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading