Token

 

Overview ERC-1155

Total Supply:
0 N/A

Holders:
16 addresses

Transfers:
-

Loading
[ Download CSV Export  ] 
Loading
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
RainiNFT1155v2Ftm

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : RainiNft1155v2Ftm.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.3;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

interface IStakingPool {
    function balanceOf(address _owner) external view returns (uint256 balance);

    function burn(address _owner, uint256 _amount) external;
}

interface INftStakingPool {
    function getTokenStamina(uint256 _tokenId, address _nftContractAddress)
        external
        view
        returns (uint256 stamina);

    function mergeTokens(
        uint256 _newTokenId,
        uint256[] memory _tokenIds,
        address _nftContractAddress
    ) external;
}

interface IRainiCustomNFT {
    function onTransfered(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) external;

    function onMerged(
        uint256 _newTokenId,
        uint256[] memory _tokenId,
        address _nftContractAddress,
        uint256[] memory data
    ) external;

    function onMinted(
        address _to,
        uint256 _tokenId,
        uint256 _cardId,
        uint256 _cardLevel,
        uint256 _amount,
        bytes1 _mintedContractChar,
        uint256 _number,
        uint256[] memory _data
    ) external;

    function uri(uint256 id) external view returns (string memory);
}

contract RainiNFT1155v2Ftm is ERC1155, AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");

    address public nftStakingPoolAddress;

    struct CardLevel {
        uint64 conversionRate; // number of base tokens required to create
        uint32 numberMinted;
        uint128 tokenId; // ID of token if grouped, 0 if not
        uint32 maxStamina; // The initial and maxiumum stamina for a token
    }

    struct Card {
        uint64 costInUnicorns;
        uint64 costInRainbows;
        uint16 maxMintsPerAddress;
        uint32 maxSupply; // number of base tokens mintable
        uint32 allocation; // number of base tokens mintable with points on this contract
        uint32 mintTimeStart; // the timestamp from which the card can be minted
        bool locked;
        address subContract;
    }

    struct TokenVars {
        uint128 cardId;
        uint32 level;
        uint32 number; // to assign a numbering to NFTs
        bytes1 mintedContractChar;
    }

    string public baseUri;
    bytes1 public contractChar;
    string public contractURIString;

    // userId => cardId => count
    mapping(address => mapping(uint256 => uint256))
        public numberMintedByAddress; // Number of a card minted by an address

    mapping(address => bool) public rainbowPools;
    mapping(address => bool) public unicornPools;

    uint256 public maxTokenId;
    uint256 public maxCardId;

    address private contractOwner;

    mapping(uint256 => Card) public cards;
    mapping(uint256 => string) public cardPathUri;
    mapping(uint256 => CardLevel[]) public cardLevels;
    mapping(uint256 => uint256) public mergeFees;
    uint256 public mintingFeeBasisPoints;

    mapping(uint256 => TokenVars) public tokenVars;

    constructor(
        string memory _uri,
        bytes1 _contractChar,
        string memory _contractURIString,
        address _contractOwner
    ) ERC1155(_uri) {
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setupRole(DEFAULT_ADMIN_ROLE, _contractOwner);
        _setupRole(MINTER_ROLE, _msgSender());
        _setupRole(BURNER_ROLE, _msgSender());
        baseUri = _uri;
        contractOwner = _contractOwner;
        contractChar = _contractChar;
        contractURIString = _contractURIString;
    }

    modifier onlyOwner() {
        require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()));
        _;
    }

    modifier onlyMinter() {
        require(hasRole(MINTER_ROLE, _msgSender()), "caller is not a minter");
        _;
    }

    modifier onlyBurner() {
        require(hasRole(BURNER_ROLE, _msgSender()), "caller is not a burner");
        _;
    }

    function setcontractURI(string memory _contractURIString)
        external
        onlyOwner
    {
        contractURIString = _contractURIString;
    }

    function setFees(
        uint256 _mintingFeeBasisPoints,
        uint256[] memory _mergeFees
    ) external onlyOwner {
        mintingFeeBasisPoints = _mintingFeeBasisPoints;
        for (uint256 i = 1; i < _mergeFees.length; i++) {
            mergeFees[i] = _mergeFees[i];
        }
    }

    function setNftStakingPoolAddress(address _nftStakingPoolAddress)
        external
        onlyOwner
    {
        nftStakingPoolAddress = (_nftStakingPoolAddress);
    }

    function getTokenStamina(uint256 _tokenId) external view returns (uint256) {
        if (nftStakingPoolAddress == address(0)) {
            TokenVars memory _tokenVars = tokenVars[_tokenId];
            require(_tokenVars.cardId != 0, "No token for given ID");
            return cardLevels[_tokenVars.cardId][_tokenVars.level].maxStamina;
        } else {
            INftStakingPool nftStakingPool = INftStakingPool(
                nftStakingPoolAddress
            );
            return nftStakingPool.getTokenStamina(_tokenId, address(this));
        }
    }

    function getTotalBalance(address _address)
        external
        view
        returns (uint256[][] memory amounts)
    {
        uint256[][] memory _amounts = new uint256[][](maxTokenId);
        uint256 count;
        for (uint256 i = 1; i <= maxTokenId; i++) {
            uint256 balance = balanceOf(_address, i);
            if (balance != 0) {
                _amounts[count] = new uint256[](2);
                _amounts[count][0] = i;
                _amounts[count][1] = balance;
                count++;
            }
        }

        uint256[][] memory _amounts2 = new uint256[][](count);
        for (uint256 i = 0; i < count; i++) {
            _amounts2[i] = new uint256[](2);
            _amounts2[i][0] = _amounts[i][0];
            _amounts2[i][1] = _amounts[i][1];
        }

        return _amounts2;
    }

    struct MergeData {
        uint256 cost;
        uint256 totalPointsBurned;
        uint256 currentTokenToMint;
        bool willCallPool;
        bool willCallSubContract;
    }

    function initCards(
        uint256[] memory _costInUnicorns,
        uint256[] memory _costInRainbows,
        uint256[] memory _maxMintsPerAddress,
        uint16[] memory _maxSupply,
        uint256[] memory _allocation,
        string[] memory _pathUri,
        address[] memory _subContract,
        uint32[] memory _mintTimeStart,
        uint16[][] memory _conversionRates,
        bool[][] memory _isGrouped,
        uint256[][] memory _maxStamina
    ) external onlyOwner {
        uint256 _maxCardId = maxCardId;
        uint256 _maxTokenId = maxTokenId;

        for (uint256 i; i < _costInUnicorns.length; i++) {
            require(_conversionRates[i].length == _isGrouped[i].length);

            _maxCardId++;
            cards[_maxCardId] = Card({
                costInUnicorns: uint64(_costInUnicorns[i]),
                costInRainbows: uint64(_costInRainbows[i]),
                maxMintsPerAddress: uint16(_maxMintsPerAddress[i]),
                maxSupply: uint32(_maxSupply[i]),
                allocation: uint32(_allocation[i]),
                mintTimeStart: uint32(_mintTimeStart[i]),
                locked: false,
                subContract: _subContract[i]
            });

            cardPathUri[_maxCardId] = _pathUri[i];

            for (uint256 j = 0; j < _conversionRates[i].length; j++) {
                uint256 _tokenId = 0;

                if (_isGrouped[i][j]) {
                    _maxTokenId++;
                    _tokenId = _maxTokenId;
                    tokenVars[_maxTokenId] = TokenVars({
                        cardId: uint128(_maxCardId),
                        level: uint32(j),
                        number: 0,
                        mintedContractChar: contractChar
                    });
                }

                cardLevels[_maxCardId].push(
                    CardLevel({
                        conversionRate: uint64(_conversionRates[i][j]),
                        numberMinted: 0,
                        tokenId: uint128(_tokenId),
                        maxStamina: uint32(_maxStamina[i][j])
                    })
                );
            }
        }

        maxTokenId = _maxTokenId;
        maxCardId = _maxCardId;
    }

    function _mintToken(
        address _to,
        uint256 _cardId,
        uint256 _cardLevel,
        uint256 _amount,
        bytes1 _mintedContractChar,
        uint256 _number,
        uint256[] memory _data
    ) private {
        Card memory card = cards[_cardId];
        CardLevel memory cardLevel = cardLevels[_cardId][_cardLevel];

        require(
            _cardLevel > 0 ||
                cardLevel.numberMinted + _amount <= card.maxSupply,
            "total supply reached."
        );
        require(
            _cardLevel == 0 ||
                cardLevel.numberMinted * cardLevel.conversionRate + _amount <=
                card.maxSupply,
            "total supply reached."
        );

        uint256 _tokenId;

        if (cardLevel.tokenId != 0) {
            _tokenId = cardLevel.tokenId;
            _mint(_to, _tokenId, _amount, "");
        } else {
            for (uint256 i = 0; i < _amount; i++) {
                uint256 num;
                if (_number == 0) {
                    cardLevel.numberMinted += 1;
                    num = cardLevel.numberMinted;
                } else {
                    num = _number;
                }

                uint256 _maxTokenId = maxTokenId;
                _maxTokenId++;
                _tokenId = _maxTokenId;
                _mint(_to, _tokenId, 1, "");
                tokenVars[_maxTokenId] = TokenVars({
                    cardId: uint128(_cardId),
                    level: uint32(_cardLevel),
                    number: uint32(num),
                    mintedContractChar: _mintedContractChar
                });

                maxTokenId = _maxTokenId;
            }
        }

        if (card.subContract != address(0)) {
            IRainiCustomNFT subContract = IRainiCustomNFT(card.subContract);
            subContract.onMinted(
                _to,
                _tokenId,
                _cardId,
                _cardLevel,
                _amount,
                _mintedContractChar,
                _number,
                _data
            );
        }

        cardLevels[_cardId][_cardLevel].numberMinted += uint32(_amount);
    }

    function mint(
        address _to,
        uint256 _cardId,
        uint256 _cardLevel,
        uint256 _amount,
        bytes1 _mintedContractChar,
        uint256 _number,
        uint256[] memory _data
    ) external onlyMinter {
        _mintToken(
            _to,
            _cardId,
            _cardLevel,
            _amount,
            _mintedContractChar,
            _number,
            _data
        );
    }

    function burn(
        address _owner,
        uint256 _tokenId,
        uint256 _amount,
        bool _isBridged
    ) external onlyBurner {
        if (_isBridged) {
            TokenVars memory _tokenVars = tokenVars[_tokenId];
            cardLevels[_tokenVars.cardId][_tokenVars.level]
                .numberMinted -= uint32(_amount);
        }
        _burn(_owner, _tokenId, _amount);
    }

    function lockCard(uint256 _cardId) external onlyOwner {
        cards[_cardId].locked = true;
    }

    function updateCardPathUri(uint256 _cardId, string memory _pathUri)
        external
        onlyOwner
    {
        require(!cards[_cardId].locked, "card locked");
        cardPathUri[_cardId] = _pathUri;
    }

    function updateCardSubContract(uint256 _cardId, address _contractAddress)
        external
        onlyOwner
    {
        require(!cards[_cardId].locked, "card locked");
        cards[_cardId].subContract = _contractAddress;
    }

    function addToNumberMintedByAddress(
        address _address,
        uint256 _cardId,
        uint256 _amount
    ) external onlyMinter {
        numberMintedByAddress[_address][_cardId] += _amount;
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC1155, AccessControl)
        returns (bool)
    {
        return
            interfaceId == type(IERC1155).interfaceId ||
            interfaceId == type(IERC1155MetadataURI).interfaceId ||
            interfaceId == type(IAccessControl).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function uri(uint256 id)
        public
        view
        virtual
        override
        returns (string memory)
    {
        TokenVars memory _tokenVars = tokenVars[id];
        require(_tokenVars.cardId != 0, "No token for given ID");

        if (cards[_tokenVars.cardId].subContract == address(0)) {
            return
                string(
                    abi.encodePacked(
                        baseUri,
                        cardPathUri[_tokenVars.cardId],
                        "/",
                        (_tokenVars.number == 0)
                            ? bytes1("E") : _tokenVars.mintedContractChar,
                        "l",
                        uint2str(_tokenVars.level),
                        "n",
                        uint2str(_tokenVars.number),
                        ".json"
                    )
                );
        } else {
            IRainiCustomNFT subContract = IRainiCustomNFT(
                cards[_tokenVars.cardId].subContract
            );
            return subContract.uri(id);
        }
    }

    function uint2str(uint256 _i)
        internal
        pure
        returns (string memory _uintAsString)
    {
        if (_i == 0) {
            return "0";
        }
        uint256 j = _i;
        uint256 len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint256 k = len;
        while (_i != 0) {
            k = k - 1;
            uint8 temp = (48 + uint8(_i - (_i / 10) * 10));
            bytes1 b1 = bytes1(temp);
            bstr[k] = b1;
            _i /= 10;
        }
        return string(bstr);
    }

    function contractURI() public view returns (string memory) {
        return contractURIString;
    }

    function owner() public view virtual returns (address) {
        return contractOwner;
    }

    // Allow the owner to withdraw Ether payed into the contract
    function withdrawEth(uint256 _amount) external onlyOwner {
        require(_amount <= address(this).balance, "not enough balance");
        (bool success, ) = _msgSender().call{ value: _amount }("");
        require(success, "transfer failed");
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        for (uint256 i = 0; i < ids.length; i++) {
            TokenVars memory _tokenVars = tokenVars[ids[i]];
            if (cards[_tokenVars.cardId].subContract != address(0)) {
                IRainiCustomNFT subContract = IRainiCustomNFT(
                    cards[_tokenVars.cardId].subContract
                );
                subContract.onTransfered(from, to, ids[i], amounts[i], data);
            }
        }
    }
}

