Contract 0xcf60261d0e95a98ea7fbf32661e0738941bcbc33

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x48a17a14c5d0288c08c649fa3f884c8501ff60180da520d43346b238b79a59e60x60a06040268758972022-06-23 17:01:1348 days 12 hrs ago0xa6b2fa18d3e746d3012dabc21e63bcc35e638897 IN  Create: NftProducerPachacuy0 MATIC0.010909703467 2.042858782
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
NftProducerPachacuy

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 20 runs

Other Settings:
default evmVersion
File 1 of 30 : NftProducerPachacuy.sol
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////      ___         ___           ___           ___           ___           ___           ___                  ////
////     /  /\       /  /\         /  /\         /__/\         /  /\         /  /\         /__/\          ___    ////
////    /  /::\     /  /::\       /  /:/         \  \:\       /  /::\       /  /:/         \  \:\        /__/|   ////
////   /  /:/\:\   /  /:/\:\     /  /:/           \__\:\     /  /:/\:\     /  /:/           \  \:\      |  |:|   ////
////  /  /:/~/:/  /  /:/~/::\   /  /:/  ___   ___ /  /::\   /  /:/~/::\   /  /:/  ___   ___  \  \:\     |  |:|   ////
//// /__/:/ /:/  /__/:/ /:/\:\ /__/:/  /  /\ /__/\  /:/\:\ /__/:/ /:/\:\ /__/:/  /  /\ /__/\  \__\:\  __|__|:|   ////
//// \  \:\/:/   \  \:\/:/__\/ \  \:\ /  /:/ \  \:\/:/__\/ \  \:\/:/__\/ \  \:\ /  /:/ \  \:\ /  /:/ /__/::::\   ////
////  \  \::/     \  \::/       \  \:\  /:/   \  \::/       \  \::/       \  \:\  /:/   \  \:\  /:/     ~\~~\:\  ////
////   \  \:\      \  \:\        \  \:\/:/     \  \:\        \  \:\        \  \:\/:/     \  \:\/:/        \  \:\ ////
////    \  \:\      \  \:\        \  \::/       \  \:\        \  \:\        \  \::/       \  \::/          \__\/ ////
////     \__\/       \__\/         \__\/         \__\/         \__\/         \__\/         \__\/                 ////
////                                                                                                             ////
////                                                 LAND OF CUYS                                                ////
////                                            NFT PRODUCER PACHACUY                                            ////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";

// Interfaces
import "../tatacuy/ITatacuy.sol";
import "../wiracocha/IWiracocha.sol";
import "../chakra/IChakra.sol";
import "../hatunwasi/IHatunWasi.sol";
import "../info/IPachacuyInfo.sol";
import "../misayWasi/IMisayWasi.sol";
import "../guineapig/IGuineaPig.sol";
import "../pacha/IPacha.sol";
import "../qhatuwasi/IQhatuWasi.sol";