File 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 of 12 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), 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);

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

        _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();

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

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

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

        _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();

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

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

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

    /**
     * @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 {}

    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 11 of 12 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 12 of 12 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_uri","type":"string"},{"internalType":"bytes1","name":"_contractChar","type":"bytes1"},{"internalType":"string","name":"_contractURIString","type":"string"},{"internalType":"address","name":"_contractOwner","type":"address"}],"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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"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":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_cardId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addToNumberMintedByAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"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":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_isBridged","type":"bool"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"cardLevels","outputs":[{"internalType":"uint64","name":"conversionRate","type":"uint64"},{"internalType":"uint32","name":"numberMinted","type":"uint32"},{"internalType":"uint128","name":"tokenId","type":"uint128"},{"internalType":"uint32","name":"maxStamina","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"cardPathUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"cards","outputs":[{"internalType":"uint64","name":"costInUnicorns","type":"uint64"},{"internalType":"uint64","name":"costInRainbows","type":"uint64"},{"internalType":"uint16","name":"maxMintsPerAddress","type":"uint16"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"allocation","type":"uint32"},{"internalType":"uint32","name":"mintTimeStart","type":"uint32"},{"internalType":"bool","name":"locked","type":"bool"},{"internalType":"address","name":"subContract","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractChar","outputs":[{"internalType":"bytes1","name":"","type":"bytes1"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURIString","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenStamina","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getTotalBalance","outputs":[{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_costInUnicorns","type":"uint256[]"},{"internalType":"uint256[]","name":"_costInRainbows","type":"uint256[]"},{"internalType":"uint256[]","name":"_maxMintsPerAddress","type":"uint256[]"},{"internalType":"uint16[]","name":"_maxSupply","type":"uint16[]"},{"internalType":"uint256[]","name":"_allocation","type":"uint256[]"},{"internalType":"string[]","name":"_pathUri","type":"string[]"},{"internalType":"address[]","name":"_subContract","type":"address[]"},{"internalType":"uint32[]","name":"_mintTimeStart","type":"uint32[]"},{"internalType":"uint16[][]","name":"_conversionRates","type":"uint16[][]"},{"internalType":"bool[][]","name":"_isGrouped","type":"bool[][]"},{"internalType":"uint256[][]","name":"_maxStamina","type":"uint256[][]"}],"name":"initCards","outputs":[],"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":"uint256","name":"_cardId","type":"uint256"}],"name":"lockCard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxCardId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mergeFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_cardId","type":"uint256"},{"internalType":"uint256","name":"_cardLevel","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes1","name":"_mintedContractChar","type":"bytes1"},{"internalType":"uint256","name":"_number","type":"uint256"},{"internalType":"uint256[]","name":"_data","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftStakingPoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"numberMintedByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rainbowPools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"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":"uint256","name":"_mintingFeeBasisPoints","type":"uint256"},{"internalType":"uint256[]","name":"_mergeFees","type":"uint256[]"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftStakingPoolAddress","type":"address"}],"name":"setNftStakingPoolAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractURIString","type":"string"}],"name":"setcontractURI","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":"","type":"uint256"}],"name":"tokenVars","outputs":[{"internalType":"uint128","name":"cardId","type":"uint128"},{"internalType":"uint32","name":"level","type":"uint32"},{"internalType":"uint32","name":"number","type":"uint32"},{"internalType":"bytes1","name":"mintedContractChar","type":"bytes1"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"unicornPools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cardId","type":"uint256"},{"internalType":"string","name":"_pathUri","type":"string"}],"name":"updateCardPathUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cardId","type":"uint256"},{"internalType":"address","name":"_contractAddress","type":"address"}],"name":"updateCardSubContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162004b8d38038062004b8d83398101604081905262000034916200034d565b83620000408162000114565b506200004e6000336200012d565b6200005b6000826200012d565b620000877f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336200012d565b620000b37f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848336200012d565b8351620000c8906005906020870190620001da565b50600d80546001600160a01b0319166001600160a01b0383161790556006805460ff191660f885901c179055815162000109906007906020850190620001da565b505050505062000450565b805162000129906002906020840190620001da565b5050565b60008281526003602090815260408083206001600160a01b038516845290915290205462000129908390839060ff16620001295760008281526003602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620001963390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b828054620001e89062000413565b90600052602060002090601f0160209004810192826200020c576000855562000257565b82601f106200022757805160ff191683800117855562000257565b8280016001018555821562000257579182015b82811115620002575782518255916020019190600101906200023a565b506200026592915062000269565b5090565b5b808211156200026557600081556001016200026a565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620002a857600080fd5b81516001600160401b0380821115620002c557620002c562000280565b604051601f8301601f19908116603f01168101908282118183101715620002f057620002f062000280565b816040528381526020925086838588010111156200030d57600080fd5b600091505b8382101562000331578582018301518183018401529082019062000312565b83821115620003435760008385830101525b9695505050505050565b600080600080608085870312156200036457600080fd5b84516001600160401b03808211156200037c57600080fd5b6200038a8883890162000296565b602088015190965091507fff0000000000000000000000000000000000000000000000000000000000000082168214620003c357600080fd5b604087015191945080821115620003d957600080fd5b50620003e88782880162000296565b606087015190935090506001600160a01b03811681146200040857600080fd5b939692955090935050565b600181811c908216806200042857607f821691505b602082108114156200044a57634e487b7160e01b600052602260045260246000fd5b50919050565b61472d80620004606000396000f3fe608060405234801561001057600080fd5b50600436106102895760003560e01c80638da5cb5b1161015c578063bf0e8c0d116100ce578063d547741f11610087578063d547741f146107c2578063e8a3d485146107d5578063e985e9c5146107dd578063efa00ce714610819578063f242432a1461082c578063f9f98af61461083f57600080fd5b8063bf0e8c0d1461072f578063c2fa401914610742578063c311d04914610755578063d3d3819314610768578063d50345c914610788578063d53913931461079b57600080fd5b80639abc8320116101205780639abc8320146106c6578063a217fddf146106ce578063a22cb465146106d6578063a39501df146106e9578063b12b99a0146106fc578063bda3ed071461070f57600080fd5b80638da5cb5b146105ac5780638dc10768146105bd57806391ba317a146106a157806391d14854146106aa57806392d62ccd146106bd57600080fd5b8063282c51f3116102005780634e1273f4116101b95780634e1273f4146104f1578063582f706f146105115780636bb2e32d1461051a57806370e7d274146105405780637e41d8351461059157806388f7c16c1461059957600080fd5b8063282c51f31461046b5780632eb2c2d6146104925780632f2ff15d146104a557806331126dd1146104b857806336568abe146104cb5780633c369ebe146104de57600080fd5b80630c024776116102525780630c024776146103b25780630e89341c146103dd57806313f43160146103fd57806317c0f08e146104205780631d9083f314610435578063248a9ca31461044857600080fd5b8062fdd58e1461028e57806301870f02146102b457806301ffc9a71461034157806308a55a6e146103645780630a3de45114610387575b600080fd5b6102a161029c3660046133c6565b610852565b6040519081526020015b60405180910390f35b6103036102c23660046133f0565b6013602052600090815260409020546001600160801b0381169063ffffffff600160801b8204811691600160a01b810490911690600160c01b900460f81b84565b604080516001600160801b0395909516855263ffffffff938416602086015291909216908301526001600160f81b03191660608201526080016102ab565b61035461034f366004613422565b6108e9565b60405190151581526020016102ab565b61035461037236600461343f565b60096020526000908152604090205460ff1681565b6102a16103953660046133c6565b600860209081526000928352604080842090915290825290205481565b6004546103c5906001600160a01b031681565b6040516001600160a01b0390911681526020016102ab565b6103f06103eb3660046133f0565b61094a565b6040516102ab91906134b2565b61035461040b36600461343f565b600a6020526000908152604090205460ff1681565b61043361042e366004613a23565b610b53565b005b61043361044336600461343f565b6110e5565b6102a16104563660046133f0565b60009081526003602052604090206001015490565b6102a17f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6104336104a0366004613bdf565b61111b565b6104336104b3366004613c88565b6111b2565b6104336104c6366004613cb4565b6111dd565b6104336104d9366004613c88565b611334565b6104336104ec366004613cfa565b6113b2565b6105046104ff366004613d40565b611439565b6040516102ab9190613dd4565b6102a160125481565b6006546105279060f81b81565b6040516001600160f81b031990911681526020016102ab565b61055361054e366004613de7565b611562565b604080516001600160401b03909516855263ffffffff93841660208601526001600160801b03909216918401919091521660608201526080016102ab565b6103f06115c2565b6104336105a73660046133f0565b611650565b600d546001600160a01b03166103c5565b6106406105cb3660046133f0565b600e60205260009081526040902080546001909101546001600160401b0380831692600160401b81049091169161ffff600160801b8304169163ffffffff600160901b8204811692600160b01b8304821692600160d01b81049092169160ff600160f01b90910416906001600160a01b031688565b604080516001600160401b03998a16815298909716602089015261ffff9095169587019590955263ffffffff928316606087015290821660808601521660a084015290151560c08301526001600160a01b031660e0820152610100016102ab565b6102a1600b5481565b6103546106b8366004613c88565b611685565b6102a1600c5481565b6103f06116b0565b6102a1600081565b6104336106e4366004613e09565b6116bd565b6104336106f7366004613e33565b6116c8565b61043361070a366004613c88565b61174f565b6102a161071d3660046133f0565b60116020526000908152604090205481565b6102a161073d3660046133f0565b6117e8565b610433610750366004613ec6565b611983565b6104336107633660046133f0565b611a2f565b61077b61077636600461343f565b611b12565b6040516102ab9190613ef9565b6103f06107963660046133f0565b611dde565b6102a17f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6104336107d0366004613c88565b611df7565b6103f0611e1d565b6103546107eb366004613f5b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610433610827366004613f85565b611eaf565b61043361083a366004613fb9565b611ed6565b61043361084d36600461401d565b611f5d565b60006001600160a01b0383166108c35760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061091a57506001600160e01b031982166303a24d0760e21b145b8061093557506001600160e01b03198216637965db0b60e01b145b80610944575061094482611fc2565b92915050565b600081815260136020908152604091829020825160808101845290546001600160801b038116808352600160801b820463ffffffff90811694840194909452600160a01b820490931693820193909352600160c01b90920460f81b6001600160f81b03191660608084019190915291906109fe5760405162461bcd60e51b8152602060048201526015602482015274139bc81d1bdad95b88199bdc8819da5d995b881251605a1b60448201526064016108ba565b80516001600160801b03166000908152600e60205260409020600101546001600160a01b0316610ab75780516001600160801b03166000908152600f602052604090819020908201516005919063ffffffff1615610a60578260600151610a66565b604560f81b5b610a79846020015163ffffffff16611fe7565b610a8c856040015163ffffffff16611fe7565b604051602001610aa0959493929190614128565b604051602081830303815290604052915050919050565b80516001600160801b03166000908152600e6020526040908190206001015490516303a24d0760e21b8152600481018590526001600160a01b03909116908190630e89341c90602401600060405180830381865afa158015610b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b4591908101906141b4565b949350505050565b50919050565b610b5e600033611685565b610b6757600080fd5b600c54600b5460005b8d518110156110d157848181518110610b8b57610b8b614235565b602002602001015151868281518110610ba657610ba6614235565b60200260200101515114610bb957600080fd5b82610bc381614261565b9350506040518061010001604052808f8381518110610be457610be4614235565b60200260200101516001600160401b031681526020018e8381518110610c0c57610c0c614235565b60200260200101516001600160401b031681526020018d8381518110610c3457610c34614235565b602002602001015161ffff1681526020018c8381518110610c5757610c57614235565b602002602001015161ffff1663ffffffff1681526020018b8381518110610c8057610c80614235565b602002602001015163ffffffff168152602001888381518110610ca557610ca5614235565b602002602001015163ffffffff168152602001600015158152602001898381518110610cd357610cd3614235565b6020908102919091018101516001600160a01b039081169092526000868152600e82526040908190208451815493860151928601516060870151608088015160a089015160c08a01516001600160401b039586166fffffffffffffffffffffffffffffffff1990991698909817600160401b95909716949094029590951765ffffffffffff60801b1916600160801b61ffff9093169290920263ffffffff60901b191691909117600160901b63ffffffff928316021767ffffffffffffffff60b01b1916600160b01b9482169490940263ffffffff60d01b191693909317600160d01b93909116929092029190911760ff60f01b1916600160f01b9215159290920291909117815560e090920151600190920180546001600160a01b031916929091169190911790558851899082908110610e1057610e10614235565b6020026020010151600f60008581526020019081526020016000209080519060200190610e3e929190613316565b5060005b868281518110610e5457610e54614235565b6020026020010151518110156110be576000868381518110610e7857610e78614235565b60200260200101518281518110610e9157610e91614235565b602002602001015115610f5c5783610ea881614261565b604080516080810182526001600160801b03898116825263ffffffff8781166020808501918252600085870181815260065460f890811b6001600160f81b031916606089019081528a84526013909452979091209551865493519151925195166001600160a01b031990931692909217600160801b928416929092029190911764ffffffffff60a01b1916600160a01b919092160260ff60c01b191617600160c01b9190931c029190911790559450849150505b6010600086815260200190815260200160002060405180608001604052808a8681518110610f8c57610f8c614235565b60200260200101518581518110610fa557610fa5614235565b602002602001015161ffff166001600160401b03168152602001600063ffffffff168152602001836001600160801b03168152602001888681518110610fed57610fed614235565b6020026020010151858151811061100657611006614235565b60209081029190910181015163ffffffff90811690925283546001810185556000948552938190208351940180549184015160408501516060909501518416600160e01b026001600160e01b036001600160801b03909616600160601b02959095166bffffffffffffffffffffffff91909416600160401b026bffffffffffffffffffffffff199093166001600160401b039096169590951791909117939093161717905550806110b681614261565b915050610e42565b50806110c981614261565b915050610b70565b50600b55600c555050505050505050505050565b6110f0600033611685565b6110f957600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038516331480611137575061113785336107eb565b61119e5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016108ba565b6111ab8585858585612106565b5050505050565b6000828152600360205260409020600101546111ce81336122f1565b6111d88383612355565b505050565b6112077f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833611685565b61124c5760405162461bcd60e51b815260206004820152601660248201527531b0b63632b91034b9903737ba103090313ab93732b960511b60448201526064016108ba565b8015611323576000838152601360209081526040808320815160808101835290546001600160801b038116808352600160801b820463ffffffff908116848701908152600160a01b8404821685870152600160c01b90930460f81b6001600160f81b0319166060850152908652601090945291909320905181548693919091169081106112db576112db614235565b60009182526020909120018054600890611303908490600160401b900463ffffffff1661427c565b92506101000a81548163ffffffff021916908363ffffffff160217905550505b61132e8484846123db565b50505050565b6001600160a01b03811633146113a45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016108ba565b6113ae8282612554565b5050565b6113bd600033611685565b6113c657600080fd5b6000828152600e6020526040902054600160f01b900460ff161561141a5760405162461bcd60e51b815260206004820152600b60248201526a18d85c99081b1bd8dad95960aa1b60448201526064016108ba565b6000828152600f6020908152604090912082516111d892840190613316565b6060815183511461149e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108ba565b600083516001600160401b038111156114b9576114b96134c5565b6040519080825280602002602001820160405280156114e2578160200160208202803683370190505b50905060005b845181101561155a5761152d85828151811061150657611506614235565b602002602001015185838151811061152057611520614235565b6020026020010151610852565b82828151811061153f5761153f614235565b602090810291909101015261155381614261565b90506114e8565b509392505050565b6010602052816000526040600020818154811061157e57600080fd5b6000918252602090912001546001600160401b038116925063ffffffff600160401b8204811692506001600160801b03600160601b83041691600160e01b90041684565b600780546115cf90614059565b80601f01602080910402602001604051908101604052809291908181526020018280546115fb90614059565b80156116485780601f1061161d57610100808354040283529160200191611648565b820191906000526020600020905b81548152906001019060200180831161162b57829003601f168201915b505050505081565b61165b600033611685565b61166457600080fd5b6000908152600e60205260409020805460ff60f01b1916600160f01b179055565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600580546115cf90614059565b6113ae3383836125bb565b6116f27f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633611685565b6117375760405162461bcd60e51b815260206004820152601660248201527531b0b63632b91034b9903737ba10309036b4b73a32b960511b60448201526064016108ba565b6117468787878787878761269c565b50505050505050565b61175a600033611685565b61176357600080fd5b6000828152600e6020526040902054600160f01b900460ff16156117b75760405162461bcd60e51b815260206004820152600b60248201526a18d85c99081b1bd8dad95960aa1b60448201526064016108ba565b6000918252600e602052604090912060010180546001600160a01b0319166001600160a01b03909216919091179055565b6004546000906001600160a01b031661190457600082815260136020908152604091829020825160808101845290546001600160801b038116808352600160801b820463ffffffff90811694840194909452600160a01b820490931693820193909352600160c01b90920460f81b6001600160f81b03191660608301526118a95760405162461bcd60e51b8152602060048201526015602482015274139bc81d1bdad95b88199bdc8819da5d995b881251605a1b60448201526064016108ba565b6010600082600001516001600160801b03168152602001908152602001600020816020015163ffffffff16815481106118e4576118e4614235565b600091825260209091200154600160e01b900463ffffffff169392505050565b600480546040516367bb908760e01b81529182018490523060248301526001600160a01b03169081906367bb908790604401602060405180830381865afa158015611953573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197791906142a1565b9392505050565b919050565b6119ad7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633611685565b6119f25760405162461bcd60e51b815260206004820152601660248201527531b0b63632b91034b9903737ba10309036b4b73a32b960511b60448201526064016108ba565b6001600160a01b038316600090815260086020908152604080832085845290915281208054839290611a259084906142ba565b9091555050505050565b611a3a600033611685565b611a4357600080fd5b47811115611a885760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682062616c616e636560701b60448201526064016108ba565b604051600090339083908381818185875af1925050503d8060008114611aca576040519150601f19603f3d011682016040523d82523d6000602084013e611acf565b606091505b50509050806113ae5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016108ba565b60606000600b546001600160401b03811115611b3057611b306134c5565b604051908082528060200260200182016040528015611b6357816020015b6060815260200190600190039081611b4e5790505b509050600060015b600b548111611c55576000611b808683610852565b90508015611c4257604080516002808252606082018352909160208301908036833701905050848481518110611bb857611bb8614235565b602002602001018190525081848481518110611bd657611bd6614235565b6020026020010151600081518110611bf057611bf0614235565b60200260200101818152505080848481518110611c0f57611c0f614235565b6020026020010151600181518110611c2957611c29614235565b602090810291909101015282611c3e81614261565b9350505b5080611c4d81614261565b915050611b6b565b506000816001600160401b03811115611c7057611c706134c5565b604051908082528060200260200182016040528015611ca357816020015b6060815260200190600190039081611c8e5790505b50905060005b82811015611dd557604080516002808252606082018352909160208301908036833701905050828281518110611ce157611ce1614235565b6020026020010181905250838181518110611cfe57611cfe614235565b6020026020010151600081518110611d1857611d18614235565b6020026020010151828281518110611d3257611d32614235565b6020026020010151600081518110611d4c57611d4c614235565b602002602001018181525050838181518110611d6a57611d6a614235565b6020026020010151600181518110611d8457611d84614235565b6020026020010151828281518110611d9e57611d9e614235565b6020026020010151600181518110611db857611db8614235565b602090810291909101015280611dcd81614261565b915050611ca9565b50949350505050565b600f60205260009081526040902080546115cf90614059565b600082815260036020526040902060010154611e1381336122f1565b6111d88383612554565b606060078054611e2c90614059565b80601f0160208091040260200160405190810160405280929190818152602001828054611e5890614059565b8015611ea55780601f10611e7a57610100808354040283529160200191611ea5565b820191906000526020600020905b815481529060010190602001808311611e8857829003601f168201915b5050505050905090565b611eba600033611685565b611ec357600080fd5b80516113ae906007906020840190613316565b6001600160a01b038516331480611ef25750611ef285336107eb565b611f505760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108ba565b6111ab8585858585612b26565b611f68600033611685565b611f7157600080fd5b601282905560015b81518110156111d857818181518110611f9457611f94614235565b6020908102919091018101516000838152601190925260409091205580611fba81614261565b915050611f79565b60006001600160e01b03198216637965db0b60e01b1480610944575061094482612c49565b60608161200b5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612035578061201f81614261565b915061202e9050600a836142d2565b915061200f565b6000816001600160401b0381111561204f5761204f6134c5565b6040519080825280601f01601f191660200182016040528015612079576020820181803683370190505b509050815b8515611dd55761208f6001826142f4565b9050600061209e600a886142d2565b6120a990600a61430b565b6120b390886142f4565b6120be90603061432a565b905060008160f81b9050808484815181106120db576120db614235565b60200101906001600160f81b031916908160001a9053506120fd600a896142d2565b9750505061207e565b81518351146121685760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108ba565b6001600160a01b03841661218e5760405162461bcd60e51b81526004016108ba9061434f565b3361219d818787878787612c99565b60005b84518110156122835760008582815181106121bd576121bd614235565b6020026020010151905060008583815181106121db576121db614235565b602090810291909101810151600084815280835260408082206001600160a01b038e16835290935291909120549091508181101561222b5760405162461bcd60e51b81526004016108ba90614394565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122689084906142ba565b925050819055505050508061227c90614261565b90506121a0565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516122d39291906143de565b60405180910390a46122e9818787878787612e1c565b505050505050565b6122fb8282611685565b6113ae57612313816001600160a01b03166014612f78565b61231e836020612f78565b60405160200161232f92919061440c565b60408051601f198184030181529082905262461bcd60e51b82526108ba916004016134b2565b61235f8282611685565b6113ae5760008281526003602090815260408083206001600160a01b03851684529091529020805460ff191660011790556123973390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03831661243d5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108ba565b3361246c8185600061244e87613113565b61245787613113565b60405180602001604052806000815250612c99565b6000838152602081815260408083206001600160a01b0388168452909152902054828110156124e95760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108ba565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b61255e8282611685565b156113ae5760008281526003602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b816001600160a01b0316836001600160a01b0316141561262f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108ba565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000868152600e6020908152604080832081516101008101835281546001600160401b038082168352600160401b8204168286015261ffff600160801b8204168285015263ffffffff600160901b820481166060840152600160b01b820481166080840152600160d01b82041660a083015260ff600160f01b90910416151560c08201526001909101546001600160a01b031660e08201528984526010909252822080549192918890811061275357612753614235565b60009182526020918290206040805160808101825291909201546001600160401b038116825263ffffffff600160401b82048116948301949094526001600160801b03600160601b82041692820192909252600160e01b90910490911660608201529050861515806127e45750816060015163ffffffff1686826020015163ffffffff166127e191906142ba565b11155b6128285760405162461bcd60e51b81526020600482015260156024820152743a37ba30b61039bab838363c903932b0b1b432b21760591b60448201526064016108ba565b86158061286c5750816060015163ffffffff16868260000151836020015163ffffffff166128569190614481565b6001600160401b031661286991906142ba565b11155b6128b05760405162461bcd60e51b81526020600482015260156024820152743a37ba30b61039bab838363c903932b0b1b432b21760591b60448201526064016108ba565b600081604001516001600160801b03166000146128f75781604001516001600160801b031690506128f28a82896040518060200160405280600081525061315e565b612a2b565b60005b87811015612a29576000866129365760018460200181815161291c91906144b0565b63ffffffff90811690915260208601511691506129399050565b50855b600b548061294681614261565b9150508093506129688d8560016040518060200160405280600081525061315e565b604080516080810182526001600160801b03808f16825263ffffffff808f1660208085019182529682168486019081526001600160f81b03198f166060860190815260008881526013909952959097209351845491519751955160f81c600160c01b0260ff60c01b19968416600160a01b029690961664ffffffffff60a01b1998909316600160801b026001600160a01b031990921693169290921791909117949094169390931717909155600b5580612a2181614261565b9150506128fa565b505b60e08301516001600160a01b031615612ab15760e08301516040516360cb9a0d60e11b81526001600160a01b0382169063c197341a90612a7d908e9086908f908f908f908f908f908f906004016144d8565b600060405180830381600087803b158015612a9757600080fd5b505af1158015612aab573d6000803e3d6000fd5b50505050505b600089815260106020526040902080548891908a908110612ad457612ad4614235565b60009182526020909120018054600890612afc908490600160401b900463ffffffff166144b0565b92506101000a81548163ffffffff021916908363ffffffff16021790555050505050505050505050565b6001600160a01b038416612b4c5760405162461bcd60e51b81526004016108ba9061434f565b33612b6b818787612b5c88613113565b612b6588613113565b87612c99565b6000848152602081815260408083206001600160a01b038a16845290915290205483811015612bac5760405162461bcd60e51b81526004016108ba90614394565b6000858152602081815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290612be99084906142ba565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461174682888888888861325b565b60006001600160e01b03198216636cdb3d1360e11b1480612c7a57506001600160e01b031982166303a24d0760e21b145b8061094457506301ffc9a760e01b6001600160e01b0319831614610944565b60005b835181101561174657600060136000868481518110612cbd57612cbd614235565b60209081029190910181015182528181019290925260409081016000908120825160808101845290546001600160801b038116808352600160801b820463ffffffff90811684880152600160a01b83041683860152600160c01b90910460f81b6001600160f81b03191660608301528252600e90935220600101549091506001600160a01b031615612e095780516001600160801b03166000908152600e602052604090206001015485516001600160a01b039091169081906399829e29908a908a908a9088908110612d9257612d92614235565b6020026020010151898881518110612dac57612dac614235565b6020026020010151896040518663ffffffff1660e01b8152600401612dd5959493929190614533565b600060405180830381600087803b158015612def57600080fd5b505af1158015612e03573d6000803e3d6000fd5b50505050505b5080612e1481614261565b915050612c9c565b6001600160a01b0384163b156122e95760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612e609089908990889088908890600401614578565b6020604051808303816000875af1925050508015612e9b575060408051601f3d908101601f19168201909252612e98918101906145d6565b60015b612f4857612ea76145f3565b806308c379a01415612ee15750612ebc61460f565b80612ec75750612ee3565b8060405162461bcd60e51b81526004016108ba91906134b2565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016108ba565b6001600160e01b0319811663bc197c8160e01b146117465760405162461bcd60e51b81526004016108ba90614698565b60606000612f8783600261430b565b612f929060026142ba565b6001600160401b03811115612fa957612fa96134c5565b6040519080825280601f01601f191660200182016040528015612fd3576020820181803683370190505b509050600360fc1b81600081518110612fee57612fee614235565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061301d5761301d614235565b60200101906001600160f81b031916908160001a905350600061304184600261430b565b61304c9060016142ba565b90505b60018111156130c4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061308057613080614235565b1a60f81b82828151811061309657613096614235565b60200101906001600160f81b031916908160001a90535060049490941c936130bd816146e0565b905061304f565b5083156119775760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108ba565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061314d5761314d614235565b602090810291909101015292915050565b6001600160a01b0384166131be5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108ba565b336131cf81600087612b5c88613113565b6000848152602081815260408083206001600160a01b0389168452909152812080548592906131ff9084906142ba565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46111ab816000878787875b6001600160a01b0384163b156122e95760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061329f9089908990889088908890600401614533565b6020604051808303816000875af19250505080156132da575060408051601f3d908101601f191682019092526132d7918101906145d6565b60015b6132e657612ea76145f3565b6001600160e01b0319811663f23a6e6160e01b146117465760405162461bcd60e51b81526004016108ba90614698565b82805461332290614059565b90600052602060002090601f016020900481019282613344576000855561338a565b82601f1061335d57805160ff191683800117855561338a565b8280016001018555821561338a579182015b8281111561338a57825182559160200191906001019061336f565b5061339692915061339a565b5090565b5b80821115613396576000815560010161339b565b80356001600160a01b038116811461197e57600080fd5b600080604083850312156133d957600080fd5b6133e2836133af565b946020939093013593505050565b60006020828403121561340257600080fd5b5035919050565b6001600160e01b03198116811461341f57600080fd5b50565b60006020828403121561343457600080fd5b813561197781613409565b60006020828403121561345157600080fd5b611977826133af565b60005b8381101561347557818101518382015260200161345d565b8381111561132e5750506000910152565b6000815180845261349e81602086016020860161345a565b601f01601f19169290920160200192915050565b6020815260006119776020830184613486565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613500576135006134c5565b6040525050565b60006001600160401b03821115613520576135206134c5565b5060051b60200190565b600082601f83011261353b57600080fd5b8135602061354882613507565b60405161355582826134db565b83815260059390931b850182019282810191508684111561357557600080fd5b8286015b848110156135905780358352918301918301613579565b509695505050505050565b600082601f8301126135ac57600080fd5b813560206135b982613507565b6040516135c682826134db565b83815260059390931b85018201928281019150868411156135e657600080fd5b8286015b8481101561359057803561ffff811681146136055760008081fd5b83529183019183016135ea565b60006001600160401b0382111561362b5761362b6134c5565b50601f01601f191660200190565b600082601f83011261364a57600080fd5b813561365581613612565b60405161366282826134db565b82815285602084870101111561367757600080fd5b82602086016020830137600092810160200192909252509392505050565b600082601f8301126136a657600080fd5b813560206136b382613507565b6040516136c082826134db565b83815260059390931b85018201928281019150868411156136e057600080fd5b8286015b848110156135905780356001600160401b038111156137035760008081fd5b6137118986838b0101613639565b8452509183019183016136e4565b600082601f83011261373057600080fd5b8135602061373d82613507565b60405161374a82826134db565b83815260059390931b850182019282810191508684111561376a57600080fd5b8286015b848110156135905761377f816133af565b835291830191830161376e565b600082601f83011261379d57600080fd5b813560206137aa82613507565b6040516137b782826134db565b83815260059390931b85018201928281019150868411156137d757600080fd5b8286015b8481101561359057803563ffffffff811681146137f85760008081fd5b83529183019183016137db565b600082601f83011261381657600080fd5b8135602061382382613507565b60405161383082826134db565b83815260059390931b850182019282810191508684111561385057600080fd5b8286015b848110156135905780356001600160401b038111156138735760008081fd5b6138818986838b010161359b565b845250918301918301613854565b8035801515811461197e57600080fd5b600082601f8301126138b057600080fd5b813560206138bd82613507565b604080516138cb83826134db565b848152600594851b87018401948482019350888611156138ea57600080fd5b8488015b8681101561398b5780356001600160401b0381111561390d5760008081fd5b8901603f81018b1361391f5760008081fd5b8681013561392c81613507565b865161393882826134db565b82815291851b830187019189810191508d8311156139565760008081fd5b928701925b8284101561397b5761396c8461388f565b8252928901929089019061395b565b88525050509385019385016138ee565b509098975050505050505050565b600082601f8301126139aa57600080fd5b813560206139b782613507565b6040516139c482826134db565b83815260059390931b85018201928281019150868411156139e457600080fd5b8286015b848110156135905780356001600160401b03811115613a075760008081fd5b613a158986838b010161352a565b8452509183019183016139e8565b60008060008060008060008060008060006101608c8e031215613a4557600080fd5b6001600160401b03808d351115613a5b57600080fd5b613a688e8e358f0161352a565b9b508060208e01351115613a7b57600080fd5b613a8b8e60208f01358f0161352a565b9a508060408e01351115613a9e57600080fd5b613aae8e60408f01358f0161352a565b99508060608e01351115613ac157600080fd5b613ad18e60608f01358f0161359b565b98508060808e01351115613ae457600080fd5b613af48e60808f01358f0161352a565b97508060a08e01351115613b0757600080fd5b613b178e60a08f01358f01613695565b96508060c08e01351115613b2a57600080fd5b613b3a8e60c08f01358f0161371f565b95508060e08e01351115613b4d57600080fd5b613b5d8e60e08f01358f0161378c565b9450806101008e01351115613b7157600080fd5b613b828e6101008f01358f01613805565b9350806101208e01351115613b9657600080fd5b613ba78e6101208f01358f0161389f565b9250806101408e01351115613bbb57600080fd5b50613bcd8d6101408e01358e01613999565b90509295989b509295989b9093969950565b600080600080600060a08688031215613bf757600080fd5b613c00866133af565b9450613c0e602087016133af565b935060408601356001600160401b0380821115613c2a57600080fd5b613c3689838a0161352a565b94506060880135915080821115613c4c57600080fd5b613c5889838a0161352a565b93506080880135915080821115613c6e57600080fd5b50613c7b88828901613639565b9150509295509295909350565b60008060408385031215613c9b57600080fd5b82359150613cab602084016133af565b90509250929050565b60008060008060808587031215613cca57600080fd5b613cd3856133af565b93506020850135925060408501359150613cef6060860161388f565b905092959194509250565b60008060408385031215613d0d57600080fd5b8235915060208301356001600160401b03811115613d2a57600080fd5b613d3685828601613639565b9150509250929050565b60008060408385031215613d5357600080fd5b82356001600160401b0380821115613d6a57600080fd5b613d768683870161371f565b93506020850135915080821115613d8c57600080fd5b50613d368582860161352a565b600081518084526020808501945080840160005b83811015613dc957815187529582019590820190600101613dad565b509495945050505050565b6020815260006119776020830184613d99565b60008060408385031215613dfa57600080fd5b50508035926020909101359150565b60008060408385031215613e1c57600080fd5b613e25836133af565b9150613cab6020840161388f565b600080600080600080600060e0888a031215613e4e57600080fd5b613e57886133af565b965060208801359550604088013594506060880135935060808801356001600160f81b031981168114613e8957600080fd5b925060a0880135915060c08801356001600160401b03811115613eab57600080fd5b613eb78a828b0161352a565b91505092959891949750929550565b600080600060608486031215613edb57600080fd5b613ee4846133af565b95602085013595506040909401359392505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613f4e57603f19888603018452613f3c858351613d99565b94509285019290850190600101613f20565b5092979650505050505050565b60008060408385031215613f6e57600080fd5b613f77836133af565b9150613cab602084016133af565b600060208284031215613f9757600080fd5b81356001600160401b03811115613fad57600080fd5b610b4584828501613639565b600080600080600060a08688031215613fd157600080fd5b613fda866133af565b9450613fe8602087016133af565b9350604086013592506060860135915060808601356001600160401b0381111561401157600080fd5b613c7b88828901613639565b6000806040838503121561403057600080fd5b8235915060208301356001600160401b0381111561404d57600080fd5b613d368582860161352a565b600181811c9082168061406d57607f821691505b60208210811415610b4d57634e487b7160e01b600052602260045260246000fd5b8054600090600181811c90808316806140a857607f831692505b60208084108214156140ca57634e487b7160e01b600052602260045260246000fd5b8180156140de57600181146140ef5761411c565b60ff1986168952848901965061411c565b60008881526020902060005b868110156141145781548b8201529085019083016140fb565b505084890196505b50505050505092915050565b600061413d614137838961408e565b8761408e565b602f60f81b81526001600160f81b031986166001820152601b60fa1b6002820152845161417181600384016020890161345a565b603760f91b60039290910191820152835161419381600484016020880161345a565b64173539b7b760d91b60049290910191820152600901979650505050505050565b6000602082840312156141c657600080fd5b81516001600160401b038111156141dc57600080fd5b8201601f810184136141ed57600080fd5b80516141f881613612565b60405161420582826134db565b82815286602084860101111561421a57600080fd5b61422b83602083016020870161345a565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156142755761427561424b565b5060010190565b600063ffffffff838116908316818110156142995761429961424b565b039392505050565b6000602082840312156142b357600080fd5b5051919050565b600082198211156142cd576142cd61424b565b500190565b6000826142ef57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156143065761430661424b565b500390565b60008160001904831182151516156143255761432561424b565b500290565b600060ff821660ff84168060ff038211156143475761434761424b565b019392505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6040815260006143f16040830185613d99565b82810360208401526144038185613d99565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161444481601785016020880161345a565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161447581602884016020880161345a565b01602801949350505050565b60006001600160401b03808316818516818304811182151516156144a7576144a761424b565b02949350505050565b600063ffffffff8083168185168083038211156144cf576144cf61424b565b01949350505050565b600061010060018060a01b038b16835289602084015288604084015287606084015286608084015260ff60f81b861660a08401528460c08401528060e084015261452481840185613d99565b9b9a5050505050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061456d90830184613486565b979650505050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906145a490830186613d99565b82810360608401526145b68186613d99565b905082810360808401526145ca8185613486565b98975050505050505050565b6000602082840312156145e857600080fd5b815161197781613409565b600060033d111561460c5760046000803e5060005160e01c5b90565b600060443d101561461d5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561464c57505050505090565b82850191508151818111156146645750505050505090565b843d870101602082850101111561467e5750505050505090565b61468d602082860101876134db565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6000816146ef576146ef61424b565b50600019019056fea264697066735822122089484431d19e6bd350ec7e2e9b3830eab32af313313e148a0354050df5df123d64736f6c634300080b00330000000000000000000000000000000000000000000000000000000000000080460000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f0000000000000000000000000000000000000000000000000000000000000007697066733a2f2f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d6567585278756777644c7a4741517639574663466a6d6f576b634144394e6f796e50354b434a6f56364836460000000000000000000000

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

0000000000000000000000000000000000000000000000000000000000000080460000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f0000000000000000000000000000000000000000000000000000000000000007697066733a2f2f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d6567585278756777644c7a4741517639574663466a6d6f576b634144394e6f796e50354b434a6f56364836460000000000000000000000

-----Decoded View---------------
Arg [0] : _uri (string): ipfs://
Arg [1] : _contractChar (bytes1): 0x46
Arg [2] : _contractURIString (string): ipfs://QmegXRxugwdLzGAQv9WFcFjmoWkcAD9NoynP5KCJoV6H6F
Arg [3] : _contractOwner (address): 0x82f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 4600000000000000000000000000000000000000000000000000000000000000
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [5] : 697066733a2f2f00000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [7] : 697066733a2f2f516d6567585278756777644c7a4741517639574663466a6d6f
Arg [8] : 576b634144394e6f796e50354b434a6f56364836460000000000000000000000


Loading