/// @custom:security-contact [email protected]
contract NftProducerPachacuy is
    Initializable,
    ERC1155Upgradeable,
    AccessControlUpgradeable,
    ERC1155SupplyUpgradeable,
    PausableUpgradeable,
    ERC1155BurnableUpgradeable,
    UUPSUpgradeable
{
    bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE");
    bytes32 public constant GAME_MANAGER = keccak256("GAME_MANAGER");

    IPachacuyInfo pachacuyInfo;

    using CountersUpgradeable for CountersUpgradeable.Counter;
    CountersUpgradeable.Counter private _tokenIdCounter;

    // NFT types
    bytes32 public constant TATACUY = keccak256("TATACUY");
    bytes32 public constant WIRACOCHA = keccak256("WIRACOCHA");
    bytes32 public constant CHAKRA = keccak256("CHAKRA");
    bytes32 public constant HATUNWASI = keccak256("HATUNWASI");
    bytes32 public constant MISAYWASI = keccak256("MISAYWASI");
    bytes32 public constant QHATUWASI = keccak256("QHATUWASI");
    bytes32 public constant GUINEAPIG = keccak256("GUINEAPIG");
    bytes32 public constant PACHA = keccak256("PACHA");
    bytes32 public constant TICKETRAFFLE = keccak256("TICKETRAFFLE");
    bytes32 public constant PACHAPASS = keccak256("PACHAPASS");

    event Uuid(uint256 uuid);
    event UuidAndAmount(uint256 uuid, uint256 amount);

    // Map owner -> uuid[]
    mapping(address => uint256[]) internal _ownerToUuids;

    // Token name
    string internal _name;
    // Token symbol
    string internal _symbol;
    // Token prefix
    string internal _prefix;

    // Map uuid with NFT type
    mapping(uint256 => bytes32) internal _nftTypes;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {}

    function initialize(string memory name_, string memory symbol_)
        public
        initializer
    {
        _prefix = "ipfs://QmbbGgo93M6yr5WSUMj53SWN2vC7L6aMS1GZSPNkVRY8e4/";

        __ERC1155_init(_prefix);
        __AccessControl_init();
        __Pausable_init();
        __ERC1155Burnable_init();
        __ERC1155Supply_init();
        __UUPSUpgradeable_init();

        _name = name_;
        _symbol = symbol_;

        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _grantRole(URI_SETTER_ROLE, _msgSender());
        _grantRole(PAUSER_ROLE, _msgSender());
        _grantRole(MINTER_ROLE, _msgSender());
        _grantRole(UPGRADER_ROLE, _msgSender());
        _grantRole(GAME_MANAGER, _msgSender());

        // starts counter at one
        _tokenIdCounter.increment();
    }

    function mintGuineaPigNft(
        address _account,
        uint256 _gender, // 0, 1
        uint256 _race, // 1 -> 4
        uint256 _idForJsonFile, // 1 -> 8
        uint256 _price
    ) public onlyRole(MINTER_ROLE) returns (uint256) {
        // Creates a UUID for each mint
        uint256 uuid = _tokenIdCounter.current();
        _mint(_account, uuid, 1, "");
        // Map owner -> uuid[]
        // save in list of uuids for owner
        _ownerToUuids[_account].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = GUINEAPIG;

        // Save info in Guinea Pig SC
        IGuineaPig(pachacuyInfo.guineaPigAddress()).registerGuineaPig(
            _account,
            _gender,
            _race,
            _idForJsonFile,
            uuid,
            _price
        );

        _setApprovalForAll(_account, address(this), true);

        _tokenIdCounter.increment();
        emit Uuid(uuid);

        return uuid;
    }

    function mintLandNft(
        address _account,
        uint256 _idForJsonFile, // comes from front-end 1 -> 697
        uint256 _price,
        bytes memory data
    ) public onlyRole(MINTER_ROLE) returns (uint256) {
        // Veryfies that location is not taken already
        require(
            !IPacha(pachacuyInfo.pachaAddress()).isPachaAlreadyTaken(
                _idForJsonFile
            ),
            "NFP: location taken"
        );

        // Creates a UUID for each mint
        uint256 uuid = _tokenIdCounter.current();
        _mint(_account, uuid, 1, data);

        // Map owner -> uuid[]
        _ownerToUuids[_account].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = PACHA;

        // Map uuid -> Guinea Pig Struct
        IPacha(pachacuyInfo.pachaAddress()).registerPacha(
            _account,
            _idForJsonFile,
            uuid,
            _price
        );

        _tokenIdCounter.increment();
        emit Uuid(uuid);

        return uuid;
    }

    function mintWiracocha(uint256 _pachaUuid) external returns (uint256) {
        // validate that _account is an owner of that pacha
        require(balanceOf(_msgSender(), _pachaUuid) > 0, "NFP: No pacha found");

        // validate that there is not a Wiracocha at this pacha uuid
        require(
            !IWiracocha(pachacuyInfo.wiracochaAddress()).hasWiracocha(
                _msgSender(),
                _pachaUuid
            ),
            "NFP: Pacha has a Wiracocha already"
        );

        uint256 uuid = _tokenIdCounter.current();
        _mint(_msgSender(), uuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_msgSender()].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = WIRACOCHA;

        // Save info in Tatacuy SC
        // uuid =>  wiracochaUuid
        IWiracocha(pachacuyInfo.wiracochaAddress()).registerWiracocha(
            _msgSender(),
            _pachaUuid,
            uuid,
            ""
        );

        _tokenIdCounter.increment();

        emit Uuid(uuid);
        return uuid;
    }

    function mintTatacuy(uint256 _pachaUuid) external returns (uint256) {
        // validate that _account is an owner of that pacha
        require(balanceOf(_msgSender(), _pachaUuid) > 0, "NFP: No pacha found");

        uint256 uuid = _tokenIdCounter.current();
        _mint(_msgSender(), uuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_msgSender()].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = TATACUY;

        // Save info in Tatacuy SC
        // uuid =>  tatacuyUuid
        ITatacuy(pachacuyInfo.tatacuyAddress()).registerTatacuy(
            _msgSender(),
            _pachaUuid,
            uuid,
            ""
        );

        _tokenIdCounter.increment();

        emit Uuid(uuid);
        return uuid;
    }

    function mintChakra(
        address _account,
        uint256 _pachaUuid,
        uint256 _chakraPrice
    ) external onlyRole(MINTER_ROLE) returns (uint256) {
        // validate that _account is an owner of that pacha
        require(balanceOf(_account, _pachaUuid) > 0, "NFP: No pacha found");

        uint256 uuid = _tokenIdCounter.current();
        _mint(_account, uuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_account].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = CHAKRA;

        // Save info in Chakra SC
        IChakra(pachacuyInfo.chakraAddress()).registerChakra(
            _account,
            _pachaUuid,
            uuid,
            _chakraPrice
        );

        _tokenIdCounter.increment();
        emit Uuid(uuid);
        return uuid;
    }

    function purchaseFood(
        uint256 _chakraUuid,
        uint256 _amountFood,
        uint256 _guineaPigUuid
    ) external onlyRole(GAME_MANAGER) returns (uint256 availableFood) {
        // update Guinea Pig life span
        IGuineaPig(pachacuyInfo.guineaPigAddress()).feedGuineaPig(
            _guineaPigUuid
        );

        availableFood = IChakra(pachacuyInfo.chakraAddress())
            .consumeFoodFromChakra(_chakraUuid, _amountFood);
    }

    function burnChakra(uint256 _chakraUuid) external {
        _burn(_msgSender(), _chakraUuid, 1);

        IChakra(pachacuyInfo.chakraAddress()).burnChakra(_chakraUuid);
    }

    function mintHatunWasi(uint256 _pachaUuid) external returns (uint256) {
        // validate that _account is an owner of that pacha
        require(balanceOf(_msgSender(), _pachaUuid) > 0, "NFP: No pacha found");

        // validate that there is not a Wiracocha at this pacha uuid
        IHatunWasi hw = IHatunWasi(pachacuyInfo.hatunWasiAddress());
        require(!hw.hasHatunWasi(_msgSender()), "NFP: Hatun Wasi exists");

        uint256 uuid = _tokenIdCounter.current();
        _mint(_msgSender(), uuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_msgSender()].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = HATUNWASI;

        // Save info in Hatun Wasi SC
        // uuid =>  hatunWasiUuid
        hw.registerHatunWasi(_msgSender(), _pachaUuid, uuid);

        _tokenIdCounter.increment();

        emit Uuid(uuid);
        return uuid;
    }

    function mintMisayWasi(
        address _account,
        uint256 _pachaUuid,
        uint256 _misayWasiPrice
    ) external onlyRole(GAME_MANAGER) {
        // validate that _account is an owner of that pacha
        require(balanceOf(_account, _pachaUuid) > 0, "NFP: No pacha found");

        uint256 uuid = _tokenIdCounter.current();
        _mint(_account, uuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_account].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = MISAYWASI;

        // Save info in Misay Wasi SC
        IMisayWasi(pachacuyInfo.misayWasiAddress()).registerMisayWasi(
            _account,
            _pachaUuid,
            uuid,
            _misayWasiPrice
        );

        _tokenIdCounter.increment();

        emit Uuid(uuid);
    }

    function createTicketIdRaffle()
        external
        onlyRole(GAME_MANAGER)
        returns (uint256 _raffleUuid)
    {
        uint256 uuid = _tokenIdCounter.current();
        _tokenIdCounter.increment();

        // save type of uuid minted
        _nftTypes[uuid] = TICKETRAFFLE;

        return uuid;
    }

    function createPachaPassId()
        external
        onlyRole(GAME_MANAGER)
        returns (uint256 _pachaPassUuid)
    {
        uint256 uuid = _tokenIdCounter.current();
        _tokenIdCounter.increment();

        // save type of uuid minted
        _nftTypes[uuid] = PACHAPASS;

        return uuid;
    }

    /**
     * @notice Used when someone is purchasing a pacha pass
     * @notice Only callable by Purchase Asset Controller
     */
    function mintPachaPass(
        address _account,
        uint256 _pachaUuid,
        uint256 _pachaPassUuid
    ) external onlyRole(GAME_MANAGER) {
        require(balanceOf(_account, _pachaPassUuid) == 0, "NFP: has one");

        _mint(_account, _pachaPassUuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_account].push(_pachaPassUuid);

        IPacha(pachacuyInfo.pachaAddress()).registerPachaPass(
            _account,
            _pachaUuid,
            _pachaPassUuid,
            "puchased"
        );

        emit Uuid(_pachaPassUuid);
    }

    /**
     * @notice Mints a Pacha Pass when the Pacha has chose typeDistribution = 1 (no public sale)
     * @param _accounts: list of wallet address that will receive a pacha pass
     * @param _pachaUuid: uuid of the Pacha from where the Pacha Passes will be minted
     */
    function mintPachaPassAsOwner(
        address[] memory _accounts,
        uint256 _pachaUuid
    ) external {
        IPacha.PachaInfo memory pacha = IPacha(pachacuyInfo.pachaAddress())
            .getPachaWithUuid(_pachaUuid);

        require(pacha.owner == _msgSender(), "NFP: Not the owner");
        require(pacha.isPacha, "NFP: Not a pacha");
        require(!pacha.isPublic, "NFP: Land must be private");
        require(pacha.pachaPassUuid > 0, "NFP: PachaPass do not exist");

        uint256 _pachaPassUuid = pacha.pachaPassUuid;
        address pachaSCAddress = pachacuyInfo.pachaAddress();
        for (uint256 i = 0; i < _accounts.length; i++) {
            _mint(_accounts[i], _pachaPassUuid, 1, "");

            IPacha(pachaSCAddress).registerPachaPass(
                _accounts[i],
                _pachaUuid,
                _pachaPassUuid,
                "transferred"
            );
        }

        emit Uuid(_pachaPassUuid);
    }

    function purchaseTicketRaffle(
        address _account,
        uint256 _ticketUuid,
        uint256 _misayWasiUuid,
        uint256 _amountOfTickets
    ) external onlyRole(GAME_MANAGER) {
        // has tickets already?
        bool newCustomer = balanceOf(_account, _ticketUuid) == 0;

        // mint the tickets of the raffle
        _mint(_account, _ticketUuid, _amountOfTickets, "");

        // save in list of uuids for owner
        _ownerToUuids[_account].push(_ticketUuid);

        IMisayWasi(pachacuyInfo.misayWasiAddress()).registerTicketPurchase(
            _account,
            _misayWasiUuid,
            _amountOfTickets,
            newCustomer
        );
        emit UuidAndAmount(_ticketUuid, balanceOf(_account, _ticketUuid));
    }

    function mintQhatuWasi(
        uint256 _pachaUuid,
        address _account,
        uint256 _qhatuWasiPrice
    ) external onlyRole(MINTER_ROLE) {
        // validate that _account is an owner of that pacha
        require(balanceOf(_account, _pachaUuid) > 0, "NFP: No pacha found");

        uint256 uuid = _tokenIdCounter.current();
        _mint(_account, uuid, 1, "");

        // save in list of uuids for owner
        _ownerToUuids[_account].push(uuid);

        // save type of uuid minted
        _nftTypes[uuid] = QHATUWASI;

        IQhatuWasi(pachacuyInfo.qhatuWasiAddress()).registerQhatuWasi(
            uuid,
            _account,
            _qhatuWasiPrice
        );

        emit Uuid(uuid);
        _tokenIdCounter.increment();
    }

    // function safeTransferFrom(
    //     address from,
    //     address to,
    //     uint256 uuid,
    //     uint256 amount,
    //     bytes memory data
    // ) public override {
    //     require(
    //         from == _msgSender() || isApprovedForAll(from, _msgSender()),
    //         "ERC1155: caller is not owner nor approved"
    //     );

    //     if (_uuidToGuineaPigData[uuid].isGuineaPig) {
    //         _uuidToGuineaPigData[uuid].owner = to;
    //     } else if (_uuidToLandData[uuid].isLand) {
    //         _uuidToLandData[uuid].owner = to;
    //         // Transfer all elements within a Land
    //         // IMPLEMENT
    //     }

    //     // remove uuid from _ownerToUuids => uuid[]
    //     _rmvElFromOwnerToUuids(from, uuid);

    //     // add that uuid to new owner's array
    //     _ownerToUuids[to].push(uuid);

    //     _safeTransferFrom(from, to, uuid, amount, data);
    // }

    // function burn(
    //     address account,
    //     uint256 uuid,
    //     uint256 value
    // ) public virtual override {
    //     require(
    //         account == _msgSender() || isApprovedForAll(account, _msgSender()),
    //         "ERC1155: caller is not owner nor approved"
    //     );

    //     if (_uuidToGuineaPigData[uuid].isGuineaPig) {
    //         value = 1;
    //         delete _uuidToGuineaPigData[uuid];
    //     } else if (_uuidToLandData[uuid].isLand) {
    //         value = 1;
    //         delete _uuidToLandData[uuid];
    //     }

    //     // remove uuid from _ownerToUuids => uuid[]
    //     _rmvElFromOwnerToUuids(account, uuid);

    //     _burn(account, uuid, value);
    // }

    ///////////////////////////////////////////////////////////////
    ////                   HELPERS FUNCTIONS                   ////
    ///////////////////////////////////////////////////////////////
    /**
     * @notice Indicates whether a Guinea Pig is allows to enter a Pacha
     * @param _account Wallet to be validated against the Pacha
     * @param _pachaUuid Uuid of the pacha to check the access of _account
     */
    function isGuineaPigAllowedInPacha(address _account, uint256 _pachaUuid)
        external
        view
        returns (bool)
    {
        IPacha.PachaInfo memory pacha = IPacha(pachacuyInfo.pachaAddress())
            .getPachaWithUuid(_pachaUuid);

        // pacha do not exist
        if (!pacha.isPacha) return false;
        // pacha is public
        if (pacha.isPublic) return true;

        // All private land must have a uuid for its pachapass
        require(pacha.pachaPassUuid > 0, "NFP: Uuid's pachapass missing");
        if (balanceOf(_account, pacha.pachaPassUuid) > 0) {
            return true;
        } else return false;
    }

    function _compareStrings(string memory a, string memory b)
        internal
        pure
        returns (bool)
    {
        return (keccak256(abi.encodePacked((a))) ==
            keccak256(abi.encodePacked((b))));
    }

    // function _rmvElFromOwnerToUuids(address _account, uint256 _uuid) internal {
    //     require(_ownerToUuids[_account].length > 0, "NFP: Array is empty");

    //     if (_ownerToUuids[_account].length == 1) {
    //         if (_ownerToUuids[_account][0] == _uuid) {
    //             _ownerToUuids[_account].pop();
    //             return;
    //         } else {
    //             revert("NFP: Not found");
    //         }
    //     }

    //     // find the index of _uuid
    //     uint256 i;
    //     for (i = 0; i < _ownerToUuids[_account].length; i++) {
    //         if (_ownerToUuids[_account][i] == _uuid) break;
    //     }
    //     require(i != _ownerToUuids[_account].length, "NFP: Not found");

    //     // remove the element
    //     _ownerToUuids[_account][i] = _ownerToUuids[_account][
    //         _ownerToUuids[_account].length - 1
    //     ];
    //     _ownerToUuids[_account].pop();
    // }

    function getListOfUuidsPerAccount(address _account)
        external
        view
        returns (uint256[] memory _listOfUuids, bytes32[] memory _listOfTypes)
    {
        _listOfUuids = _ownerToUuids[_account];
        _listOfTypes = new bytes32[](_listOfUuids.length);
        for (uint256 ix = 0; ix < _listOfUuids.length; ix++) {
            _listOfTypes[ix] = _nftTypes[_listOfUuids[ix]];
        }
    }

    function setPachacuyInfoaddress(address _pachacuyInfo)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        pachacuyInfo = IPachacuyInfo(_pachacuyInfo);
    }

    ///////////////////////////////////////////////////////////////
    ////               ERC1155 STANDARD FUNCTIONS              ////
    ///////////////////////////////////////////////////////////////
    function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) {
        _prefix = newuri;
        _setURI(newuri);
    }

    function tokenURI(uint256 _uuid) public view returns (string memory) {
        require(exists(_uuid), "NFP: Not minted.");

        string memory fileName = ITokenUri(
            pachacuyInfo.getAddressOfNftType(_nftTypes[_uuid])
        ).tokenUri(_prefix, _uuid);

        return bytes(_prefix).length > 0 ? fileName : "";
    }

    function uri(uint256 _uuid) public view override returns (string memory) {
        return tokenURI(_uuid);
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public pure returns (uint8) {
        return 0;
    }

    function pause() public onlyRole(PAUSER_ROLE) {
        _pause();
    }

    function unpause() public onlyRole(PAUSER_ROLE) {
        _unpause();
    }

    // Have a look later
    // function mintBatch(
    //     address to,
    //     uint256[] memory ids,
    //     uint256[] memory amounts,
    //     bytes memory data
    // ) public onlyRole(MINTER_ROLE) {
    //     _mintBatch(to, ids, amounts, data);
    // }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        internal
        override(ERC1155Upgradeable, ERC1155SupplyUpgradeable)
        whenNotPaused
    {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    function _authorizeUpgrade(address newImplementation)
        internal
        override
        onlyRole(UPGRADER_ROLE)
    {}

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC1155Upgradeable, AccessControlUpgradeable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}

File 2 of 30 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
    using AddressUpgradeable 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}.
     */
    function __ERC1155_init(string memory uri_) internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155_init_unchained(uri_);
    }

    function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
        _setURI(uri_);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
        return
            interfaceId == type(IERC1155Upgradeable).interfaceId ||
            interfaceId == type(IERC1155MetadataURIUpgradeable).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 IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155ReceiverUpgradeable.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 IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155ReceiverUpgradeable.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;
    }
    uint256[47] private __gap;
}

File 3 of 30 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __AccessControl_init_unchained();
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    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(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view 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 {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.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 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());
        }
    }
    uint256[49] private __gap;
}

File 4 of 30 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
    uint256[49] private __gap;
}

File 5 of 30 : ERC1155SupplyUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Supply.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Extension of ERC1155 that adds tracking of total supply per id.
 *
 * Useful for scenarios where Fungible and Non-fungible tokens have to be
 * clearly identified. Note: While a totalSupply of 1 might mean the
 * corresponding is an NFT, there is no guarantees that no other token with the
 * same id are not going to be minted.
 */
abstract contract ERC1155SupplyUpgradeable is Initializable, ERC1155Upgradeable {
    function __ERC1155Supply_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155Supply_init_unchained();
    }

    function __ERC1155Supply_init_unchained() internal onlyInitializing {
    }
    mapping(uint256 => uint256) private _totalSupply;

    /**
     * @dev Total amount of tokens in with a given id.
     */
    function totalSupply(uint256 id) public view virtual returns (uint256) {
        return _totalSupply[id];
    }

    /**
     * @dev Indicates whether any token exist with a given id, or not.
     */
    function exists(uint256 id) public view virtual returns (bool) {
        return ERC1155SupplyUpgradeable.totalSupply(id) > 0;
    }

    /**
     * @dev See {ERC1155-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                _totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                _totalSupply[ids[i]] -= amounts[i];
            }
        }
    }
    uint256[49] private __gap;
}

File 6 of 30 : ERC1155BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Extension of {ERC1155} that allows token holders to destroy both their
 * own tokens and those that they have been approved to use.
 *
 * _Available since v3.1._
 */
abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable {
    function __ERC1155Burnable_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155Burnable_init_unchained();
    }

    function __ERC1155Burnable_init_unchained() internal onlyInitializing {
    }
    function burn(
        address account,
        uint256 id,
        uint256 value
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burn(account, id, value);
    }

    function burnBatch(
        address account,
        uint256[] memory ids,
        uint256[] memory values
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burnBatch(account, ids, values);
    }
    uint256[50] private __gap;
}

File 7 of 30 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 8 of 30 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
        __ERC1967Upgrade_init_unchained();
        __UUPSUpgradeable_init_unchained();
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
    uint256[50] private __gap;
}

File 9 of 30 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library CountersUpgradeable {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 10 of 30 : ITatacuy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ITatacuy {
    struct TatacuyInfo {
        bool hasTatacuy;
    }

    function registerTatacuy(
        address _account,
        uint256 _pachaUuid,
        uint256 _uuid,
        bytes memory data
    ) external;
}

File 11 of 30 : IWiracocha.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IWiracocha {
    struct WiracochaInfo {
        bool hasWiracocha;
    }

    function hasWiracocha(address _account, uint256 _pachaUuid)
        external
        view
        returns (bool);

    function registerWiracocha(
        address _account,
        uint256 _pachaUuid,
        uint256 _wiracochaUuid,
        bytes memory data
    ) external;
}

File 12 of 30 : IChakra.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IChakra {
    struct ChakraInfo {
        address owner;
        uint256 chakraUuid;
        uint256 pachaUuid;
        uint256 creationDate;
        uint256 priceOfChakra;
        uint256 pricePerFood;
        uint256 totalFood;
        uint256 availableFood;
        bool hasChakra;
    }

    function registerChakra(
        address _account,
        uint256 _pachaUuid,
        uint256 _chackraUuid,
        uint256 _chakraPrice
    ) external;

    function getChakraWithUuid(uint256 _chakraUuid)
        external
        returns (ChakraInfo memory);

    function consumeFoodFromChakra(uint256 _chakraUuid, uint256 _amountFood)
        external
        returns (uint256);

    function burnChakra(uint256 _chakraUuid) external;
}

File 13 of 30 : IHatunWasi.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IHatunWasi {
    struct HatunWasiInfo {
        bool hasHatunWasi;
    }

    function hasHatunWasi(address _account) external view returns (bool);

    function registerHatunWasi(
        address _account,
        uint256 _pachaUuid,
        uint256 _hatunWasiUuid
    ) external;

    function burnHatunWasi(address _account, uint256 _pachaUuid) external;
}

File 14 of 30 : IPachacuyInfo.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ITokenUri {
    function tokenUri(string memory _prefix, uint256 _uuid)
        external
        view
        returns (string memory);
}

interface IPachacuyInfo {
    function totalFood() external returns (uint256);

    function pricePerFood() external returns (uint256);

    function chakraAddress() external view returns (address);

    function wiracochaAddress() external view returns (address);

    function tatacuyAddress() external view returns (address);

    function poolRewardAddress() external view returns (address);

    function hatunWasiAddress() external view returns (address);

    function purchaseACAddress() external view returns (address);

    function pachaCuyTokenAddress() external view returns (address);

    function misayWasiAddress() external view returns (address);

    function nftProducerAddress() external view returns (address);

    function guineaPigAddress() external view returns (address);

    function randomNumberGAddress() external view returns (address);

    function binarySearchAddress() external view returns (address);

    function pachaAddress() external view returns (address);

    function qhatuWasiAddress() external view returns (address);

    //////////////////////////////////////////////////////////////////
    ///                          TAXES/FEES                        ///
    //////////////////////////////////////////////////////////////////

    function raffleTax() external returns (uint256);

    function purchaseTax() external returns (uint256);

    function qhatuWasiTax() external returns (uint256);

    //////////////////////////////////////////////////////////////////
    ///                  BUSINESS PRICES (BUSD)                    ///
    //////////////////////////////////////////////////////////////////
    function chakraPrice() external returns (uint256);

    function pachaPrice() external returns (uint256);

    function qhatuWasiPrice() external returns (uint256);

    function misayWasiPrice() external returns (uint256);

    function getPriceInPcuy(bytes memory _type) external returns (uint256);

    //////////////////////////////////////////////////////////////////
    ///                       EXCHANGE RATE                        ///
    //////////////////////////////////////////////////////////////////
    function exchangeRatePcuyToSami() external returns (uint256);

    function exchangeRateBusdToPcuy() external returns (uint256);

    function convertBusdToPcuy(uint256 _busdAmount)
        external
        returns (uint256 _pacuyAmount);

    function convertPcuyToSami(uint256 _pcuyAmount)
        external
        returns (uint256 _samiPoints);

    function convertSamiToPcuy(uint256 _samiAmount)
        external
        returns (uint256 _pcuyAmount);

    //////////////////////////////////////////////////////////////////
    ///                      ADDRESS RETRIEVAL                     ///
    //////////////////////////////////////////////////////////////////

    function getAddressOfNftType(bytes32 _type) external view returns (address);
}

File 15 of 30 : IMisayWasi.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

interface IMisayWasi {
    struct MisayWasiInfo {
        address owner;
        uint256 misayWasiUuid;
        uint256 pachaUuid;
        uint256 creationDate;
        uint256 ticketPrice;
        uint256 ticketUuid;
        uint256 misayWasiPrice;
        uint256 rafflePrize;
        uint256 numberTicketsPurchased;
        uint256 campaignStartDate;
        uint256 campaignEndDate;
        bool isCampaignActive;
        bool hasMisayWasi;
        address[] listOfParticipants;
    }

    function registerMisayWasi(
        address _account,
        uint256 _pachaUuid,
        uint256 _misayWasiUuid,
        uint256 _misayWasiPrice
    ) external;

    function getMisayWasiWithUuid(uint256 _misayWasiUuid)
        external
        returns (MisayWasiInfo memory);

    function registerTicketPurchase(
        address _account,
        uint256 _misayWasiUuid,
        uint256 _amountOfTickets,
        bool newCustomer
    ) external;
}

File 16 of 30 : IGuineaPig.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IGuineaPig {
    function registerGuineaPig(
        address _account,
        uint256 _gender,
        uint256 _race,
        uint256 _idForJsonFile,
        uint256 _guineaPigUuid,
        uint256 _price
    ) external;

    function getRaceGenderGuineaPig(
        uint256 _ix,
        uint256 _raceRN, // [1, 100]
        uint256 _genderRN // [0, 1]
    )
        external
        returns (
            uint256,
            uint256,
            uint256,
            string memory
        );

    function feedGuineaPig(uint256 _guineaPigUuid) external;

    function tokenUri(string memory _prefix, uint256 _guineaPigUuid)
        external
        view
        returns (string memory);
}

File 17 of 30 : IPacha.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IPacha {
    struct PachaInfo {
        bool isPacha;
        bool isPublic;
        uint256 uuid;
        uint256 pachaPassUuid;
        uint256 pachaPassPrice;
        uint256 typeOfDistribution;
        uint256 idForJsonFile;
        uint256 wasPurchased;
        uint256 location;
        address owner;
        uint256 price;
        address[] listPachaPassOwners;
    }

    function registerPacha(
        address _account,
        uint256 _idForJsonFile,
        uint256 _pachaUuid,
        uint256 _price
    ) external;

    function isPachaAlreadyTaken(uint256 _location) external returns (bool);

    function tokenUri(string memory _prefix, uint256 _pachaUuid)
        external
        view
        returns (string memory);

    function getPachaWithUuid(uint256 _pachaUuid)
        external
        view
        returns (PachaInfo memory);

    function registerPachaPass(
        address _account,
        uint256 _pachaUuid,
        uint256 _pachaPassUuid,
        string memory _transferMode
    ) external;
}

File 18 of 30 : IQhatuWasi.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IQhatuWasi {
    function registerQhatuWasi(
        uint256 _qhatuWasiUuid,
        address _owner,
        uint256 _qhatuWasiPrice
    ) external;
}

File 19 of 30 : IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.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 IERC1155Upgradeable is IERC165Upgradeable {
    /**
     * @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 20 of 30 : IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
    /**
        @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.
        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. 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 21 of 30 : IERC1155MetadataURIUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155Upgradeable.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 IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {
    /**
     * @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 22 of 30 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 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 23 of 30 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

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

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 25 of 30 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 26 of 30 : IAccessControlUpgradeable.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 IAccessControlUpgradeable {
    /**
     * @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 27 of 30 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 28 of 30 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
        __ERC1967Upgrade_init_unchained();
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            _functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }
    uint256[50] private __gap;
}

File 29 of 30 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 30 of 30 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"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":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"uuid","type":"uint256"}],"name":"Uuid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"uuid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UuidAndAmount","type":"event"},{"inputs":[],"name":"CHAKRA","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":"GAME_MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUINEAPIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HATUNWASI","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":[],"name":"MISAYWASI","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PACHA","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PACHAPASS","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"QHATUWASI","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TATACUY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TICKETRAFFLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"URI_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WIRACOCHA","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chakraUuid","type":"uint256"}],"name":"burnChakra","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createPachaPassId","outputs":[{"internalType":"uint256","name":"_pachaPassUuid","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createTicketIdRaffle","outputs":[{"internalType":"uint256","name":"_raffleUuid","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getListOfUuidsPerAccount","outputs":[{"internalType":"uint256[]","name":"_listOfUuids","type":"uint256[]"},{"internalType":"bytes32[]","name":"_listOfTypes","type":"bytes32[]"}],"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":"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":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"initialize","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":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_pachaUuid","type":"uint256"}],"name":"isGuineaPigAllowedInPacha","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_pachaUuid","type":"uint256"},{"internalType":"uint256","name":"_chakraPrice","type":"uint256"}],"name":"mintChakra","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_gender","type":"uint256"},{"internalType":"uint256","name":"_race","type":"uint256"},{"internalType":"uint256","name":"_idForJsonFile","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"mintGuineaPigNft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pachaUuid","type":"uint256"}],"name":"mintHatunWasi","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_idForJsonFile","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintLandNft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_pachaUuid","type":"uint256"},{"internalType":"uint256","name":"_misayWasiPrice","type":"uint256"}],"name":"mintMisayWasi","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_pachaUuid","type":"uint256"},{"internalType":"uint256","name":"_pachaPassUuid","type":"uint256"}],"name":"mintPachaPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256","name":"_pachaUuid","type":"uint256"}],"name":"mintPachaPassAsOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pachaUuid","type":"uint256"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_qhatuWasiPrice","type":"uint256"}],"name":"mintQhatuWasi","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pachaUuid","type":"uint256"}],"name":"mintTatacuy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pachaUuid","type":"uint256"}],"name":"mintWiracocha","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chakraUuid","type":"uint256"},{"internalType":"uint256","name":"_amountFood","type":"uint256"},{"internalType":"uint256","name":"_guineaPigUuid","type":"uint256"}],"name":"purchaseFood","outputs":[{"internalType":"uint256","name":"availableFood","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_ticketUuid","type":"uint256"},{"internalType":"uint256","name":"_misayWasiUuid","type":"uint256"},{"internalType":"uint256","name":"_amountOfTickets","type":"uint256"}],"name":"purchaseTicketRaffle","outputs":[],"stateMutability":"nonpayable","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":"address","name":"_pachacuyInfo","type":"address"}],"name":"setPachacuyInfoaddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_uuid","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_uuid","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60a06040523060601b6080523480156200001857600080fd5b50600054610100900460ff16620000365760005460ff161562000040565b62000040620000e5565b620000a85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000cb576000805461ffff19166101011790555b8015620000de576000805461ff00191690555b5062000109565b6000620000fd306200010360201b6200365e1760201c565b15905090565b3b151590565b60805160601c615f2c6200013d60003960008181611461015281816114a10152818161232701526123670152615f2c6000f3fe6080604052600436106102cc5760003560e01c806366214b901161017757806366214b901461072e5780636b20c4541461074e5780637f3457101461076e5780638456cb59146107905780638a2c29cd146107a55780638c58bde7146107d95780638dd28ad0146107f957806391d148541461080e57806395d89b411461082e57806396e7f475146108435780639cc7d86e14610865578063a1610a7f14610899578063a217fddf146108b9578063a22cb465146108ce578063bb146118146108ee578063bd85b03914610903578063c37494e714610930578063c87b56dd14610964578063ca82cd6314610984578063d36fb18c146109a4578063d5391393146109c4578063d547741f146109e6578063d8104f7f14610a06578063e63ab1e914610a3a578063e985e9c514610a5c578063f079d4d614610aa5578063f242432a14610ad9578063f5298aca14610af9578063f72c0d8b14610b19578063fe63fd3514610b3b578063ff76e91314610b5b57600080fd5b8062fdd58e146102d157806301ffc9a71461030457806302fe53051461033457806306fdde03146103565780630bb6e81d146103785780630de090e3146103ac5780630e89341c146103e057806310f81b411461040057806318471f5514610420578063187db0ed146104405780631dc0dc9d1461047457806323bb4d5914610494578063248a9ca3146104c25780632eb2c2d6146104e25780632f2ff15d14610502578063313ce56714610522578063358549c51461053e57806336568abe146105725780633659cfe61461059257806337226a7e146105b25780633f4ba83a146105d257806347eaa4ed146105e757806348d3c4de1461060757806348d7afc2146106275780634cd88b76146106475780634d848dfc146106675780634e1273f4146106875780634f1ef286146106b45780634f558e79146106c7578063565ad8e8146106f65780635c975abb14610716575b600080fd5b3480156102dd57600080fd5b506102f16102ec366004615010565b610b8f565b6040519081526020015b60405180910390f35b34801561031057600080fd5b5061032461031f36600461523c565b610c2b565b60405190151581526020016102fb565b34801561034057600080fd5b5061035461034f366004615274565b610c36565b005b34801561036257600080fd5b5061036b610c71565b6040516102fb919061573e565b34801561038457600080fd5b506102f17f4b4945eddd0dde5d1c7ae83059c09acf131bbaa2c851587e084ae21ef187194681565b3480156103b857600080fd5b506102f17f5a394fcd9346b08f6dc23744d51bc220a6c8ec7eda9f7e25697094936b90623d81565b3480156103ec57600080fd5b5061036b6103fb366004615200565b610d04565b34801561040c57600080fd5b5061035461041b366004615200565b610d0f565b34801561042c57600080fd5b506102f161043b3660046154c4565b610e04565b34801561044c57600080fd5b506102f17facca635342eab18149c09e97a2f37319eb469c521750ee177df54ba0fbb5ab2b81565b34801561048057600080fd5b5061035461048f3660046150cf565b611018565b3480156104a057600080fd5b506104b46104af366004614da5565b6111bd565b6040516102fb9291906156d0565b3480156104ce57600080fd5b506102f16104dd366004615200565b611315565b3480156104ee57600080fd5b506103546104fd366004614e15565b61132a565b34801561050e57600080fd5b5061035461051d366004615218565b6113ba565b34801561052e57600080fd5b50604051600081526020016102fb565b34801561054a57600080fd5b506102f17f83e9425c28bef24376c07083f886e946a741981b8cf4fd4c87996ac11c8099b681565b34801561057e57600080fd5b5061035461058d366004615218565b6113dc565b34801561059e57600080fd5b506103546105ad366004614da5565b611456565b3480156105be57600080fd5b506102f16105cd36600461506f565b61151f565b3480156105de57600080fd5b50610354611808565b3480156105f357600080fd5b5061035461060236600461503b565b611829565b34801561061357600080fd5b5061035461062236600461503b565b6119fd565b34801561063357600080fd5b50610324610642366004615010565b611bd0565b34801561065357600080fd5b5061035461066236600461532b565b611d80565b34801561067357600080fd5b5061035461068236600461548d565b611fe1565b34801561069357600080fd5b506106a76106a236600461514c565b6121bb565b6040516102fb91906156bd565b6103546106c2366004614fc3565b61231c565b3480156106d357600080fd5b506103246106e2366004615200565b600090815260c96020526040902054151590565b34801561070257600080fd5b506102f1610711366004615200565b6123d2565b34801561072257600080fd5b5060fb5460ff16610324565b34801561073a57600080fd5b506103546107493660046151a2565b6125af565b34801561075a57600080fd5b50610354610769366004614f24565b6129ad565b34801561077a57600080fd5b506102f1600080516020615e5083398151915281565b34801561079c57600080fd5b506103546129f0565b3480156107b157600080fd5b506102f17f272e0b6158b5169c36c8edea6194c0a1fbdd38545da787b6ca3bba131a08788e81565b3480156107e557600080fd5b506102f16107f4366004615200565b612a11565b34801561080557600080fd5b506102f1612c88565b34801561081a57600080fd5b50610324610829366004615218565b612cf9565b34801561083a57600080fd5b5061036b612d24565b34801561084f57600080fd5b506102f1600080516020615e3083398151915281565b34801561087157600080fd5b506102f17f389afb4432151ba13905b31d266f24469245e0dde1107aabeba902ce2726b13b81565b3480156108a557600080fd5b506102f16108b436600461503b565b612d34565b3480156108c557600080fd5b506102f1600081565b3480156108da57600080fd5b506103546108e9366004614f96565b612f0b565b3480156108fa57600080fd5b506102f1612f16565b34801561090f57600080fd5b506102f161091e366004615200565b600090815260c9602052604090205490565b34801561093c57600080fd5b506102f17f3c09405af82d7cff44bebb8bc9c2a8100da263673caa91e816307df7effac21481565b34801561097057600080fd5b5061036b61097f366004615200565b612f86565b34801561099057600080fd5b506102f161099f366004615200565b613124565b3480156109b057600080fd5b506103546109bf366004614da5565b6133b0565b3480156109d057600080fd5b506102f1600080516020615eb783398151915281565b3480156109f257600080fd5b50610354610a01366004615218565b6133e0565b348015610a1257600080fd5b506102f17f61b8ed5f647261c553b276b621fcec1ec02c7b6af5527277e934228f3e5a895381565b348015610a4657600080fd5b506102f1600080516020615e7083398151915281565b348015610a6857600080fd5b50610324610a77366004614ddd565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b348015610ab157600080fd5b506102f17f235226ec31f9fbe21841f80de6c4be79cdbba897fc3c342bed00efa1530841a081565b348015610ae557600080fd5b50610354610af4366004614ebe565b6133fd565b348015610b0557600080fd5b50610354610b1436600461503b565b613442565b348015610b2557600080fd5b506102f1600080516020615e1083398151915281565b348015610b4757600080fd5b506102f1610b56366004615109565b613485565b348015610b6757600080fd5b506102f17f96418df84ad33f6b1aa5c2750055b3307ace533883fd1cea89f6faf8c86474f781565b60006001600160a01b038316610c005760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610c2582613664565b600080516020615e50833981519152610c4f8133613689565b8151610c63906101c8906020850190614b4f565b50610c6d826136ed565b5050565b60606101c68054610c8190615c31565b80601f0160208091040260200160405190810160405280929190818152602001828054610cad90615c31565b8015610cfa5780601f10610ccf57610100808354040283529160200191610cfa565b820191906000526020600020905b815481529060010190602001808311610cdd57829003601f168201915b5050505050905090565b6060610c2582612f86565b610d1b33826001613700565b6101c360009054906101000a90046001600160a01b03166001600160a01b0316632d24cb496040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6a57600080fd5b505afa158015610d7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da29190614dc1565b6001600160a01b03166310f81b41826040518263ffffffff1660e01b8152600401610dcf91815260200190565b600060405180830381600087803b158015610de957600080fd5b505af1158015610dfd573d6000803e3d6000fd5b5050505050565b6000600080516020615e30833981519152610e1f8133613689565b6101c360009054906101000a90046001600160a01b03166001600160a01b03166338865dae6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6e57600080fd5b505afa158015610e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea69190614dc1565b6001600160a01b0316634a54567a846040518263ffffffff1660e01b8152600401610ed391815260200190565b600060405180830381600087803b158015610eed57600080fd5b505af1158015610f01573d6000803e3d6000fd5b505050506101c360009054906101000a90046001600160a01b03166001600160a01b0316632d24cb496040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5457600080fd5b505afa158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190614dc1565b6040516322271fb760e21b815260048101879052602481018690526001600160a01b03919091169063889c7edc90604401602060405180830381600087803b158015610fd757600080fd5b505af1158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f9190615475565b95945050505050565b600080516020615e308339815191526110318133613689565b600061103d8686610b8f565b600014905061105d868685604051806020016040528060008152506137f3565b6001600160a01b0380871660009081526101c5602090815260408083208054600181018255908452928290209092018890556101c3548251636808c19760e01b81529251931692636808c197926004808201939291829003018186803b1580156110c657600080fd5b505afa1580156110da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fe9190614dc1565b604051637df27f4f60e11b81526001600160a01b03888116600483015260248201879052604482018690528315156064830152919091169063fbe4fe9e90608401600060405180830381600087803b15801561115957600080fd5b505af115801561116d573d6000803e3d6000fd5b505050507f242425d5071d5eaaf8f6f82889dd13cdd464fc74ff50b8c6a1c85780e8958c3f8561119d8888610b8f565b6040805192835260208301919091520160405180910390a1505050505050565b6060806101c56000846001600160a01b03166001600160a01b0316815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561123057602002820191906000526020600020905b81548152602001906001019080831161121c575b5050505050915081516001600160401b0381111561125e57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611287578160200160208202803683370190505b50905060005b825181101561130f576101c960008483815181106112bb57634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020548282815181106112f257634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061130781615c98565b91505061128d565b50915091565b60009081526097602052604090206001015490565b6001600160a01b03851633148061134657506113468533610a77565b6113ad5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610bf7565b610dfd85858585856138f3565b6113c382611315565b6113cd8133613689565b6113d78383613abc565b505050565b6001600160a01b038116331461144c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610bf7565b610c6d8282613b42565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561149f5760405162461bcd60e51b8152600401610bf79061588c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166114d1613ba9565b6001600160a01b0316146114f75760405162461bcd60e51b8152600401610bf790615921565b61150081613bd7565b6040805160008082526020820190925261151c91839190613bf0565b50565b6000600080516020615eb783398151915261153a8133613689565b6101c360009054906101000a90046001600160a01b03166001600160a01b031663cf4c08fc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561158957600080fd5b505afa15801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190614dc1565b6001600160a01b03166360a1f945866040518263ffffffff1660e01b81526004016115ee91815260200190565b602060405180830381600087803b15801561160857600080fd5b505af115801561161c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164091906151e4565b156116835760405162461bcd60e51b81526020600482015260136024820152722723281d103637b1b0ba34b7b7103a30b5b2b760691b6044820152606401610bf7565b600061168f6101c45490565b905061169e87826001876137f3565b6001600160a01b0380881660009081526101c5602090815260408083208054600181018255908452828420018590558483526101c98252918290207f3c09405af82d7cff44bebb8bc9c2a8100da263673caa91e816307df7effac21490556101c35482516333d3023f60e21b8152925193169263cf4c08fc926004808201939291829003018186803b15801561173357600080fd5b505afa158015611747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176b9190614dc1565b6001600160a01b03166314668334888884896040518563ffffffff1660e01b815260040161179c9493929190615697565b600060405180830381600087803b1580156117b657600080fd5b505af11580156117ca573d6000803e3d6000fd5b505050506117dd6101c480546001019055565b604051818152600080516020615ed78339815191529060200160405180910390a19695505050505050565b600080516020615e708339815191526118218133613689565b61151c613d30565b600080516020615e308339815191526118428133613689565b600061184e8585610b8f565b1161186b5760405162461bcd60e51b8152600401610bf790615a69565b60006118776101c45490565b905061189585826001604051806020016040528060008152506137f3565b6001600160a01b0380861660009081526101c5602090815260408083208054600181018255908452828420018590558483526101c98252918290207f272e0b6158b5169c36c8edea6194c0a1fbdd38545da787b6ca3bba131a08788e90556101c3548251636808c19760e01b81529251931692636808c197926004808201939291829003018186803b15801561192a57600080fd5b505afa15801561193e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119629190614dc1565b6001600160a01b031663751dbcba868684876040518563ffffffff1660e01b81526004016119939493929190615697565b600060405180830381600087803b1580156119ad57600080fd5b505af11580156119c1573d6000803e3d6000fd5b505050506119d46101c480546001019055565b604051818152600080516020615ed7833981519152906020015b60405180910390a15050505050565b600080516020615e30833981519152611a168133613689565b611a208483610b8f565b15611a5c5760405162461bcd60e51b815260206004820152600c60248201526b4e46503a20686173206f6e6560a01b6044820152606401610bf7565b611a7884836001604051806020016040528060008152506137f3565b6001600160a01b0380851660009081526101c5602090815260408083208054600181018255908452928290209092018590556101c35482516333d3023f60e21b8152925193169263cf4c08fc926004808201939291829003018186803b158015611ae157600080fd5b505afa158015611af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b199190614dc1565b60405163078432bf60e41b81526001600160a01b03868116600483015260248201869052604482018590526080606483015260086084830152671c1d58da185cd95960c21b60a483015291909116906378432bf09060c401600060405180830381600087803b158015611b8b57600080fd5b505af1158015611b9f573d6000803e3d6000fd5b50505050600080516020615ed783398151915282604051611bc291815260200190565b60405180910390a150505050565b6000806101c360009054906101000a90046001600160a01b03166001600160a01b031663cf4c08fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c2257600080fd5b505afa158015611c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5a9190614dc1565b6001600160a01b03166340bd78c2846040518263ffffffff1660e01b8152600401611c8791815260200190565b60006040518083038186803b158015611c9f57600080fd5b505afa158015611cb3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611cdb9190810190615381565b8051909150611cee576000915050610c25565b806020015115611d02576001915050610c25565b6000816060015111611d565760405162461bcd60e51b815260206004820152601d60248201527f4e46503a2055756964277320706163686170617373206d697373696e670000006044820152606401610bf7565b6000611d66858360600151610b8f565b1115611d76576001915050610c25565b6000915050610c25565b600054610100900460ff16611d9b5760005460ff1615611d9f565b303b155b611e025760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bf7565b600054610100900460ff16158015611e24576000805461ffff19166101011790555b604051806060016040528060368152602001615dda603691398051611e52916101c891602090910190614b4f565b50611ee76101c88054611e6490615c31565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9090615c31565b8015611edd5780601f10611eb257610100808354040283529160200191611edd565b820191906000526020600020905b815481529060010190602001808311611ec057829003601f168201915b5050505050613dbd565b611eef613dfd565b611ef7613e3e565b611eff613dfd565b611f07613dfd565b611f0f613e75565b8251611f23906101c6906020860190614b4f565b508151611f38906101c7906020850190614b4f565b50611f44600033613abc565b611f5c600080516020615e5083398151915233613abc565b611f74600080516020615e7083398151915233613abc565b611f8c600080516020615eb783398151915233613abc565b611fa4600080516020615e1083398151915233613abc565b611fbc600080516020615e3083398151915233613abc565b611fcb6101c480546001019055565b80156113d7576000805461ff0019169055505050565b600080516020615eb7833981519152611ffa8133613689565b60006120068486610b8f565b116120235760405162461bcd60e51b8152600401610bf790615a69565b600061202f6101c45490565b905061204d84826001604051806020016040528060008152506137f3565b6001600160a01b0380851660009081526101c5602090815260408083208054600181018255908452828420018590558483526101c98252918290207facca635342eab18149c09e97a2f37319eb469c521750ee177df54ba0fbb5ab2b90556101c3548251633c65907960e11b815292519316926378cb20f2926004808201939291829003018186803b1580156120e257600080fd5b505afa1580156120f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211a9190614dc1565b6040516324c9f24760e01b8152600481018390526001600160a01b0386811660248301526044820186905291909116906324c9f24790606401600060405180830381600087803b15801561216d57600080fd5b505af1158015612181573d6000803e3d6000fd5b50505050600080516020615ed7833981519152816040516121a491815260200190565b60405180910390a1610dfd6101c480546001019055565b606081518351146122205760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610bf7565b600083516001600160401b0381111561224957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612272578160200160208202803683370190505b50905060005b8451811015612314576122d98582815181106122a457634e487b7160e01b600052603260045260246000fd5b60200260200101518583815181106122cc57634e487b7160e01b600052603260045260246000fd5b6020026020010151610b8f565b8282815181106122f957634e487b7160e01b600052603260045260246000fd5b602090810291909101015261230d81615c98565b9050612278565b509392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156123655760405162461bcd60e51b8152600401610bf79061588c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612397613ba9565b6001600160a01b0316146123bd5760405162461bcd60e51b8152600401610bf790615921565b6123c682613bd7565b610c6d82826001613bf0565b6000806123e0335b84610b8f565b116123fd5760405162461bcd60e51b8152600401610bf790615a69565b60006124096101c45490565b9050612428335b826001604051806020016040528060008152506137f3565b3360009081526101c5602090815260408083208054600181018255908452828420018490558383526101c98252918290207f4b4945eddd0dde5d1c7ae83059c09acf131bbaa2c851587e084ae21ef187194690556101c354825163114873f160e21b815292516001600160a01b0390911692634521cfc4926004808301939192829003018186803b1580156124bc57600080fd5b505afa1580156124d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f49190614dc1565b6001600160a01b03166340661dda335b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810186905260448101849052608060648201526000608482015260a401600060405180830381600087803b15801561256157600080fd5b505af1158015612575573d6000803e3d6000fd5b505050506125886101c480546001019055565b604051818152600080516020615ed78339815191529060200160405180910390a192915050565b6101c354604080516333d3023f60e21b815290516000926001600160a01b03169163cf4c08fc916004808301926020929190829003018186803b1580156125f557600080fd5b505afa158015612609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061262d9190614dc1565b6001600160a01b03166340bd78c2836040518263ffffffff1660e01b815260040161265a91815260200190565b60006040518083038186803b15801561267257600080fd5b505afa158015612686573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126ae9190810190615381565b6101208101519091506001600160a01b031633146127035760405162461bcd60e51b81526020600482015260126024820152712723281d102737ba103a34329037bbb732b960711b6044820152606401610bf7565b80516127445760405162461bcd60e51b815260206004820152601060248201526f4e46503a204e6f74206120706163686160801b6044820152606401610bf7565b8060200151156127925760405162461bcd60e51b81526020600482015260196024820152784e46503a204c616e64206d757374206265207072697661746560381b6044820152606401610bf7565b60008160600151116127e45760405162461bcd60e51b815260206004820152601b60248201527a1391940e88141858da1854185cdcc8191bc81b9bdd08195e1a5cdd602a1b6044820152606401610bf7565b60608101516101c354604080516333d3023f60e21b815290516000926001600160a01b03169163cf4c08fc916004808301926020929190829003018186803b15801561282f57600080fd5b505afa158015612843573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128679190614dc1565b905060005b855181101561298e576128b886828151811061289857634e487b7160e01b600052603260045260246000fd5b6020026020010151846001604051806020016040528060008152506137f3565b816001600160a01b03166378432bf08783815181106128e757634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018890526044810186905260806064820152600b60848201526a1d1c985b9cd9995c9c995960aa1b60a482015260c401600060405180830381600087803b15801561296357600080fd5b505af1158015612977573d6000803e3d6000fd5b50505050808061298690615c98565b91505061286c565b50604051828152600080516020615ed7833981519152906020016119ee565b6001600160a01b0383163314806129c957506129c98333610a77565b6129e55760405162461bcd60e51b8152600401610bf7906158d8565b6113d7838383613e9c565b600080516020615e70833981519152612a098133613689565b61151c614049565b600080612a1d336123da565b11612a3a5760405162461bcd60e51b8152600401610bf790615a69565b6101c35460408051634cb1d91960e11b815290516000926001600160a01b031691639963b232916004808301926020929190829003018186803b158015612a8057600080fd5b505afa158015612a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ab89190614dc1565b604051635751afe760e01b81529091506001600160a01b03821690635751afe790612ae79033906004016155e0565b60206040518083038186803b158015612aff57600080fd5b505afa158015612b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3791906151e4565b15612b7d5760405162461bcd60e51b81526020600482015260166024820152754e46503a20486174756e20576173692065786973747360501b6044820152606401610bf7565b6000612b896101c45490565b9050612b9433612410565b3360008181526101c5602090815260408083208054600181018255908452828420018590558483526101c99091528082207f5a394fcd9346b08f6dc23744d51bc220a6c8ec7eda9f7e25697094936b90623d9055805163f0b0f75b60e01b815260048101939093526024830187905260448301849052516001600160a01b0385169263f0b0f75b92606480830193919282900301818387803b158015612c3957600080fd5b505af1158015612c4d573d6000803e3d6000fd5b50505050612c606101c480546001019055565b604051818152600080516020615ed78339815191529060200160405180910390a19392505050565b6000600080516020615e30833981519152612ca38133613689565b6000612caf6101c45490565b9050612cc06101c480546001019055565b60008181526101c9602052604090207f61b8ed5f647261c553b276b621fcec1ec02c7b6af5527277e934228f3e5a8953905591505b5090565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606101c78054610c8190615c31565b6000600080516020615eb7833981519152612d4f8133613689565b6000612d5b8686610b8f565b11612d785760405162461bcd60e51b8152600401610bf790615a69565b6000612d846101c45490565b9050612da286826001604051806020016040528060008152506137f3565b6001600160a01b0380871660009081526101c5602090815260408083208054600181018255908452828420018590558483526101c98252918290207f235226ec31f9fbe21841f80de6c4be79cdbba897fc3c342bed00efa1530841a090556101c3548251632d24cb4960e01b81529251931692632d24cb49926004808201939291829003018186803b158015612e3757600080fd5b505afa158015612e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6f9190614dc1565b6001600160a01b031663b0d5a46c878784886040518563ffffffff1660e01b8152600401612ea09493929190615697565b600060405180830381600087803b158015612eba57600080fd5b505af1158015612ece573d6000803e3d6000fd5b50505050612ee16101c480546001019055565b604051818152600080516020615ed78339815191529060200160405180910390a195945050505050565b610c6d3383836140a1565b6000600080516020615e30833981519152612f318133613689565b6000612f3d6101c45490565b9050612f4e6101c480546001019055565b60008181526101c9602052604090207f83e9425c28bef24376c07083f886e946a741981b8cf4fd4c87996ac11c8099b6905591505090565b600081815260c96020526040902054606090612fd75760405162461bcd60e51b815260206004820152601060248201526f2723281d102737ba1036b4b73a32b21760811b6044820152606401610bf7565b6101c35460008381526101c96020526040808220549051630a9c995360e41b815291926001600160a01b03169163a9c995309161301a9160040190815260200190565b60206040518083038186803b15801561303257600080fd5b505afa158015613046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306a9190614dc1565b6001600160a01b0316630d95984b6101c8856040518363ffffffff1660e01b8152600401613099929190615751565b60006040518083038186803b1580156130b157600080fd5b505afa1580156130c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130ed91908101906152ae565b905060006101c880546130ff90615c31565b90501161311b576040518060200160405280600081525061311d565b805b9392505050565b600080613130336123da565b1161314d5760405162461bcd60e51b8152600401610bf790615a69565b6101c360009054906101000a90046001600160a01b03166001600160a01b03166378b2ee536040518163ffffffff1660e01b815260040160206040518083038186803b15801561319c57600080fd5b505afa1580156131b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131d49190614dc1565b6001600160a01b0316635824426b336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810185905260440160206040518083038186803b15801561322957600080fd5b505afa15801561323d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061326191906151e4565b156132b95760405162461bcd60e51b815260206004820152602260248201527f4e46503a2050616368612068617320612057697261636f63686120616c726561604482015261647960f01b6064820152608401610bf7565b60006132c56101c45490565b90506132d033612410565b3360009081526101c5602090815260408083208054600181018255908452828420018490558383526101c98252918290207f96418df84ad33f6b1aa5c2750055b3307ace533883fd1cea89f6faf8c86474f790556101c35482516378b2ee5360e01b815292516001600160a01b03909116926378b2ee53926004808301939192829003018186803b15801561336457600080fd5b505afa158015613378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061339c9190614dc1565b6001600160a01b031663e29c639433612504565b60006133bc8133613689565b506101c380546001600160a01b0319166001600160a01b0392909216919091179055565b6133e982611315565b6133f38133613689565b6113d78383613b42565b6001600160a01b03851633148061341957506134198533610a77565b6134355760405162461bcd60e51b8152600401610bf7906158d8565b610dfd8585858585614182565b6001600160a01b03831633148061345e575061345e8333610a77565b61347a5760405162461bcd60e51b8152600401610bf7906158d8565b6113d7838383613700565b6000600080516020615eb78339815191526134a08133613689565b60006134ac6101c45490565b90506134ca88826001604051806020016040528060008152506137f3565b6001600160a01b0380891660009081526101c5602090815260408083208054600181018255908452828420018590558483526101c98252918290207f389afb4432151ba13905b31d266f24469245e0dde1107aabeba902ce2726b13b90556101c3548251631c432ed760e11b815292519316926338865dae926004808201939291829003018186803b15801561355f57600080fd5b505afa158015613573573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135979190614dc1565b604051639fd4c9c560e01b81526001600160a01b038a81166004830152602482018a905260448201899052606482018890526084820184905260a482018790529190911690639fd4c9c59060c401600060405180830381600087803b1580156135ff57600080fd5b505af1158015613613573d6000803e3d6000fd5b50505050613623883060016140a1565b6136326101c480546001019055565b604051818152600080516020615ed78339815191529060200160405180910390a1979650505050505050565b3b151590565b60006001600160e01b03198216637965db0b60e01b1480610c255750610c2582614291565b6136938282612cf9565b610c6d576136ab816001600160a01b031660146142e1565b6136b68360206142e1565b6040516020016136c7929190615571565b60408051601f198184030181529082905262461bcd60e51b8252610bf79160040161573e565b8051610c6d906067906020840190614b4f565b6001600160a01b0383166137265760405162461bcd60e51b8152600401610bf7906159dc565b3361375581856000613737876144c2565b613740876144c2565b6040518060200160405280600081525061451b565b60008381526065602090815260408083206001600160a01b0388168452909152902054828110156137985760405162461bcd60e51b8152600401610bf790615848565b60008481526065602090815260408083206001600160a01b0389811680865291845282852088870390558251898152938401889052909290861691600080516020615dba833981519152910160405180910390a45050505050565b6001600160a01b0384166138535760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610bf7565b3361387381600087613864886144c2565b61386d886144c2565b8761451b565b60008481526065602090815260408083206001600160a01b0389168452909152812080548592906138a5908490615b9c565b909155505060408051858152602081018590526001600160a01b038088169260009291851691600080516020615dba833981519152910160405180910390a4610dfd8160008787878761454c565b81518351146139145760405162461bcd60e51b8152600401610bf790615ae1565b6001600160a01b03841661393a5760405162461bcd60e51b8152600401610bf790615997565b3361394981878787878761451b565b60005b8451811015613a4e57600085828151811061397757634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106139a357634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156139f45760405162461bcd60e51b8152600401610bf790615a1f565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290613a33908490615b9c565b9250508190555050505080613a4790615c98565b905061394c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051613a9e929190615719565b60405180910390a4613ab48187878787876146b7565b505050505050565b613ac68282612cf9565b610c6d5760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613afe3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613b4c8282612cf9565b15610c6d5760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b600080516020615e10833981519152610c6d8133613689565b6000613bfa613ba9565b9050613c0584614781565b600083511180613c125750815b15613c2357613c218484614826565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff16610dfd57805460ff19166001178155604051613c9e908690613c6f9085906024016155e0565b60408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b179052614826565b50805460ff19168155613caf613ba9565b6001600160a01b0316826001600160a01b031614613d275760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b6064820152608401610bf7565b610dfd85614908565b60fb5460ff16613d795760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610bf7565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051613db391906155e0565b60405180910390a1565b600054610100900460ff16613de45760405162461bcd60e51b8152600401610bf790615a96565b613dec614948565b613df4614948565b61151c8161496f565b600054610100900460ff16613e245760405162461bcd60e51b8152600401610bf790615a96565b613e2c614948565b613e34614948565b613e3c614948565b565b600054610100900460ff16613e655760405162461bcd60e51b8152600401610bf790615a96565b613e6d614948565b613e3c61499f565b600054610100900460ff16613e2c5760405162461bcd60e51b8152600401610bf790615a96565b6001600160a01b038316613ec25760405162461bcd60e51b8152600401610bf7906159dc565b8051825114613ee35760405162461bcd60e51b8152600401610bf790615ae1565b6000339050613f068185600086866040518060200160405280600081525061451b565b60005b8351811015613fea576000848281518110613f3457634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110613f6057634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015613fb15760405162461bcd60e51b8152600401610bf790615848565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580613fe281615c98565b915050613f09565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161403b929190615719565b60405180910390a450505050565b60fb5460ff161561406c5760405162461bcd60e51b8152600401610bf79061596d565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613da63390565b816001600160a01b0316836001600160a01b031614156141155760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610bf7565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166141a85760405162461bcd60e51b8152600401610bf790615997565b336141b8818787613864886144c2565b60008481526065602090815260408083206001600160a01b038a168452909152902054838110156141fb5760405162461bcd60e51b8152600401610bf790615a1f565b60008581526065602090815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061423a908490615b9c565b909155505060408051868152602081018690526001600160a01b03808916928a82169291861691600080516020615dba833981519152910160405180910390a461428882888888888861454c565b50505050505050565b60006001600160e01b03198216636cdb3d1360e11b14806142c257506001600160e01b031982166303a24d0760e21b145b80610c2557506301ffc9a760e01b6001600160e01b0319831614610c25565b606060006142f0836002615bb4565b6142fb906002615b9c565b6001600160401b0381111561432057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561434a576020820181803683370190505b509050600360fc1b8160008151811061437357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106143b057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006143d4846002615bb4565b6143df906001615b9c565b90505b6001811115614473576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061442157634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061444557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361446c81615c1a565b90506143e2565b50831561311d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610bf7565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061450a57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b60fb5460ff161561453e5760405162461bcd60e51b8152600401610bf79061596d565b613ab48686868686866149d2565b6001600160a01b0384163b15613ab45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906145909089908990889088908890600401615652565b602060405180830381600087803b1580156145aa57600080fd5b505af19250505080156145da575060408051601f3d908101601f191682019092526145d791810190615258565b60015b614687576145e6615cdf565b806308c379a0141561462057506145fb615cf7565b806146065750614622565b8060405162461bcd60e51b8152600401610bf7919061573e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610bf7565b6001600160e01b0319811663f23a6e6160e01b146142885760405162461bcd60e51b8152600401610bf790615800565b6001600160a01b0384163b15613ab45760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906146fb90899089908890889088906004016155f4565b602060405180830381600087803b15801561471557600080fd5b505af1925050508015614745575060408051601f3d908101601f1916820190925261474291810190615258565b60015b614751576145e6615cdf565b6001600160e01b0319811663bc197c8160e01b146142885760405162461bcd60e51b8152600401610bf790615800565b803b6147e55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bf7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b6148855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610bf7565b600080846001600160a01b0316846040516148a09190615555565b600060405180830381855af49150503d80600081146148db576040519150601f19603f3d011682016040523d82523d6000602084013e6148e0565b606091505b509150915061100f8282604051806060016040528060278152602001615e9060279139614b16565b61491181614781565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600054610100900460ff16613e3c5760405162461bcd60e51b8152600401610bf790615a96565b600054610100900460ff166149965760405162461bcd60e51b8152600401610bf790615a96565b61151c816136ed565b600054610100900460ff166149c65760405162461bcd60e51b8152600401610bf790615a96565b60fb805460ff19169055565b6001600160a01b038516614a755760005b8351811015614a7357828181518110614a0c57634e487b7160e01b600052603260045260246000fd5b602002602001015160c96000868481518110614a3857634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000828254614a5d9190615b9c565b90915550614a6c905081615c98565b90506149e3565b505b6001600160a01b038416613ab45760005b835181101561428857828181518110614aaf57634e487b7160e01b600052603260045260246000fd5b602002602001015160c96000868481518110614adb57634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000828254614b009190615bd3565b90915550614b0f905081615c98565b9050614a86565b60608315614b2557508161311d565b825115614b355782518084602001fd5b8160405162461bcd60e51b8152600401610bf7919061573e565b828054614b5b90615c31565b90600052602060002090601f016020900481019282614b7d5760008555614bc3565b82601f10614b9657805160ff1916838001178555614bc3565b82800160010185558215614bc3579182015b82811115614bc3578251825591602001919060010190614ba8565b50612cf59291505b80821115612cf55760008155600101614bcb565b8051614bea81615d80565b919050565b600082601f830112614bff578081fd5b81356020614c0c82615b52565b604051614c198282615c6c565b8381528281019150858301600585901b87018401881015614c38578586fd5b855b85811015614c5f578135614c4d81615d80565b84529284019290840190600101614c3a565b5090979650505050505050565b600082601f830112614c7c578081fd5b81516020614c8982615b52565b604051614c968282615c6c565b8381528281019150858301600585901b87018401881015614cb5578586fd5b855b85811015614c5f578151614cca81615d80565b84529284019290840190600101614cb7565b600082601f830112614cec578081fd5b81356020614cf982615b52565b604051614d068282615c6c565b8381528281019150858301600585901b87018401881015614d25578586fd5b855b85811015614c5f57813584529284019290840190600101614d27565b8051614bea81615d95565b600082601f830112614d5e578081fd5b8135614d6981615b75565b604051614d768282615c6c565b828152856020848701011115614d8a578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215614db6578081fd5b813561311d81615d80565b600060208284031215614dd2578081fd5b815161311d81615d80565b60008060408385031215614def578081fd5b8235614dfa81615d80565b91506020830135614e0a81615d80565b809150509250929050565b600080600080600060a08688031215614e2c578081fd5b8535614e3781615d80565b94506020860135614e4781615d80565b935060408601356001600160401b0380821115614e62578283fd5b614e6e89838a01614cdc565b94506060880135915080821115614e83578283fd5b614e8f89838a01614cdc565b93506080880135915080821115614ea4578283fd5b50614eb188828901614d4e565b9150509295509295909350565b600080600080600060a08688031215614ed5578283fd5b8535614ee081615d80565b94506020860135614ef081615d80565b9350604086013592506060860135915060808601356001600160401b03811115614f18578182fd5b614eb188828901614d4e565b600080600060608486031215614f38578081fd5b8335614f4381615d80565b925060208401356001600160401b0380821115614f5e578283fd5b614f6a87838801614cdc565b93506040860135915080821115614f7f578283fd5b50614f8c86828701614cdc565b9150509250925092565b60008060408385031215614fa8578182fd5b8235614fb381615d80565b91506020830135614e0a81615d95565b60008060408385031215614fd5578182fd5b8235614fe081615d80565b915060208301356001600160401b03811115614ffa578182fd5b61500685828601614d4e565b9150509250929050565b60008060408385031215615022578182fd5b823561502d81615d80565b946020939093013593505050565b60008060006060848603121561504f578081fd5b833561505a81615d80565b95602085013595506040909401359392505050565b60008060008060808587031215615084578182fd5b843561508f81615d80565b9350602085013592506040850135915060608501356001600160401b038111156150b7578182fd5b6150c387828801614d4e565b91505092959194509250565b600080600080608085870312156150e4578182fd5b84356150ef81615d80565b966020860135965060408601359560600135945092505050565b600080600080600060a08688031215615120578283fd5b853561512b81615d80565b97602087013597506040870135966060810135965060800135945092505050565b6000806040838503121561515e578182fd5b82356001600160401b0380821115615174578384fd5b61518086838701614bef565b93506020850135915080821115615195578283fd5b5061500685828601614cdc565b600080604083850312156151b4578182fd5b82356001600160401b038111156151c9578283fd5b6151d585828601614bef565b95602094909401359450505050565b6000602082840312156151f5578081fd5b815161311d81615d95565b600060208284031215615211578081fd5b5035919050565b6000806040838503121561522a578182fd5b823591506020830135614e0a81615d80565b60006020828403121561524d578081fd5b813561311d81615da3565b600060208284031215615269578081fd5b815161311d81615da3565b600060208284031215615285578081fd5b81356001600160401b0381111561529a578182fd5b6152a684828501614d4e565b949350505050565b6000602082840312156152bf578081fd5b81516001600160401b038111156152d4578182fd5b8201601f810184136152e4578182fd5b80516152ef81615b75565b6040516152fc8282615c6c565b828152866020848601011115615310578485fd5b615321836020830160208701615bea565b9695505050505050565b6000806040838503121561533d578182fd5b82356001600160401b0380821115615353578384fd5b61535f86838701614d4e565b93506020850135915080821115615374578283fd5b5061500685828601614d4e565b600060208284031215615392578081fd5b81516001600160401b03808211156153a8578283fd5b9083019061018082860312156153bc578283fd5b6153c4615b29565b6153cd83614d43565b81526153db60208401614d43565b602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120615436818501614bdf565b9082015261014083810151908201526101608084015183811115615458578586fd5b61546488828701614c6c565b918301919091525095945050505050565b600060208284031215615486578081fd5b5051919050565b6000806000606084860312156154a1578081fd5b8335925060208401356154b381615d80565b929592945050506040919091013590565b6000806000606084860312156154d8578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b8381101561551e57815187529582019590820190600101615502565b509495945050505050565b60008151808452615541816020860160208601615bea565b601f01601f19169290920160200192915050565b60008251615567818460208701615bea565b9190910192915050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516155a3816017850160208801615bea565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516155d4816028840160208801615bea565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a060408201819052600090615620908301866154ef565b828103606084015261563281866154ef565b905082810360808401526156468185615529565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061568c90830184615529565b979650505050505050565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b60208152600061311d60208301846154ef565b6040815260006156e360408301856154ef565b828103602084810191909152845180835285820192820190845b81811015614c5f578451835293830193918301916001016156fd565b60408152600061572c60408301856154ef565b828103602084015261100f81856154ef565b60208152600061311d6020830184615529565b60408152600080845482600182811c91508083168061577157607f831692505b602080841082141561579157634e487b7160e01b87526022600452602487fd5b60408801849052606088018280156157b057600181146157c1576157eb565b60ff198716825282820197506157eb565b60008c815260209020895b878110156157e5578154848201529086019084016157cc565b83019850505b50509690960196909652509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252601390820152721391940e88139bc81c1858da1848199bdd5b99606a1b604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60405161018081016001600160401b0381118282101715615b4c57615b4c615cc9565b60405290565b60006001600160401b03821115615b6b57615b6b615cc9565b5060051b60200190565b60006001600160401b03821115615b8e57615b8e615cc9565b50601f01601f191660200190565b60008219821115615baf57615baf615cb3565b500190565b6000816000190483118215151615615bce57615bce615cb3565b500290565b600082821015615be557615be5615cb3565b500390565b60005b83811015615c05578181015183820152602001615bed565b83811115615c14576000848401525b50505050565b600081615c2957615c29615cb3565b506000190190565b600181811c90821680615c4557607f821691505b60208210811415615c6657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b0381118282101715615c9157615c91615cc9565b6040525050565b6000600019821415615cac57615cac615cb3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115615cf457600481823e5160e01c5b90565b600060443d1015615d055790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615d3457505050505090565b8285019150815181811115615d4c5750505050505090565b843d8701016020828501011115615d665750505050505090565b615d7560208286010187615c6c565b509095945050505050565b6001600160a01b038116811461151c57600080fd5b801515811461151c57600080fd5b6001600160e01b03198116811461151c57600080fdfec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62697066733a2f2f516d626247676f39334d367972355753554d6a353353574e327643374c36614d5331475a53504e6b5652593865342f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e335ae1dd6fd6cd86b097d682e864af0e52b2ce2f55fbe697682c356330daaad1a7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69f87cb7b8a6c54debaaa0d12a571441914663d4a4300341e3805f85b854ee337a264697066735822122057f1152d5471a36f2a5ffb71abd1d18b99d33987f3d621edd61668fff8493a4564736f6c63430008040033

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