ETH Price: $3,426.82 (+3.20%)

Contract

0xD1003aA22565E2c37fC185bc1919a08330b68434
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040191294552024-01-31 22:32:23296 days ago1706740343IN
 Create: Packets
0 ETH0.1548424331.83394346

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Packets

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 37 : Packets.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "erc721a-upgradeable/contracts/extensions/IERC721ABurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "operator-filter-registry/src/upgradeable/DefaultOperatorFiltererUpgradeable.sol";
import "@chocolate-factory/contracts/supply/ReservedSupplyUpgradeable.sol";
import "@chocolate-factory/contracts/admin-manager/AdminManagerUpgradable.sol";
import "@chocolate-factory/contracts/uri-manager/UriManagerUpgradable.sol";
import "@chocolate-factory/contracts/price/PriceUpgradable.sol";
import "@chocolate-factory/contracts/royalties/RoyaltiesUpgradable.sol";
import "@chocolate-factory/contracts/balance-limit/BalanceLimitUpgradable.sol";
import "@chocolate-factory/contracts/signer/SignerUpgradeable.sol";
import "./interfaces/ICards.sol";
import "./interfaces/IRandomizer.sol";

contract Packets is 
    Initializable, 
    ERC1155Upgradeable, 
    OwnableUpgradeable,     
    AdminManagerUpgradable,
    UriManagerUpgradable,
    PriceUpgradable,
    DefaultOperatorFiltererUpgradeable,
    RoyaltiesUpgradable,
    BalanceLimitUpgradable,
    SignerUpgradeable
{
    uint256 public activeIndex;
    mapping(uint256 => uint256) public idToCards;
    mapping(uint256 => uint256) private _totalSupply;
    
    event PacketOpened(address indexed account, uint256 cardId, uint256 startingId, uint256 total, uint256 timestamp);
    event QuillsBurned(address indexed account, uint256 amount, uint256 timestamp);
    event GbabiesBurned(address indexed account, uint256 amount, uint256 timestamp);

    function initialize(
        string memory prefix_,
        string memory suffix_,
        address recipient, 
        uint256 amount,
        string memory name, 
        string memory version, 
        address _signer
    ) public initializer {
        __AdminManager_init_unchained();
        __UriManager_init_unchained(prefix_,suffix_);
        __ERC1155_init_unchained("");
        __Price_init_unchained();
        __DefaultOperatorFilterer_init();
        __Royalties_init_unchained(recipient, amount);
        __Signer_init_unchained(name, version, _signer);
        
        _isOG[3] = true;
        _isOG[14] = true;
        _isOG[19] = true;
        _isOG[23] = true;
        _isOG[24] = true;
        _isOG[25] = true;
        _isOG[27] = true;
        _isOG[29] = true;
        _isOG[39] = true;
        _isOG[51] = true;
        _isOG[61] = true;
        _isOG[66] = true;
        _isOG[69] = true;
        _isOG[73] = true;
        _isOG[80] = true;
        _isOG[90] = true;
        _isOG[96] = true;
        _isOG[129] = true;
        _isOG[130] = true;
        _isOG[138] = true;
        _isOG[140] = true;
        _isOG[168] = true;
        _isOG[169] = true;
        _isOG[171] = true;
        _isOG[176] = true;
        _isOG[191] = true;
        _isOG[193] = true;
        _isOG[194] = true;
        _isOG[201] = true;
        _isOG[210] = true;
        _isOG[216] = true;
        _isOG[258] = true;
        _isOG[262] = true;
        _isOG[273] = true;
        _isOG[299] = true;
        _isOG[301] = true;
        _isOG[303] = true;
        _isOG[309] = true;
        _isOG[311] = true;
        _isOG[323] = true;
        _isOG[327] = true;
        _isOG[336] = true;
        _isOG[342] = true;
        _isOG[344] = true;
        _isOG[345] = true;
        _isOG[353] = true;
        _isOG[355] = true;
        _isOG[361] = true;
        _isOG[382] = true;
        _isOG[394] = true;

        idToCards[1] = 5;
        idToCards[2] = 25;
        idToCards[3] = 100;
        idToCards[4] = 40;

        _totalSupply[1] = 5225;
        _totalSupply[2] = 1355;
        _totalSupply[3] = 400;
        _totalSupply[4] = 300;

        setPrice(1, 0.002 ether);
        discountPrice = 0.0018 ether;
        setPrice(2, 0.008 ether);
        setPrice(3, 0.0225 ether);
        setPrice(4, 0.0125 ether);        
    }

    IERC721ABurnableUpgradeable public gbabiesContract;
    IERC721ABurnableUpgradeable public quillContract;
    ICards public cardsContract;

    struct MintRequest {
        uint256 id;
        uint256 amount;
    }

    struct PresaleRequest {
        uint256 amount;
        address recipient;
    }

    mapping(address => uint256) private _minted;
    mapping(uint256 => bool) private _isOG;

    bytes32 private constant PRESALE_REQUEST_TYPE_HASH =
        keccak256(
            "PresaleRequest(uint256 amount,address recipient)"
        );

    function hashTypedData(
        PresaleRequest calldata request
    ) internal view returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    PRESALE_REQUEST_TYPE_HASH,
                    request.amount,
                    msg.sender
                )
            );
    }


    modifier verifyRequest(
        PresaleRequest calldata request,
        bytes calldata signature
    ) {
        bytes32 structHash = hashTypedData(request);
        bytes32 digest = _hashTypedDataV4(structHash);
        require(_verify(digest, signature), "Invalid Signature");
        _;
    }

    modifier isLive(uint256 index) {
        require(activeIndex == index, "Not live");
        _;
    }
    
    function setContracts(
        IERC721ABurnableUpgradeable gbabies,
        IERC721ABurnableUpgradeable quills,
        ICards cards
    ) external onlyAdmin {
        gbabiesContract = gbabies;
        quillContract = quills;
        cardsContract = cards;
    }

    function setActiveIndex(uint256 index) external onlyAdmin {
        activeIndex = index;
    }

    function burnMint(
        uint256[] calldata gbabies,
        uint256[] calldata quills
    )   external 
        payable
        isLive(1)
    {
        (uint256 gbabyTotal,) = _calculateGBabies(gbabies);
        (uint256 quillTotal, uint256 quillPrice) = _calculateQuills(quills);
        uint256 totalMints = gbabyTotal + quillTotal;
        _handleMint(msg.sender, totalMints, 1, quillPrice);
    }
    
    function presaleMint(
        PresaleRequest calldata request,
        MintRequest[] calldata mintRequests,
        bytes calldata signature
    )   external 
        payable 
        verifyRequest(request, signature) 
        isLive(1)
    {
        (
            uint256 totalPrice, 
            uint256 totalMints,
            uint256[] memory ids, 
            uint256[] memory amounts
        ) = _tallyMintRequests(mintRequests);
        require( _minted[msg.sender] + totalMints <= request.amount, "Cannot mint more than assigned.");

        _minted[msg.sender] += totalMints;
        _handleMints(msg.sender, ids, amounts, totalPrice);
    }

    function publicMint(
        MintRequest[] calldata mintRequests
    )   external 
        payable 
        isLive(2)
    {
        (
            uint256 totalPrice, 
            ,
            uint256[] memory ids, 
            uint256[] memory amounts
        ) = _tallyMintRequests(mintRequests);

        _handleMints(msg.sender, ids, amounts, totalPrice);
    }

    function _tallyMintRequests(
        MintRequest[] calldata mintRequests
    ) internal returns (uint256, uint256, uint256[] memory, uint256[] memory) {
        uint256 totalPrice;
        uint256 totalMints;
        uint256 length = mintRequests.length;

        uint256[] memory ids = new uint256[](length);
        uint256[] memory amounts = new uint256[](length);

        for(uint256 i; i < length; i++) {
            MintRequest memory mintRequest = mintRequests[i];
            uint256 id = mintRequest.id;
            require(id < 5 && id > 0, "Invalid ID");            
            uint256 amount = mintRequest.amount;
            _checkSupply(id, amount);
            uint256 priceValue = price(uint8(id));
            totalPrice += priceValue * amount;
            totalMints += amount;
            ids[i] = id;
            amounts[i] = amount;
        }
        require(totalMints > 0, "Zero");

        return (totalPrice, totalMints, ids, amounts);
    }

    function _checkSupply(uint256 id, uint256 amount) internal {
        require(_totalSupply[id] - amount >= 0, "Exceeds Supply");
        _totalSupply[id] -= amount;
    }

    function _calculateGBabies(
        uint256[] calldata ids
    ) internal returns (uint256, uint256) {
        uint256 length = ids.length;
        if(length == 0) return (0, 0);
        uint256 total;
        for(uint256 i; i < length; i++) {
            uint256 id = ids[i];
            require(gbabiesContract.ownerOf(id) == msg.sender, "Not Owner");
            if(_isOG[id]) {
                total += 2;
            } else {
                total++;
            }
            gbabiesContract.burn(id);
        }
        emit GbabiesBurned(msg.sender, total, block.timestamp);
        return (total, 0);
    }

    uint256 public discountPrice;

    function setDiscountPrice(uint256 _discountPrice) external onlyAdmin {
        discountPrice = _discountPrice;
    }

    function _calculateQuills(
        uint256[] memory ids
    ) internal returns (uint256, uint256) {
        uint256 length = ids.length;
        if(length == 0) return (0, 0);
        require(length % 2 == 0, "Must be divisble by 2");
        for(uint256 i; i < length; i++) {
            uint256 id = ids[i];
            require(quillContract.ownerOf(id) == msg.sender, "Invalid Owner");
            quillContract.burn(id);
        }
        emit QuillsBurned(msg.sender, length, block.timestamp);
        uint256 amount = length / 2;
        return (amount, amount * discountPrice);
    }

    function adminMint(
        address[] calldata accounts_,
        uint256[] calldata amounts_,
        uint256 tokenId
    ) external onlyAdmin {
        uint256 accountsLength = accounts_.length;
        require(accountsLength == amounts_.length, "Admin mint: bad request");
        for (uint256 i; i < accountsLength; i++) {
            _internalMint(accounts_[i], tokenId, amounts_[i]);
        }
    }

    function setSigner(address _signer) public onlyAdmin {
        signer = _signer;
    }

    function _internalMint(
        address account,
        uint256 amount,
        uint256 tokenId
    ) internal{
        _checkSupply(tokenId, amount);
        _mint(account, tokenId, amount, "");
    }

    function _handleMint(
        address account,
        uint256 amount,
        uint256 tokenId,
        uint256 totalCost
    ) internal {
        _internalMint(account, amount, tokenId);
        _handlePayment(totalCost);
    }


    function _handleMints(
        address account,
        uint256[] memory ids,
        uint256[] memory amounts,
        uint256 totalCost
    ) internal {
        _mintBatch(account, ids, amounts, "");
        _handlePayment(totalCost);
    }

    function uri(uint256 tokenId) public view override returns (string memory) {
        return _buildUri(tokenId);
    }

    function withdraw(uint256 amount) external onlyAdmin {
        AddressUpgradeable.sendValue(payable (msg.sender), amount);
    }

    function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
        super.setApprovalForAll(operator, approved);
    }

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

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override onlyAllowedOperator(from) {
        super.safeBatchTransferFrom(from, to, ids, amounts, data);
    }

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

    function open(
        uint256[] calldata ids,
        uint256[] calldata amounts
    ) external {
        require(tx.origin == msg.sender, "No calls from contracts");        
        _burnBatch(
            msg.sender,
            ids,
            amounts
        );
        _handlePackets(ids, amounts);        
    }

    function getTotal(uint256[] calldata numbers) public pure returns (uint256) {
        uint256 total;

        for(uint256 t; t < numbers.length; t++) {
            total += numbers[t];
        }

        return total;
    }

    function minted(address to) public view returns (uint256) {
        return _minted[to];
    }

    function totalSupply(uint256 id) public view returns (uint256) {
        return _totalSupply[id];
    }

    function setTotalSupply(
        uint256[] memory ids,
        uint256[] memory values
    ) external onlyAdmin {
        for(uint256 i; i < ids.length; i++) {
            _totalSupply[ids[i]] = values[i];
        }
    }

    IRandomizer public randomizer;

    function setRandomizer(IRandomizer _randomizer) external onlyAdmin {
        randomizer = _randomizer;
    }

    function _handlePackets(
        uint256[] calldata ids,
        uint256[] calldata amounts
    ) internal {
        uint256 length = ids.length;
        uint256 original = cardsContract.totalSupply();
        uint256 total = original + 1;
        for(uint256 i; i < length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];
            if(amount == 0) continue;
            if(id == 4) {
                for(uint256 j; j < amount; j++) {
                    uint256 cardId = randomizer.random(total, msg.sender);
                    require(cardId > 0, "Error: Out of stock");
                    uint256 cards =  idToCards[cardId];
                    emit PacketOpened(msg.sender, cardId, total, cards, block.timestamp);
                    total += cards;
                }
            } else {    
                uint256 cards =  idToCards[id];
                for(uint256 j; j < amount; j++) {                    
                    emit PacketOpened(msg.sender, id,  total, cards, block.timestamp);
                    total += cards;
                }                           
            }
        }
        uint256 mintQuantity = total - original - 1;
        require(mintQuantity > 0, "Minting Zero");
        cardsContract.mint(msg.sender, mintQuantity);
    }
}

File 2 of 37 : AdminManager.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

contract AdminManager {
    mapping(address => bool) internal _admins;

    constructor() {
        _admins[msg.sender] = true;
        _admins[address(this)] = true;
    }

    function setAdminPermissions(address account_, bool enable_)
        external
        onlyAdmin
    {
        _admins[account_] = enable_;
    }

    function isAdmin(address account_) public view returns (bool) {
        return _admins[account_];
    }

    modifier onlyAdmin() {
        require(isAdmin(msg.sender), "Not an admin");
        _;
    }
}

File 3 of 37 : AdminManagerUpgradable.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract AdminManagerUpgradable is Initializable {
    mapping(address => bool) private _admins;

    function __AdminManager_init() internal onlyInitializing {
        __AdminManager_init_unchained();
    }

    function __AdminManager_init_unchained() internal onlyInitializing {
        _admins[msg.sender] = true;
    }

    function setAdminPermissions(address account_, bool enable_)
        external
        onlyAdmin
    {
        _admins[account_] = enable_;
    }

    function isAdmin(address account_) public view returns (bool) {
        return _admins[account_];
    }

    modifier onlyAdmin() {
        require(isAdmin(msg.sender), "Not an admin");
        _;
    }

    uint256[49] private __gap;
}

File 4 of 37 : BalanceLimit.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "../admin-manager/AdminManager.sol";
import "./BalanceLimitStorage.sol";

contract BalanceLimit is AdminManager {
    using BalanceLimitStorage for BalanceLimitStorage.Data;

    mapping(uint8 => BalanceLimitStorage.Data) internal _balanceLimits;

    function _increaseBalance(
        uint8 stageId_,
        address account_,
        uint256 amount_
    ) internal {
        _balanceLimits[stageId_].increaseBalance(account_, amount_);
    }

    function currentBalance(uint8 stageId_, address account_)
        external
        view
        returns (uint256)
    {
        return _balanceLimits[stageId_].balances[account_];
    }

    function remainingBalance(uint8 stageId_, address account_)
        external
        view
        returns (uint256)
    {
        return
            _balanceLimits[stageId_].limit -
            _balanceLimits[stageId_].balances[account_];
    }

    function updateBalanceLimit(uint8 stageId_, uint256 limit_)
        public
        onlyAdmin
    {
        _balanceLimits[stageId_].limit = limit_;
    }

    function balanceLimit(uint8 stageId_) external view returns (uint256) {
        return _balanceLimits[stageId_].limit;
    }
}

File 5 of 37 : BalanceLimitStorage.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

library BalanceLimitStorage {
    struct Data {
        uint256 limit;
        mapping(address => uint256) balances;
    }

    function increaseBalance(
        Data storage data_,
        address account_,
        uint256 amount_
    ) internal {
        require(
            data_.balances[account_] + amount_ <= data_.limit,
            "Exceeds limit"
        );
        data_.balances[account_] += amount_;
    }
}

File 6 of 37 : BalanceLimitUpgradable.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";
import "./BalanceLimitStorage.sol";

contract BalanceLimitUpgradable is Initializable, AdminManagerUpgradable {
    using BalanceLimitStorage for BalanceLimitStorage.Data;

    mapping(uint8 => BalanceLimitStorage.Data) internal _balanceLimits;

    function __BalanceLimit_init() internal onlyInitializing {
        __AdminManager_init_unchained();
        __BalanceLimit_init_unchained();
    }

    function __BalanceLimit_init_unchained() internal onlyInitializing {}

    function _increaseBalance(
        uint8 stageId_,
        address account_,
        uint256 amount_
    ) internal {
        _balanceLimits[stageId_].increaseBalance(account_, amount_);
    }

    function currentBalance(uint8 stageId_, address account_)
        external
        view
        returns (uint256)
    {
        return _balanceLimits[stageId_].balances[account_];
    }

    function remainingBalance(uint8 stageId_, address account_)
        external
        view
        returns (uint256)
    {
        return
            _balanceLimits[stageId_].limit -
            _balanceLimits[stageId_].balances[account_];
    }

    function updateBalanceLimit(uint8 stageId_, uint256 limit_)
        public
        onlyAdmin
    {
        _balanceLimits[stageId_].limit = limit_;
    }

    function balanceLimit(uint8 stageId_) external view returns (uint256) {
        return _balanceLimits[stageId_].limit;
    }
}

File 7 of 37 : PriceUpgradable.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";
import "../balance-limit/BalanceLimit.sol";

contract PriceUpgradable is Initializable, AdminManagerUpgradable {
    mapping(uint8 => uint256) private _price;

    function __Price_init() internal onlyInitializing {        
        __AdminManager_init_unchained();
        __Price_init_unchained();
    }

    function __Price_init_unchained() internal onlyInitializing {}

    function setPrice(uint8 stage_, uint256 value_) public onlyAdmin {
        _price[stage_] = value_;
    }

    function price(uint8 stage_) public view returns (uint256) {
        return _price[stage_];
    }

    function _handlePayment(uint256 cost) internal {
        require(msg.value >= cost, "Price: invalid");
        uint256 difference = msg.value - cost;
        if(difference > 0) {
            payable(msg.sender).transfer(difference);
        }
    }

    uint256[49] private __gap;
}

File 8 of 37 : IERC2981Royalties.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IERC2981Royalties {
    function royaltyInfo(uint256 tokenId_, uint256 value_)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 9 of 37 : RoyaltiesUpgradable.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";
import "./IERC2981Royalties.sol";

contract RoyaltiesUpgradable is
    Initializable,
    ERC165Upgradeable,
    IERC2981Royalties,
    AdminManagerUpgradable
{
    struct RoyaltyInfo {
        address recipient;
        uint24 amount;
    }

    RoyaltyInfo private _royalties;
    uint256 constant maxValue = 10000;

    event RoyaltiesSet(address recipient, uint256 amount);

    function __Royalties_init(address recipient_, uint256 amount_)
        internal
        onlyInitializing
    {
        __AdminManager_init_unchained();
        __Royalties_init_unchained(recipient_, amount_);
    }

    function __Royalties_init_unchained(address recipient_, uint256 amount_)
        internal
        onlyInitializing
    {
        _setRoyalties(recipient_, amount_);
    }

    function _setRoyalties(address recipient_, uint256 amount_) internal {
        require(amount_ <= maxValue, "Royalties: value is too high");
        _royalties = RoyaltyInfo(recipient_, uint24(amount_));
        emit RoyaltiesSet(recipient_, amount_);
    }

    function setRoyalties(address recipient_, uint256 amount_)
        external
        onlyAdmin
    {
        _setRoyalties(recipient_, amount_);
    }

    function royaltyInfo(uint256, uint256 value_)
        external
        view
        override
        returns (address receiver, uint256 royaltyAmount)
    {
        RoyaltyInfo memory royalties = _royalties;
        receiver = royalties.recipient;
        royaltyAmount = (value_ * royalties.amount) / maxValue;
    }

    function supportsInterface(bytes4 interfaceId_)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId_ == type(IERC2981Royalties).interfaceId ||
            super.supportsInterface(interfaceId_);
    }

    uint256[49] private __gap;
}

File 10 of 37 : SignerUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";

contract SignerUpgradeable is Initializable, EIP712Upgradeable, AdminManagerUpgradable {
    using ECDSAUpgradeable for bytes32;

    address public signer;

    function __Signer_init(string memory name, string memory version, address signer_) internal onlyInitializing {
        __AdminManager_init_unchained();
        __Signer_init_unchained(name, version, signer_);
        __EIP712_init(name, version);
    }

    function __Signer_init_unchained(string memory name, string memory version, address signer_)
        internal
        onlyInitializing
    {
        __EIP712_init(name, version);
        signer = signer_;
    }

    function _verify(bytes32 digest, bytes calldata signature)
        internal
        view
        returns (bool)
    {
        address recoveredSigner = digest.recover(signature);
        return signer == recoveredSigner;
    }

    uint256[49] private __gap;
}

File 11 of 37 : ReservedSupplyUpgradeable.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";

abstract contract ReservedSupplyUpgradable is Initializable, AdminManagerUpgradable {
    mapping(uint256 => uint256) internal _reserved;

    function __ReservedSupply_init(uint256 maxSupply_) internal onlyInitializing {
        __AdminManager_init_unchained();
        __ReservedSupply_init_unchained(maxSupply_);
    }

    function __ReservedSupply_init_unchained(uint256 maxSupply_)
        internal
        onlyInitializing
    {
    }

    function setReservedSupply(uint256 id_, uint256 reserved_) public onlyAdmin {
        _reserved[id_] = reserved_;
    }

    function reservedSupply(uint256 id_) external view returns (uint256) {
        return _reserved[id_];
    }

    modifier onlyInReserved(uint256 id_, uint256 amount_) {
        uint256 reserved = _reserved[id_];
        require(reserved - amount_ >= 0, "Exceeds supply");
        _reserved[id_] -= amount_;
        _;
    }

    uint256[49] private __gap;
}

File 12 of 37 : UriManagerUpgradable.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";

contract UriManagerUpgradable is Initializable, AdminManagerUpgradable {
    using StringsUpgradeable for uint256;

    string internal _prefix;
    string internal _suffix;

    function prefix() public view returns (string memory) {
        return _prefix;
    }

    function suffix() public view returns (string memory) {
        return _suffix;
    }

    function __UriManager_init(string memory prefix_, string memory suffix_)
        internal
        onlyInitializing
    {
        __AdminManager_init_unchained();
        __UriManager_init_unchained(prefix_, suffix_);
    }

    function __UriManager_init_unchained(
        string memory prefix_,
        string memory suffix_
    ) internal onlyInitializing {
        _prefix = prefix_;
        _suffix = suffix_;
    }

    function _buildUri(uint256 tokenId) internal view returns (string memory) {
        return string(abi.encodePacked(_prefix, tokenId.toString(), _suffix));
    }

    function setPrefix(string calldata prefix_) external onlyAdmin {
        _prefix = prefix_;
    }

    function setSuffix(string calldata suffix_) external onlyAdmin {
        _suffix = suffix_;
    }

    uint256[48] private __gap;
}

File 13 of 37 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 14 of 37 : IERC5267Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.0;

interface IERC5267Upgradeable {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 15 of 37 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 16 of 37 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 {Initializable} from "../../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 {
        __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: address zero is not a valid owner");
        return _balances[id][account];
    }

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

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

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

        return batchBalances;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

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

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

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try 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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[47] private __gap;
}

File 17 of 37 : 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 18 of 37 : IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

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

File 19 of 37 : IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 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 37 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library 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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 21 of 37 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

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

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

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 22 of 37 : draft-EIP712Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

// EIP-712 is Final as of 2022-08-11. This file is deprecated.

import "./EIP712Upgradeable.sol";

File 23 of 37 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

File 24 of 37 : EIP712Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.8;

import "./ECDSAUpgradeable.sol";
import "../../interfaces/IERC5267Upgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * _Available since v3.4._
 *
 * @custom:storage-size 52
 */
abstract contract EIP712Upgradeable is Initializable, IERC5267Upgradeable {
    bytes32 private constant _TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    /// @custom:oz-renamed-from _HASHED_NAME
    bytes32 private _hashedName;
    /// @custom:oz-renamed-from _HASHED_VERSION
    bytes32 private _hashedVersion;

    string private _name;
    string private _version;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {
        __EIP712_init_unchained(name, version);
    }

    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
        _name = name;
        _version = version;

        // Reset prior values in storage if upgrading
        _hashedName = 0;
        _hashedVersion = 0;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        return _buildDomainSeparator();
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {EIP-5267}.
     *
     * _Available since v4.9._
     */
    function eip712Domain()
        public
        view
        virtual
        override
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized
        // and the EIP712 domain is not reliable, as it will be missing name and version.
        require(_hashedName == 0 && _hashedVersion == 0, "EIP712: Uninitialized");

        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712Name() internal virtual view returns (string memory) {
        return _name;
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712Version() internal virtual view returns (string memory) {
        return _version;
    }

    /**
     * @dev The hash of the name parameter for the EIP712 domain.
     *
     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.
     */
    function _EIP712NameHash() internal view returns (bytes32) {
        string memory name = _EIP712Name();
        if (bytes(name).length > 0) {
            return keccak256(bytes(name));
        } else {
            // If the name is empty, the contract may have been upgraded without initializing the new storage.
            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.
            bytes32 hashedName = _hashedName;
            if (hashedName != 0) {
                return hashedName;
            } else {
                return keccak256("");
            }
        }
    }

    /**
     * @dev The hash of the version parameter for the EIP712 domain.
     *
     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.
     */
    function _EIP712VersionHash() internal view returns (bytes32) {
        string memory version = _EIP712Version();
        if (bytes(version).length > 0) {
            return keccak256(bytes(version));
        } else {
            // If the version is empty, the contract may have been upgraded without initializing the new storage.
            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.
            bytes32 hashedVersion = _hashedVersion;
            if (hashedVersion != 0) {
                return hashedVersion;
            } else {
                return keccak256("");
            }
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[48] private __gap;
}

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 26 of 37 : 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 27 of 37 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 28 of 37 : SignedMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMathUpgradeable {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 29 of 37 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 30 of 37 : ICards.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

interface ICards {
    function mint(address, uint256) external;
    function totalSupply() external view returns (uint256);
}

File 31 of 37 : IRandomizer.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

interface IRandomizer {
    function random(uint256, address) external returns (uint256);
}

File 32 of 37 : IERC721ABurnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721AUpgradeable.sol';

/**
 * @dev Interface of ERC721ABurnable.
 */
interface IERC721ABurnableUpgradeable is IERC721AUpgradeable {
    /**
     * @dev Burns `tokenId`. See {ERC721A-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) external;
}

File 33 of 37 : IERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721AUpgradeable {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 35 of 37 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

File 36 of 37 : DefaultOperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFiltererUpgradeable} from "./OperatorFiltererUpgradeable.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "../lib/Constants.sol";

/**
 * @title  DefaultOperatorFiltererUpgradeable
 * @notice Inherits from OperatorFiltererUpgradeable and automatically subscribes to the default OpenSea subscription
 *         when the init function is called.
 */
abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable {
    /// @dev The upgradeable initialize function that should be called when the contract is being deployed.
    function __DefaultOperatorFilterer_init() internal onlyInitializing {
        OperatorFiltererUpgradeable.__OperatorFilterer_init(CANONICAL_CORI_SUBSCRIPTION, true);
    }
}

File 37 of 37 : OperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  OperatorFiltererUpgradeable
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry when the init function is called.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFiltererUpgradeable is Initializable {
    /// @notice Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    /// @dev The upgradeable initialize function that should be called when the contract is being upgraded.
    function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe)
        internal
        onlyInitializing
    {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) {
                if (subscribe) {
                    OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    if (subscriptionOrRegistrantToCopy != address(0)) {
                        OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                    } else {
                        OPERATOR_FILTER_REGISTRY.register(address(this));
                    }
                }
            }
        }
    }

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"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":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"GbabiesBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"cardId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startingId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"PacketOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"QuillsBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RoyaltiesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"activeIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts_","type":"address[]"},{"internalType":"uint256[]","name":"amounts_","type":"uint256[]"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adminMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"stageId_","type":"uint8"}],"name":"balanceLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256[]","name":"gbabies","type":"uint256[]"},{"internalType":"uint256[]","name":"quills","type":"uint256[]"}],"name":"burnMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"cardsContract","outputs":[{"internalType":"contract ICards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"stageId_","type":"uint8"},{"internalType":"address","name":"account_","type":"address"}],"name":"currentBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discountPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gbabiesContract","outputs":[{"internalType":"contract IERC721ABurnableUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"numbers","type":"uint256[]"}],"name":"getTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"idToCards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"prefix_","type":"string"},{"internalType":"string","name":"suffix_","type":"string"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"address","name":"_signer","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"to","type":"address"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"open","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct Packets.PresaleRequest","name":"request","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Packets.MintRequest[]","name":"mintRequests","type":"tuple[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"stage_","type":"uint8"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Packets.MintRequest[]","name":"mintRequests","type":"tuple[]"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"quillContract","outputs":[{"internalType":"contract IERC721ABurnableUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizer","outputs":[{"internalType":"contract IRandomizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"stageId_","type":"uint8"},{"internalType":"address","name":"account_","type":"address"}],"name":"remainingBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","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":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"setActiveIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"},{"internalType":"bool","name":"enable_","type":"bool"}],"name":"setAdminPermissions","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":"contract IERC721ABurnableUpgradeable","name":"gbabies","type":"address"},{"internalType":"contract IERC721ABurnableUpgradeable","name":"quills","type":"address"},{"internalType":"contract ICards","name":"cards","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_discountPrice","type":"uint256"}],"name":"setDiscountPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix_","type":"string"}],"name":"setPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"stage_","type":"uint8"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRandomizer","name":"_randomizer","type":"address"}],"name":"setRandomizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"suffix_","type":"string"}],"name":"setSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"setTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"suffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"stageId_","type":"uint8"},{"internalType":"uint256","name":"limit_","type":"uint256"}],"name":"updateBalanceLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506156fe80620000216000396000f3fe6080604052600436106102c75760003560e01c806384ad8e8f11610175578063b3066d49116100dc578063e4ab4bb911610095578063f242432a1161006f578063f242432a14610967578063f2fde38b14610987578063f7073c3a146109a7578063fc7643a3146109bc57600080fd5b8063e4ab4bb9146108b1578063e985e9c5146108fd578063f10fb5841461094657600080fd5b8063b3066d49146107c4578063b7fafcd7146107e4578063b903c05114610815578063bd85b03914610843578063c519cd1c14610871578063e188feda1461089157600080fd5b80638da5cb5b1161012e5780638da5cb5b146106fe5780639dca31d21461071c5780639f5226a21461073c578063a1258e5e14610753578063a22cb46514610773578063b1ba72d61461079357600080fd5b806384ad8e8f1461063f57806384b0196e1461065657806385cb593b1461067e5780638b78c1161461069e5780638be2227b146106be5780638c7ea24b146106de57600080fd5b80632e1a7d4d116102345780636dba1163116101ed57806375d5ae9f116101c757806375d5ae9f146105c957806375dadb32146105e9578063767bcab5146105fe5780637d07f3c61461061e57600080fd5b80636dba1163146105745780636fb438dc14610594578063715018a6146105b457600080fd5b80632e1a7d4d146104b45780632eb2c2d6146104d45780634e1273f4146104f45780636a00670b146105215780636a537455146105415780636c19e7831461055457600080fd5b80631d83f898116102865780631d83f898146103bd5780631e7269c5146103dd578063238ac93314610414578063240ff27f1461043557806324d7806c146104555780632a55205a1461047557600080fd5b806279ee21146102cc578062fdd58e1461030a578063012c57801461033857806301ffc9a71461034d5780630e89341c1461037d578063124370ad146103aa575b600080fd5b3480156102d857600080fd5b506101fd546102ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561031657600080fd5b5061032a6103253660046144cb565b6109dd565b604051908152602001610301565b61034b61034636600461453b565b610a78565b005b34801561035957600080fd5b5061036d610368366004614592565b610ac6565b6040519015158152602001610301565b34801561038957600080fd5b5061039d6103983660046145af565b610aef565b6040516103019190614618565b61034b6103b836600461466f565b610afa565b3480156103c957600080fd5b5061034b6103d83660046146da565b610b97565b3480156103e957600080fd5b5061032a6103f836600461474d565b6001600160a01b031660009081526101fe602052604090205490565b34801561042057600080fd5b506101c6546102ed906001600160a01b031681565b34801561044157600080fd5b5061034b610450366004614778565b610c7b565b34801561046157600080fd5b5061036d61047036600461474d565b610ccb565b34801561048157600080fd5b506104956104903660046147b1565b610ce9565b604080516001600160a01b039093168352602083019190915201610301565b3480156104c057600080fd5b5061034b6104cf3660046145af565b610d3f565b3480156104e057600080fd5b5061034b6104ef36600461491c565b610d71565b34801561050057600080fd5b5061051461050f3660046149c9565b610d98565b6040516103019190614ac6565b34801561052d57600080fd5b5061034b61053c366004614aea565b610ec1565b61034b61054f366004614b47565b610efd565b34801561056057600080fd5b5061034b61056f36600461474d565b6110aa565b34801561058057600080fd5b5061032a61058f366004614bcf565b6110f2565b3480156105a057600080fd5b5061032a6105af366004614bfb565b611137565b3480156105c057600080fd5b5061034b61117d565b3480156105d557600080fd5b5061034b6105e4366004614c30565b611191565b3480156105f557600080fd5b5061039d6111c9565b34801561060a57600080fd5b5061034b61061936600461474d565b61125c565b34801561062a57600080fd5b506101fb546102ed906001600160a01b031681565b34801561064b57600080fd5b5061032a6102005481565b34801561066257600080fd5b5061066b6112a4565b6040516103019796959493929190614c65565b34801561068a57600080fd5b5061034b610699366004614c30565b611342565b3480156106aa57600080fd5b5061034b6106b93660046145af565b611375565b3480156106ca57600080fd5b5061034b6106d93660046145af565b6113a0565b3480156106ea57600080fd5b5061034b6106f93660046144cb565b6113cb565b34801561070a57600080fd5b506097546001600160a01b03166102ed565b34801561072857600080fd5b5061034b610737366004614cd5565b6113fe565b34801561074857600080fd5b5061032a6101f85481565b34801561075f57600080fd5b5061034b61076e36600461466f565b61148d565b34801561077f57600080fd5b5061034b61078e366004614778565b61155c565b34801561079f57600080fd5b5061032a6107ae366004614d21565b60ff1660009081526101c5602052604090205490565b3480156107d057600080fd5b5061034b6107df366004614d3c565b611570565b3480156107f057600080fd5b5061032a6107ff366004614d21565b60ff166000908152610161602052604090205490565b34801561082157600080fd5b5061032a6108303660046145af565b6101f96020526000908152604090205481565b34801561084f57600080fd5b5061032a61085e3660046145af565b60009081526101fa602052604090205490565b34801561087d57600080fd5b5061034b61088c366004614aea565b6115d7565b34801561089d57600080fd5b5061034b6108ac366004614d87565b611613565b3480156108bd57600080fd5b5061032a6108cc366004614bcf565b60ff821660009081526101c5602090815260408083206001600160a01b038516845260010190915290205492915050565b34801561090957600080fd5b5061036d610918366004614e5e565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b34801561095257600080fd5b50610201546102ed906001600160a01b031681565b34801561097357600080fd5b5061034b610982366004614e7c565b6120fd565b34801561099357600080fd5b5061034b6109a236600461474d565b612124565b3480156109b357600080fd5b5061039d61219a565b3480156109c857600080fd5b506101fc546102ed906001600160a01b031681565b60006001600160a01b038316610a4d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b6002806101f85414610a9c5760405162461bcd60e51b8152600401610a4490614ee4565b6000806000610aab86866121aa565b93509350509250610abe338383866123a6565b505050505050565b6000610ad1826123ca565b80610ae05750610ae08261241a565b80610a725750610a728261241a565b6060610a728261243f565b6001806101f85414610b1e5760405162461bcd60e51b8152600401610a4490614ee4565b6000610b2a8686612478565b509050600080610b6c86868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061266392505050565b90925090506000610b7d8385614f1c565b9050610b8c3382600185612888565b505050505050505050565b610ba033610ccb565b610bbc5760405162461bcd60e51b8152600401610a4490614f2f565b83828114610c0c5760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610a44565b60005b81811015610c7257610c60878783818110610c2c57610c2c614f55565b9050602002016020810190610c41919061474d565b84878785818110610c5457610c54614f55565b9050602002013561288f565b80610c6a81614f6b565b915050610c0f565b50505050505050565b610c8433610ccb565b610ca05760405162461bcd60e51b8152600401610a4490614f2f565b6001600160a01b0391909116600090815260fd60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260fd602052604090205460ff1690565b60408051808201909152610193546001600160a01b038116808352600160a01b90910462ffffff1660208301819052909160009161271090610d2b9086614f84565b610d359190614fb1565b9150509250929050565b610d4833610ccb565b610d645760405162461bcd60e51b8152600401610a4490614f2f565b610d6e33826128b4565b50565b846001600160a01b0381163314610d8b57610d8b336129cd565b610abe8686868686612a86565b60608151835114610dfd5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610a44565b600083516001600160401b03811115610e1857610e186147d3565b604051908082528060200260200182016040528015610e41578160200160208202803683370190505b50905060005b8451811015610eb957610e8c858281518110610e6557610e65614f55565b6020026020010151858381518110610e7f57610e7f614f55565b60200260200101516109dd565b828281518110610e9e57610e9e614f55565b6020908102919091010152610eb281614f6b565b9050610e47565b509392505050565b610eca33610ccb565b610ee65760405162461bcd60e51b8152600401610a4490614f2f565b60ff90911660009081526101616020526040902055565b8482826000610f6284604080517f3a58bb770b0fdc7635f4460ad845c6fcf18032144a6cadcfce202c2ac00887b86020820152823591810191909152336060820152600090608001604051602081830303815290604052805190602001209050919050565b90506000610f6f82612ad2565b9050610f7c818585612aff565b610fbc5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610a44565b6001806101f85414610fe05760405162461bcd60e51b8152600401610a4490614ee4565b600080600080610ff08e8e6121aa565b3360009081526101fe6020526040902054939750919550935091508f3590611019908590614f1c565b11156110675760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74206d696e74206d6f7265207468616e2061737369676e65642e006044820152606401610a44565b3360009081526101fe602052604081208054859290611087908490614f1c565b909155506110999050338383876123a6565b505050505050505050505050505050565b6110b333610ccb565b6110cf5760405162461bcd60e51b8152600401610a4490614f2f565b6101c680546001600160a01b0319166001600160a01b0392909216919091179055565b60ff821660008181526101c5602081815260408084206001600160a01b03871685526001810183529084205494845291905254909161113091614fc5565b9392505050565b60008060005b83811015610eb95784848281811061115757611157614f55565b90506020020135826111699190614f1c565b91508061117581614f6b565b91505061113d565b611185612b5f565b61118f6000612bb9565b565b61119a33610ccb565b6111b65760405162461bcd60e51b8152600401610a4490614f2f565b6101306111c4828483615058565b505050565b606061012f80546111d990614fd8565b80601f016020809104026020016040519081016040528092919081815260200182805461120590614fd8565b80156112525780601f1061122757610100808354040283529160200191611252565b820191906000526020600020905b81548152906001019060200180831161123557829003601f168201915b5050505050905090565b61126533610ccb565b6112815760405162461bcd60e51b8152600401610a4490614f2f565b61020180546001600160a01b0319166001600160a01b0392909216919091179055565b60006060806000806000606060c9546000801b1480156112c4575060ca54155b6113085760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610a44565b611310612c0b565b611318612c1a565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b61134b33610ccb565b6113675760405162461bcd60e51b8152600401610a4490614f2f565b61012f6111c4828483615058565b61137e33610ccb565b61139a5760405162461bcd60e51b8152600401610a4490614f2f565b61020055565b6113a933610ccb565b6113c55760405162461bcd60e51b8152600401610a4490614f2f565b6101f855565b6113d433610ccb565b6113f05760405162461bcd60e51b8152600401610a4490614f2f565b6113fa8282612c29565b5050565b61140733610ccb565b6114235760405162461bcd60e51b8152600401610a4490614f2f565b60005b82518110156111c45781818151811061144157611441614f55565b60200260200101516101fa600085848151811061146057611460614f55565b6020026020010151815260200190815260200160002081905550808061148590614f6b565b915050611426565b3233146114dc5760405162461bcd60e51b815260206004820152601760248201527f4e6f2063616c6c732066726f6d20636f6e7472616374730000000000000000006044820152606401610a44565b61154a3385858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612cf892505050565b61155684848484612efd565b50505050565b81611566816129cd565b6111c4838361328b565b61157933610ccb565b6115955760405162461bcd60e51b8152600401610a4490614f2f565b6101fb80546001600160a01b039485166001600160a01b0319918216179091556101fc8054938516938216939093179092556101fd8054919093169116179055565b6115e033610ccb565b6115fc5760405162461bcd60e51b8152600401610a4490614f2f565b60ff90911660009081526101c56020526040902055565b600054610100900460ff16158080156116335750600054600160ff909116105b8061164d5750303b15801561164d575060005460ff166001145b6116b05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a44565b6000805460ff1916600117905580156116d3576000805461ff0019166101001790555b6116db613296565b6116e588886132d9565b6116fd6040518060200160405280600081525061331b565b61170561334b565b61170d613372565b61171786866133b8565b6117228484846133df565b7f0fce300cb38468eb74fecbca14de83ce9c827df14e4f90e2449f69b859ecb7128054600160ff1991821681179092557f59ba01267bf386871d93da16f79c2ff0bf73afef855c69ba8e727970f1f2c4c580548216831790557fa3ffa8264a5e43c979a94cd4848e9fa70bcb5af03add8c35380313d93f3e610180548216831790557f73d34c2884f94502fb1d482d02192caf4163842c8b93f9671f6082ba5a1ccf1580548216831790557f16c772b3e9aa319f7b7063aa3a3b86f1e75b554ade9d2e02be3d108ab97d931d80548216831790557f613d2f107b65d492ce98c78bafc70483b02579c4c2a57b88a15de777b57853f980548216831790557ff82425ba2020962b727a45b075b4a45d34e855c8da28a2e2f9b8149d2b5b88da80548216831790557f3bf756f4f6de00e05064edcadb575abef66a6acd701543e9469773f01163b6f480548216831790557f7f560f58c48d9de9bd66199cf84cbd6e6c81f9eaa8e9f04ff16c7a188b81168980548216831790557fdc11582e20e8b419f44ef4b3ebd28703c8a3c74d6378e4c7fe774a4bdf335c9280548216831790557f6406646511812cf097202fa10abfafb65c31155bff0b1e7dea2a3227c59c649880548216831790557f660dfbda5e85c811ff501dd9dcb165268f2f8830c7a1cbe7382126b9c738317780548216831790557ff67bc9a4b66294bfdbf1b0d507c254cda8453e05d53e0db51f7fa909b0f871b780548216831790557f37cd7bdfc604dbe39b5a7eb662363ecf6d3bd2140a3e357b84914821d942003580548216831790557fea2b69042b9e56e72eaffbbd839ce5cb4ce164c02952c3b86518d0db363cb6a080548216831790557fbb3034968a1979a8b7c32b8b8a40ddfcf923f157933cf83a86bbae484c31448080548216831790557fbea13c12d2091a85dd289e25e152450ea69e7821d8512311a824cb1ab19e8bec80548216831790557fe297f7ae1dbdff1d42155d68ee2c56a75180c4ac9179abba9b6efe55830a98f180548216831790557fdb0c88756833889a6af9845fcd8bd92ee609b9fad9165019577ac3a347d5870880548216831790557f7df666c72a50cb121dc34c5f1abf76c6e4f4ea9ae8350166d9ddcc9ae9d7808280548216831790557fb9714805c7b3a77afb2a8f70f953ce61bc41586afc4eb861a74d7ebd94384d0780548216831790557f5313ec90783836f995e51fb54cb5eb98553235c5d7f21b5a1051793523fc1cb980548216831790557ff0ad01455ebbd8cb771c98c564728f27ece9d7bd0c4cabda1d1d88717fe6d4a980548216831790557fb58684937ee37d7fb216ab0eda0b249fa588867b8b1759c2de687f80beda8e0980548216831790557f3b14d300f2f2a0701352086d3282ea36b93ddf2725226c878676188079ba811c80548216831790557ff4411caeb5e2bface4391e1aef41d77f775e5333d7316875fde3f8361619c59f80548216831790557f6c2d63af380e0eceb743755a5f5b822ada762a1b133df6bc208edd9faefd533780548216831790557f192902ca3444f6faf70d44bd64dbb7c9f342a4f1a3fa7ad07b00d424eac4b4ee80548216831790557fa2715a586f6d609d754132e374a42e40a6a024639e55cc2502b75e8897be72d480548216831790557ed5ae7eb37741d0b2942dd1fc029e7ef678156beb7f900b349071c3ce16465180548216831790557fb51b176d02a727cc74f941cf931ee9109e6b6b7ea099826c49342c26d209fb7f80548216831790557f40602445ae4eb2b0401c4c082838101ada040da73af4c1e90405082b069980b780548216831790557f9b2dac4b2aa2a5223062d57634f2ed14c03dac74d52c4c280282e519598a751d80548216831790557fd20fff4ff6cf6d1532c234b24c174f7d7dbb5f120559ec61d86cb0de76d4050a80548216831790557f1f83f6b8269c0b66e43cf25da0616a589681d93f350a2441d1c5ba7562679d1b80548216831790557fd1eaaf1c8f7fcac48f592dc6e6e47c9868d2493d22943398bff3522796903d5a80548216831790557f5b9c0b10b3bbc426ed8d675596135c1db5aff3d12933f77d97353bfba6a58bf680548216831790557fd3dd03f1fcd8d6d8ab160cf23964fc8d311babb0e7432cf9b1de698cbf879f3080548216831790557fcb161adaca6aabda2bdbc31b005604360ef3d7b10f4d2c4911d7997d94c57f8780548216831790557fce25c3e4ee22b82018b611b5afbb45cf93b58c8d6c7444d7a5dc9aa68c77ede280548216831790557f3111189fcca8bdefe3408954435c72bff1d0d9d79b3c11a1b6a8077f3325e58880548216831790557f15ee2e948bffa5fdf2f9b720efd8a6b6f8d6253930287c6694fa29c953edf64d80548216831790557f51dd4ecf048e5ef9f120ad4867b9652e64ae658bbf0deba2d7007b9b6326870280548216831790557f6e7812f35333e8d53566fe4a02f6850ba0b565ae833a017f1b744a86935494f980548216831790557f36e61c1b165a53f9e7fd7744b4f2f07270e6e6c93ccf7411473f28b97988208e80548216831790557f68902c1f5c0e52260f9dda967915da7523dcadc897709a3d3afeb40e8653e0ea80548216831790557fe372229435f273febf91ed768bf05446c35571ea5754ec28b0d2923aba53120680548216831790557f5aa5559585048f3c964b3f5f4e39bce41bd612c4f06341c3a2aa036370c29b6880548216831790557fd79156eaf85a77246f601fbeac91678a6a91e5270dda48fe0c8b8bc316ffa80780548216831790557f4588dd0f42eb06fa793bda52a25a76de6a7ff318532209bc7aadb1f962d0410e80549091168217905560057f5b9f4b3e29890e534851db0cc79af03a5861e973ebcc43c7ce7cbdc915ba9a225560197f180e5813c3d6dbfee391bda7c78a90e203593745fe288889e8b2038f078555305560647f788174486a78305a53e7f3e30c324b94119d348367a3cfe5909b18edcfd9f64b5560287feba31e7744486a1f8c0ba38c1831362670e464a45551370ddc3c482a7eb80b2d556101fa6020526114697f2c17d8e16e644355d48164662e8241a4a6ff9a8c44105e370a0d2b48fb07ac295561054b7f6b33b97f10a67f0f027b3dea661ff36fa406ac9e17a8d1467a69c91fb57d930e556101907f4c562ee05b53c60534273a7283dda48ec043d8301a3b338f9d90f9d8feee173f55600460005261012c7fa5fe82759daa34724fec0874734ce9efeb1de663eaee6bfa08b7aac2e6479b325561206b9066071afd498d0000610ec1565b6606651728988000610200556120896002661c6bf526340000610ec1565b61209b6003664fefa17b724000610ec1565b6120ad6004662c68af0bb14000610ec1565b80156120f3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b846001600160a01b038116331461211757612117336129cd565b610abe8686868686613435565b61212c612b5f565b6001600160a01b0381166121915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a44565b610d6e81612bb9565b606061013080546111d990614fd8565b60008060608082808681816001600160401b038111156121cc576121cc6147d3565b6040519080825280602002602001820160405280156121f5578160200160208202803683370190505b5090506000826001600160401b03811115612212576122126147d3565b60405190808252806020026020018201604052801561223b578160200160208202803683370190505b50905060005b8381101561235b5760008c8c8381811061225d5761225d614f55565b9050604002018036038101906122739190615117565b80519091506005811080156122885750600081115b6122c15760405162461bcd60e51b815260206004820152600a602482015269125b9d985b1a5908125160b21b6044820152606401610a44565b60208201516122d0828261347a565b60ff8216600090815261016160205260409020546122ee8282614f84565b6122f8908b614f1c565b9950612304828a614f1c565b98508287868151811061231957612319614f55565b6020026020010181815250508186868151811061233857612338614f55565b60200260200101818152505050505050808061235390614f6b565b915050612241565b50600084116123955760405162461bcd60e51b8152600401610a44906020808252600490820152635a65726f60e01b604082015260600190565b939a92995097509195509350505050565b6123c1848484604051806020016040528060008152506134fc565b61155681613648565b60006001600160e01b03198216636cdb3d1360e11b14806123fb57506001600160e01b031982166303a24d0760e21b145b80610a7257506301ffc9a760e01b6001600160e01b0319831614610a72565b60006001600160e01b0319821663152a902d60e11b1480610a725750610a72826123ca565b606061012f61244d836136ca565b610130604051602001612462939291906151d8565b6040516020818303038152906040529050919050565b6000808280820361249057600080925092505061265c565b6000805b828110156126195760008787838181106124b0576124b0614f55565b6101fb546040516331a9108f60e11b8152602092909202939093013560048201819052935033926001600160a01b03169150636352211e90602401602060405180830381865afa158015612508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252c919061520b565b6001600160a01b03161461256e5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b6044820152606401610a44565b60008181526101ff602052604090205460ff161561259857612591600284614f1c565b92506125a6565b826125a281614f6b565b9350505b6101fb54604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b1580156125ed57600080fd5b505af1158015612601573d6000803e3d6000fd5b5050505050808061261190614f6b565b915050612494565b506040805182815242602082015233917f70b70c02602ca6e3674cf269aee296d4ec20016bd0640168d48dc4c0ffd8f4eb910160405180910390a2925060009150505b9250929050565b8051600090819080820361267d5750600093849350915050565b612688600282615228565b156126cd5760405162461bcd60e51b815260206004820152601560248201527426bab9ba103132903234bb34b9b1363290313c901960591b6044820152606401610a44565b60005b818110156128235760008582815181106126ec576126ec614f55565b60209081029190910101516101fc546040516331a9108f60e11b81526004810183905291925033916001600160a01b0390911690636352211e90602401602060405180830381865afa158015612746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061276a919061520b565b6001600160a01b0316146127b05760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21027bbb732b960991b6044820152606401610a44565b6101fc54604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b1580156127f757600080fd5b505af115801561280b573d6000803e3d6000fd5b5050505050808061281b90614f6b565b9150506126d0565b506040805182815242602082015233917f79fab521652b87c8011ae6ea52cbe559f476249bc98c7e473977e9ccb5d9ca11910160405180910390a2600061286b600283614fb1565b905080610200548261287d9190614f84565b935093505050915091565b6123c18484845b612899818361347a565b6111c48382846040518060200160405280600081525061375c565b804710156129045760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a44565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612951576040519150601f19603f3d011682016040523d82523d6000602084013e612956565b606091505b50509050806111c45760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a44565b6daaeb6d7670e522a718067333cd4e3b15610d6e57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612a3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5e919061523c565b610d6e57604051633b79c77360e21b81526001600160a01b0382166004820152602401610a44565b6001600160a01b038516331480612aa25750612aa28533610918565b612abe5760405162461bcd60e51b8152600401610a4490615259565b612acb858585858561382f565b5050505050565b6000610a72612adf6139c6565b8360405161190160f01b8152600281019290925260228201526042902090565b600080612b4484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525089939250506139d59050565b6101c6546001600160a01b0391821691161495945050505050565b6097546001600160a01b0316331461118f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a44565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060cb80546111d990614fd8565b606060cc80546111d990614fd8565b612710811115612c7b5760405162461bcd60e51b815260206004820152601c60248201527f526f79616c746965733a2076616c756520697320746f6f2068696768000000006044820152606401610a44565b6040805180820182526001600160a01b03841680825262ffffff8416602092830181905261019380546001600160b81b0319168317600160a01b90920291909117905582519081529081018390527f908669f35f6fb3977a956ba70597841fe541d1e8491ca3c025161e258d3bfdb6910160405180910390a15050565b6001600160a01b038316612d5a5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610a44565b8051825114612d7b5760405162461bcd60e51b8152600401610a44906152a7565b604080516020810190915260009081905233905b8351811015612e90576000848281518110612dac57612dac614f55565b602002602001015190506000848381518110612dca57612dca614f55565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612e575760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610a44565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612e8881614f6b565b915050612d8f565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612ee19291906152ef565b60405180910390a4604080516020810190915260009052611556565b6101fd54604080516318160ddd60e01b8152905185926000926001600160a01b03909116916318160ddd916004808201926020929091908290030181865afa158015612f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f71919061531d565b90506000612f80826001614f1c565b905060005b838110156131c2576000888883818110612fa157612fa1614f55565b9050602002013590506000878784818110612fbe57612fbe614f55565b90506020020135905080600003612fd65750506131b0565b816004036131295760005b81811015613123576102015460405163459a4f9f60e11b8152600481018790523360248201526000916001600160a01b031690638b349f3e906044016020604051808303816000875af115801561303c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613060919061531d565b9050600081116130a85760405162461bcd60e51b81526020600482015260136024820152724572726f723a204f7574206f662073746f636b60681b6044820152606401610a44565b60008181526101f9602090815260409182902054825184815291820189905291810182905242606082015233907f0a687302320f32c8a887a190a8e55d073eccceafc6b5534bce199380854e3bff9060800160405180910390a261310c8188614f1c565b96505050808061311b90614f6b565b915050612fe1565b506131ad565b60008281526101f96020526040812054905b828110156131aa57604080518581526020810188905290810183905242606082015233907f0a687302320f32c8a887a190a8e55d073eccceafc6b5534bce199380854e3bff9060800160405180910390a26131968287614f1c565b9550806131a281614f6b565b91505061313b565b50505b50505b806131ba81614f6b565b915050612f85565b50600060016131d18484614fc5565b6131db9190614fc5565b90506000811161321c5760405162461bcd60e51b815260206004820152600c60248201526b4d696e74696e67205a65726f60a01b6044820152606401610a44565b6101fd546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561326957600080fd5b505af115801561327d573d6000803e3d6000fd5b505050505050505050505050565b6113fa3383836139f1565b600054610100900460ff166132bd5760405162461bcd60e51b8152600401610a4490615336565b33600090815260fd60205260409020805460ff19166001179055565b600054610100900460ff166133005760405162461bcd60e51b8152600401610a4490615336565b61012f61330d8382615381565b506101306111c48282615381565b600054610100900460ff166133425760405162461bcd60e51b8152600401610a4490615336565b610d6e81613ad1565b600054610100900460ff1661118f5760405162461bcd60e51b8152600401610a4490615336565b600054610100900460ff166133995760405162461bcd60e51b8152600401610a4490615336565b61118f733cc6cdda760b79bafa08df41ecfa224f810dceb66001613add565b600054610100900460ff166113f05760405162461bcd60e51b8152600401610a4490615336565b600054610100900460ff166134065760405162461bcd60e51b8152600401610a4490615336565b6134108383613c7c565b6101c680546001600160a01b0319166001600160a01b03929092169190911790555050565b6001600160a01b03851633148061345157506134518533610918565b61346d5760405162461bcd60e51b8152600401610a4490615259565b612acb8585858585613cad565b60008281526101fa6020526040812054613495908390614fc5565b10156134d45760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320537570706c7960901b6044820152606401610a44565b60008281526101fa6020526040812080548392906134f3908490614fc5565b90915550505050565b6001600160a01b0384166135225760405162461bcd60e51b8152600401610a4490615440565b81518351146135435760405162461bcd60e51b8152600401610a44906152a7565b3360005b84518110156135e05783818151811061356257613562614f55565b60200260200101516065600087848151811061358057613580614f55565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135c89190614f1c565b909155508190506135d881614f6b565b915050613547565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516136319291906152ef565b60405180910390a4612acb81600087878787613dd0565b803410156136895760405162461bcd60e51b815260206004820152600e60248201526d141c9a58d94e881a5b9d985b1a5960921b6044820152606401610a44565b60006136958234614fc5565b905080156113fa57604051339082156108fc029083906000818181858888f193505050501580156111c4573d6000803e3d6000fd5b606060006136d783613f2b565b60010190506000816001600160401b038111156136f6576136f66147d3565b6040519080825280601f01601f191660200182016040528015613720576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461372a57509392505050565b6001600160a01b0384166137825760405162461bcd60e51b8152600401610a4490615440565b33600061378e85614003565b9050600061379b85614003565b905060008681526065602090815260408083206001600160a01b038b168452909152812080548792906137cf908490614f1c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610c728360008989898961404e565b81518351146138505760405162461bcd60e51b8152600401610a44906152a7565b6001600160a01b0384166138765760405162461bcd60e51b8152600401610a4490615481565b3360005b845181101561396057600085828151811061389757613897614f55565b6020026020010151905060008583815181106138b5576138b5614f55565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156139065760405162461bcd60e51b8152600401610a44906154c6565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290613945908490614f1c565b925050819055505050508061395990614f6b565b905061387a565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516139b09291906152ef565b60405180910390a4610abe818787878787613dd0565b60006139d0614109565b905090565b60008060006139e4858561417d565b91509150610eb9816141bf565b816001600160a01b0316836001600160a01b031603613a645760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610a44565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60676113fa8282615381565b600054610100900460ff16613b045760405162461bcd60e51b8152600401610a4490615336565b6daaeb6d7670e522a718067333cd4e3b156113fa5760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015613b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b88919061523c565b6113fa578015613bfc57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015613be857600080fd5b505af1158015610abe573d6000803e3d6000fd5b6001600160a01b03821615613c4b5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401613bce565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401613bce565b600054610100900460ff16613ca35760405162461bcd60e51b8152600401610a4490615336565b6113fa8282614309565b6001600160a01b038416613cd35760405162461bcd60e51b8152600401610a4490615481565b336000613cdf85614003565b90506000613cec85614003565b905060008681526065602090815260408083206001600160a01b038c16845290915290205485811015613d315760405162461bcd60e51b8152600401610a44906154c6565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613d70908490614f1c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b8c848a8a8a8a8a61404e565b6001600160a01b0384163b15610abe5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613e149089908990889088908890600401615510565b6020604051808303816000875af1925050508015613e4f575060408051601f3d908101601f19168201909252613e4c9181019061556e565b60015b613efb57613e5b61558b565b806308c379a003613e945750613e6f6155a7565b80613e7a5750613e96565b8060405162461bcd60e51b8152600401610a449190614618565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610a44565b6001600160e01b0319811663bc197c8160e01b14610c725760405162461bcd60e51b8152600401610a4490615630565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613f6a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613f96576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613fb457662386f26fc10000830492506010015b6305f5e1008310613fcc576305f5e100830492506008015b6127108310613fe057612710830492506004015b60648310613ff2576064830492506002015b600a8310610a725760010192915050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061403d5761403d614f55565b602090810291909101015292915050565b6001600160a01b0384163b15610abe5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906140929089908990889088908890600401615678565b6020604051808303816000875af19250505080156140cd575060408051601f3d908101601f191682019092526140ca9181019061556e565b60015b6140d957613e5b61558b565b6001600160e01b0319811663f23a6e6160e01b14610c725760405162461bcd60e51b8152600401610a4490615630565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614134614358565b61413c6143b1565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008082516041036141b35760208301516040840151606085015160001a6141a7878285856143e2565b9450945050505061265c565b5060009050600261265c565b60008160048111156141d3576141d36156b2565b036141db5750565b60018160048111156141ef576141ef6156b2565b0361423c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a44565b6002816004811115614250576142506156b2565b0361429d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a44565b60038160048111156142b1576142b16156b2565b03610d6e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a44565b600054610100900460ff166143305760405162461bcd60e51b8152600401610a4490615336565b60cb61433c8382615381565b5060cc6143498282615381565b5050600060c981905560ca5550565b600080614363612c0b565b80519091501561437a578051602090910120919050565b60c95480156143895792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b6000806143bc612c1a565b8051909150156143d3578051602090910120919050565b60ca5480156143895792915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614419575060009050600361449d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561446d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166144965760006001925092505061449d565b9150600090505b94509492505050565b6001600160a01b0381168114610d6e57600080fd5b80356144c6816144a6565b919050565b600080604083850312156144de57600080fd5b82356144e9816144a6565b946020939093013593505050565b60008083601f84011261450957600080fd5b5081356001600160401b0381111561452057600080fd5b6020830191508360208260061b850101111561265c57600080fd5b6000806020838503121561454e57600080fd5b82356001600160401b0381111561456457600080fd5b614570858286016144f7565b90969095509350505050565b6001600160e01b031981168114610d6e57600080fd5b6000602082840312156145a457600080fd5b81356111308161457c565b6000602082840312156145c157600080fd5b5035919050565b60005b838110156145e35781810151838201526020016145cb565b50506000910152565b600081518084526146048160208601602086016145c8565b601f01601f19169290920160200192915050565b60208152600061113060208301846145ec565b60008083601f84011261463d57600080fd5b5081356001600160401b0381111561465457600080fd5b6020830191508360208260051b850101111561265c57600080fd5b6000806000806040858703121561468557600080fd5b84356001600160401b038082111561469c57600080fd5b6146a88883890161462b565b909650945060208701359150808211156146c157600080fd5b506146ce8782880161462b565b95989497509550505050565b6000806000806000606086880312156146f257600080fd5b85356001600160401b038082111561470957600080fd5b61471589838a0161462b565b9097509550602088013591508082111561472e57600080fd5b5061473b8882890161462b565b96999598509660400135949350505050565b60006020828403121561475f57600080fd5b8135611130816144a6565b8015158114610d6e57600080fd5b6000806040838503121561478b57600080fd5b8235614796816144a6565b915060208301356147a68161476a565b809150509250929050565b600080604083850312156147c457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561480e5761480e6147d3565b6040525050565b60006001600160401b0382111561482e5761482e6147d3565b5060051b60200190565b600082601f83011261484957600080fd5b8135602061485682614815565b60405161486382826147e9565b83815260059390931b850182019282810191508684111561488357600080fd5b8286015b8481101561489e5780358352918301918301614887565b509695505050505050565b600082601f8301126148ba57600080fd5b81356001600160401b038111156148d3576148d36147d3565b6040516148ea601f8301601f1916602001826147e9565b8181528460208386010111156148ff57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561493457600080fd5b853561493f816144a6565b9450602086013561494f816144a6565b935060408601356001600160401b038082111561496b57600080fd5b61497789838a01614838565b9450606088013591508082111561498d57600080fd5b61499989838a01614838565b935060808801359150808211156149af57600080fd5b506149bc888289016148a9565b9150509295509295909350565b600080604083850312156149dc57600080fd5b82356001600160401b03808211156149f357600080fd5b818501915085601f830112614a0757600080fd5b81356020614a1482614815565b604051614a2182826147e9565b83815260059390931b8501820192828101915089841115614a4157600080fd5b948201945b83861015614a68578535614a59816144a6565b82529482019490820190614a46565b96505086013592505080821115614a7e57600080fd5b50610d3585828601614838565b600081518084526020808501945080840160005b83811015614abb57815187529582019590820190600101614a9f565b509495945050505050565b6020815260006111306020830184614a8b565b803560ff811681146144c657600080fd5b60008060408385031215614afd57600080fd5b6144e983614ad9565b60008083601f840112614b1857600080fd5b5081356001600160401b03811115614b2f57600080fd5b60208301915083602082850101111561265c57600080fd5b60008060008060008587036080811215614b6057600080fd5b6040811215614b6e57600080fd5b5085945060408601356001600160401b0380821115614b8c57600080fd5b614b9889838a016144f7565b90965094506060880135915080821115614bb157600080fd5b50614bbe88828901614b06565b969995985093965092949392505050565b60008060408385031215614be257600080fd5b614beb83614ad9565b915060208301356147a6816144a6565b60008060208385031215614c0e57600080fd5b82356001600160401b03811115614c2457600080fd5b6145708582860161462b565b60008060208385031215614c4357600080fd5b82356001600160401b03811115614c5957600080fd5b61457085828601614b06565b60ff60f81b8816815260e060208201526000614c8460e08301896145ec565b8281036040840152614c9681896145ec565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050614cc78185614a8b565b9a9950505050505050505050565b60008060408385031215614ce857600080fd5b82356001600160401b0380821115614cff57600080fd5b614d0b86838701614838565b93506020850135915080821115614a7e57600080fd5b600060208284031215614d3357600080fd5b61113082614ad9565b600080600060608486031215614d5157600080fd5b8335614d5c816144a6565b92506020840135614d6c816144a6565b91506040840135614d7c816144a6565b809150509250925092565b600080600080600080600060e0888a031215614da257600080fd5b87356001600160401b0380821115614db957600080fd5b614dc58b838c016148a9565b985060208a0135915080821115614ddb57600080fd5b614de78b838c016148a9565b9750614df560408b016144bb565b965060608a0135955060808a0135915080821115614e1257600080fd5b614e1e8b838c016148a9565b945060a08a0135915080821115614e3457600080fd5b50614e418a828b016148a9565b925050614e5060c089016144bb565b905092959891949750929550565b60008060408385031215614e7157600080fd5b8235614beb816144a6565b600080600080600060a08688031215614e9457600080fd5b8535614e9f816144a6565b94506020860135614eaf816144a6565b9350604086013592506060860135915060808601356001600160401b03811115614ed857600080fd5b6149bc888289016148a9565b6020808252600890820152674e6f74206c69766560c01b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a7257610a72614f06565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201614f7d57614f7d614f06565b5060010190565b8082028115828204841417610a7257610a72614f06565b634e487b7160e01b600052601260045260246000fd5b600082614fc057614fc0614f9b565b500490565b81810381811115610a7257610a72614f06565b600181811c90821680614fec57607f821691505b60208210810361500c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156111c457600081815260208120601f850160051c810160208610156150395750805b601f850160051c820191505b81811015610abe57828155600101615045565b6001600160401b0383111561506f5761506f6147d3565b6150838361507d8354614fd8565b83615012565b6000601f8411600181146150b7576000851561509f5750838201355b600019600387901b1c1916600186901b178355612acb565b600083815260209020601f19861690835b828110156150e857868501358255602094850194600190920191016150c8565b50868210156151055760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006040828403121561512957600080fd5b604051604081018181106001600160401b038211171561514b5761514b6147d3565b604052823581526020928301359281019290925250919050565b6000815461517281614fd8565b6001828116801561518a576001811461519f576151ce565b60ff19841687528215158302870194506151ce565b8560005260208060002060005b858110156151c55781548a8201529084019082016151ac565b50505082870194505b5050505092915050565b60006151e48286615165565b84516151f48183602089016145c8565b61520081830186615165565b979650505050505050565b60006020828403121561521d57600080fd5b8151611130816144a6565b60008261523757615237614f9b565b500690565b60006020828403121561524e57600080fd5b81516111308161476a565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6040815260006153026040830185614a8b565b82810360208401526153148185614a8b565b95945050505050565b60006020828403121561532f57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b81516001600160401b0381111561539a5761539a6147d3565b6153ae816153a88454614fd8565b84615012565b602080601f8311600181146153e357600084156153cb5750858301515b600019600386901b1c1916600185901b178555610abe565b600085815260208120601f198616915b82811015615412578886015182559484019460019091019084016153f3565b50858210156154305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061553c90830186614a8b565b828103606084015261554e8186614a8b565b9050828103608084015261556281856145ec565b98975050505050505050565b60006020828403121561558057600080fd5b81516111308161457c565b600060033d11156155a45760046000803e5060005160e01c5b90565b600060443d10156155b55790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156155e457505050505090565b82850191508151818111156155fc5750505050505090565b843d87010160208285010111156156165750505050505090565b615625602082860101876147e9565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615200908301846145ec565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b260f7ad05466e57b637c560dd57f7c057506fe81ba7e23b1e197912df87f45c64736f6c63430008110033

Deployed Bytecode

0x6080604052600436106102c75760003560e01c806384ad8e8f11610175578063b3066d49116100dc578063e4ab4bb911610095578063f242432a1161006f578063f242432a14610967578063f2fde38b14610987578063f7073c3a146109a7578063fc7643a3146109bc57600080fd5b8063e4ab4bb9146108b1578063e985e9c5146108fd578063f10fb5841461094657600080fd5b8063b3066d49146107c4578063b7fafcd7146107e4578063b903c05114610815578063bd85b03914610843578063c519cd1c14610871578063e188feda1461089157600080fd5b80638da5cb5b1161012e5780638da5cb5b146106fe5780639dca31d21461071c5780639f5226a21461073c578063a1258e5e14610753578063a22cb46514610773578063b1ba72d61461079357600080fd5b806384ad8e8f1461063f57806384b0196e1461065657806385cb593b1461067e5780638b78c1161461069e5780638be2227b146106be5780638c7ea24b146106de57600080fd5b80632e1a7d4d116102345780636dba1163116101ed57806375d5ae9f116101c757806375d5ae9f146105c957806375dadb32146105e9578063767bcab5146105fe5780637d07f3c61461061e57600080fd5b80636dba1163146105745780636fb438dc14610594578063715018a6146105b457600080fd5b80632e1a7d4d146104b45780632eb2c2d6146104d45780634e1273f4146104f45780636a00670b146105215780636a537455146105415780636c19e7831461055457600080fd5b80631d83f898116102865780631d83f898146103bd5780631e7269c5146103dd578063238ac93314610414578063240ff27f1461043557806324d7806c146104555780632a55205a1461047557600080fd5b806279ee21146102cc578062fdd58e1461030a578063012c57801461033857806301ffc9a71461034d5780630e89341c1461037d578063124370ad146103aa575b600080fd5b3480156102d857600080fd5b506101fd546102ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561031657600080fd5b5061032a6103253660046144cb565b6109dd565b604051908152602001610301565b61034b61034636600461453b565b610a78565b005b34801561035957600080fd5b5061036d610368366004614592565b610ac6565b6040519015158152602001610301565b34801561038957600080fd5b5061039d6103983660046145af565b610aef565b6040516103019190614618565b61034b6103b836600461466f565b610afa565b3480156103c957600080fd5b5061034b6103d83660046146da565b610b97565b3480156103e957600080fd5b5061032a6103f836600461474d565b6001600160a01b031660009081526101fe602052604090205490565b34801561042057600080fd5b506101c6546102ed906001600160a01b031681565b34801561044157600080fd5b5061034b610450366004614778565b610c7b565b34801561046157600080fd5b5061036d61047036600461474d565b610ccb565b34801561048157600080fd5b506104956104903660046147b1565b610ce9565b604080516001600160a01b039093168352602083019190915201610301565b3480156104c057600080fd5b5061034b6104cf3660046145af565b610d3f565b3480156104e057600080fd5b5061034b6104ef36600461491c565b610d71565b34801561050057600080fd5b5061051461050f3660046149c9565b610d98565b6040516103019190614ac6565b34801561052d57600080fd5b5061034b61053c366004614aea565b610ec1565b61034b61054f366004614b47565b610efd565b34801561056057600080fd5b5061034b61056f36600461474d565b6110aa565b34801561058057600080fd5b5061032a61058f366004614bcf565b6110f2565b3480156105a057600080fd5b5061032a6105af366004614bfb565b611137565b3480156105c057600080fd5b5061034b61117d565b3480156105d557600080fd5b5061034b6105e4366004614c30565b611191565b3480156105f557600080fd5b5061039d6111c9565b34801561060a57600080fd5b5061034b61061936600461474d565b61125c565b34801561062a57600080fd5b506101fb546102ed906001600160a01b031681565b34801561064b57600080fd5b5061032a6102005481565b34801561066257600080fd5b5061066b6112a4565b6040516103019796959493929190614c65565b34801561068a57600080fd5b5061034b610699366004614c30565b611342565b3480156106aa57600080fd5b5061034b6106b93660046145af565b611375565b3480156106ca57600080fd5b5061034b6106d93660046145af565b6113a0565b3480156106ea57600080fd5b5061034b6106f93660046144cb565b6113cb565b34801561070a57600080fd5b506097546001600160a01b03166102ed565b34801561072857600080fd5b5061034b610737366004614cd5565b6113fe565b34801561074857600080fd5b5061032a6101f85481565b34801561075f57600080fd5b5061034b61076e36600461466f565b61148d565b34801561077f57600080fd5b5061034b61078e366004614778565b61155c565b34801561079f57600080fd5b5061032a6107ae366004614d21565b60ff1660009081526101c5602052604090205490565b3480156107d057600080fd5b5061034b6107df366004614d3c565b611570565b3480156107f057600080fd5b5061032a6107ff366004614d21565b60ff166000908152610161602052604090205490565b34801561082157600080fd5b5061032a6108303660046145af565b6101f96020526000908152604090205481565b34801561084f57600080fd5b5061032a61085e3660046145af565b60009081526101fa602052604090205490565b34801561087d57600080fd5b5061034b61088c366004614aea565b6115d7565b34801561089d57600080fd5b5061034b6108ac366004614d87565b611613565b3480156108bd57600080fd5b5061032a6108cc366004614bcf565b60ff821660009081526101c5602090815260408083206001600160a01b038516845260010190915290205492915050565b34801561090957600080fd5b5061036d610918366004614e5e565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b34801561095257600080fd5b50610201546102ed906001600160a01b031681565b34801561097357600080fd5b5061034b610982366004614e7c565b6120fd565b34801561099357600080fd5b5061034b6109a236600461474d565b612124565b3480156109b357600080fd5b5061039d61219a565b3480156109c857600080fd5b506101fc546102ed906001600160a01b031681565b60006001600160a01b038316610a4d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b6002806101f85414610a9c5760405162461bcd60e51b8152600401610a4490614ee4565b6000806000610aab86866121aa565b93509350509250610abe338383866123a6565b505050505050565b6000610ad1826123ca565b80610ae05750610ae08261241a565b80610a725750610a728261241a565b6060610a728261243f565b6001806101f85414610b1e5760405162461bcd60e51b8152600401610a4490614ee4565b6000610b2a8686612478565b509050600080610b6c86868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061266392505050565b90925090506000610b7d8385614f1c565b9050610b8c3382600185612888565b505050505050505050565b610ba033610ccb565b610bbc5760405162461bcd60e51b8152600401610a4490614f2f565b83828114610c0c5760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610a44565b60005b81811015610c7257610c60878783818110610c2c57610c2c614f55565b9050602002016020810190610c41919061474d565b84878785818110610c5457610c54614f55565b9050602002013561288f565b80610c6a81614f6b565b915050610c0f565b50505050505050565b610c8433610ccb565b610ca05760405162461bcd60e51b8152600401610a4490614f2f565b6001600160a01b0391909116600090815260fd60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260fd602052604090205460ff1690565b60408051808201909152610193546001600160a01b038116808352600160a01b90910462ffffff1660208301819052909160009161271090610d2b9086614f84565b610d359190614fb1565b9150509250929050565b610d4833610ccb565b610d645760405162461bcd60e51b8152600401610a4490614f2f565b610d6e33826128b4565b50565b846001600160a01b0381163314610d8b57610d8b336129cd565b610abe8686868686612a86565b60608151835114610dfd5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610a44565b600083516001600160401b03811115610e1857610e186147d3565b604051908082528060200260200182016040528015610e41578160200160208202803683370190505b50905060005b8451811015610eb957610e8c858281518110610e6557610e65614f55565b6020026020010151858381518110610e7f57610e7f614f55565b60200260200101516109dd565b828281518110610e9e57610e9e614f55565b6020908102919091010152610eb281614f6b565b9050610e47565b509392505050565b610eca33610ccb565b610ee65760405162461bcd60e51b8152600401610a4490614f2f565b60ff90911660009081526101616020526040902055565b8482826000610f6284604080517f3a58bb770b0fdc7635f4460ad845c6fcf18032144a6cadcfce202c2ac00887b86020820152823591810191909152336060820152600090608001604051602081830303815290604052805190602001209050919050565b90506000610f6f82612ad2565b9050610f7c818585612aff565b610fbc5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610a44565b6001806101f85414610fe05760405162461bcd60e51b8152600401610a4490614ee4565b600080600080610ff08e8e6121aa565b3360009081526101fe6020526040902054939750919550935091508f3590611019908590614f1c565b11156110675760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74206d696e74206d6f7265207468616e2061737369676e65642e006044820152606401610a44565b3360009081526101fe602052604081208054859290611087908490614f1c565b909155506110999050338383876123a6565b505050505050505050505050505050565b6110b333610ccb565b6110cf5760405162461bcd60e51b8152600401610a4490614f2f565b6101c680546001600160a01b0319166001600160a01b0392909216919091179055565b60ff821660008181526101c5602081815260408084206001600160a01b03871685526001810183529084205494845291905254909161113091614fc5565b9392505050565b60008060005b83811015610eb95784848281811061115757611157614f55565b90506020020135826111699190614f1c565b91508061117581614f6b565b91505061113d565b611185612b5f565b61118f6000612bb9565b565b61119a33610ccb565b6111b65760405162461bcd60e51b8152600401610a4490614f2f565b6101306111c4828483615058565b505050565b606061012f80546111d990614fd8565b80601f016020809104026020016040519081016040528092919081815260200182805461120590614fd8565b80156112525780601f1061122757610100808354040283529160200191611252565b820191906000526020600020905b81548152906001019060200180831161123557829003601f168201915b5050505050905090565b61126533610ccb565b6112815760405162461bcd60e51b8152600401610a4490614f2f565b61020180546001600160a01b0319166001600160a01b0392909216919091179055565b60006060806000806000606060c9546000801b1480156112c4575060ca54155b6113085760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610a44565b611310612c0b565b611318612c1a565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b61134b33610ccb565b6113675760405162461bcd60e51b8152600401610a4490614f2f565b61012f6111c4828483615058565b61137e33610ccb565b61139a5760405162461bcd60e51b8152600401610a4490614f2f565b61020055565b6113a933610ccb565b6113c55760405162461bcd60e51b8152600401610a4490614f2f565b6101f855565b6113d433610ccb565b6113f05760405162461bcd60e51b8152600401610a4490614f2f565b6113fa8282612c29565b5050565b61140733610ccb565b6114235760405162461bcd60e51b8152600401610a4490614f2f565b60005b82518110156111c45781818151811061144157611441614f55565b60200260200101516101fa600085848151811061146057611460614f55565b6020026020010151815260200190815260200160002081905550808061148590614f6b565b915050611426565b3233146114dc5760405162461bcd60e51b815260206004820152601760248201527f4e6f2063616c6c732066726f6d20636f6e7472616374730000000000000000006044820152606401610a44565b61154a3385858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612cf892505050565b61155684848484612efd565b50505050565b81611566816129cd565b6111c4838361328b565b61157933610ccb565b6115955760405162461bcd60e51b8152600401610a4490614f2f565b6101fb80546001600160a01b039485166001600160a01b0319918216179091556101fc8054938516938216939093179092556101fd8054919093169116179055565b6115e033610ccb565b6115fc5760405162461bcd60e51b8152600401610a4490614f2f565b60ff90911660009081526101c56020526040902055565b600054610100900460ff16158080156116335750600054600160ff909116105b8061164d5750303b15801561164d575060005460ff166001145b6116b05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a44565b6000805460ff1916600117905580156116d3576000805461ff0019166101001790555b6116db613296565b6116e588886132d9565b6116fd6040518060200160405280600081525061331b565b61170561334b565b61170d613372565b61171786866133b8565b6117228484846133df565b7f0fce300cb38468eb74fecbca14de83ce9c827df14e4f90e2449f69b859ecb7128054600160ff1991821681179092557f59ba01267bf386871d93da16f79c2ff0bf73afef855c69ba8e727970f1f2c4c580548216831790557fa3ffa8264a5e43c979a94cd4848e9fa70bcb5af03add8c35380313d93f3e610180548216831790557f73d34c2884f94502fb1d482d02192caf4163842c8b93f9671f6082ba5a1ccf1580548216831790557f16c772b3e9aa319f7b7063aa3a3b86f1e75b554ade9d2e02be3d108ab97d931d80548216831790557f613d2f107b65d492ce98c78bafc70483b02579c4c2a57b88a15de777b57853f980548216831790557ff82425ba2020962b727a45b075b4a45d34e855c8da28a2e2f9b8149d2b5b88da80548216831790557f3bf756f4f6de00e05064edcadb575abef66a6acd701543e9469773f01163b6f480548216831790557f7f560f58c48d9de9bd66199cf84cbd6e6c81f9eaa8e9f04ff16c7a188b81168980548216831790557fdc11582e20e8b419f44ef4b3ebd28703c8a3c74d6378e4c7fe774a4bdf335c9280548216831790557f6406646511812cf097202fa10abfafb65c31155bff0b1e7dea2a3227c59c649880548216831790557f660dfbda5e85c811ff501dd9dcb165268f2f8830c7a1cbe7382126b9c738317780548216831790557ff67bc9a4b66294bfdbf1b0d507c254cda8453e05d53e0db51f7fa909b0f871b780548216831790557f37cd7bdfc604dbe39b5a7eb662363ecf6d3bd2140a3e357b84914821d942003580548216831790557fea2b69042b9e56e72eaffbbd839ce5cb4ce164c02952c3b86518d0db363cb6a080548216831790557fbb3034968a1979a8b7c32b8b8a40ddfcf923f157933cf83a86bbae484c31448080548216831790557fbea13c12d2091a85dd289e25e152450ea69e7821d8512311a824cb1ab19e8bec80548216831790557fe297f7ae1dbdff1d42155d68ee2c56a75180c4ac9179abba9b6efe55830a98f180548216831790557fdb0c88756833889a6af9845fcd8bd92ee609b9fad9165019577ac3a347d5870880548216831790557f7df666c72a50cb121dc34c5f1abf76c6e4f4ea9ae8350166d9ddcc9ae9d7808280548216831790557fb9714805c7b3a77afb2a8f70f953ce61bc41586afc4eb861a74d7ebd94384d0780548216831790557f5313ec90783836f995e51fb54cb5eb98553235c5d7f21b5a1051793523fc1cb980548216831790557ff0ad01455ebbd8cb771c98c564728f27ece9d7bd0c4cabda1d1d88717fe6d4a980548216831790557fb58684937ee37d7fb216ab0eda0b249fa588867b8b1759c2de687f80beda8e0980548216831790557f3b14d300f2f2a0701352086d3282ea36b93ddf2725226c878676188079ba811c80548216831790557ff4411caeb5e2bface4391e1aef41d77f775e5333d7316875fde3f8361619c59f80548216831790557f6c2d63af380e0eceb743755a5f5b822ada762a1b133df6bc208edd9faefd533780548216831790557f192902ca3444f6faf70d44bd64dbb7c9f342a4f1a3fa7ad07b00d424eac4b4ee80548216831790557fa2715a586f6d609d754132e374a42e40a6a024639e55cc2502b75e8897be72d480548216831790557ed5ae7eb37741d0b2942dd1fc029e7ef678156beb7f900b349071c3ce16465180548216831790557fb51b176d02a727cc74f941cf931ee9109e6b6b7ea099826c49342c26d209fb7f80548216831790557f40602445ae4eb2b0401c4c082838101ada040da73af4c1e90405082b069980b780548216831790557f9b2dac4b2aa2a5223062d57634f2ed14c03dac74d52c4c280282e519598a751d80548216831790557fd20fff4ff6cf6d1532c234b24c174f7d7dbb5f120559ec61d86cb0de76d4050a80548216831790557f1f83f6b8269c0b66e43cf25da0616a589681d93f350a2441d1c5ba7562679d1b80548216831790557fd1eaaf1c8f7fcac48f592dc6e6e47c9868d2493d22943398bff3522796903d5a80548216831790557f5b9c0b10b3bbc426ed8d675596135c1db5aff3d12933f77d97353bfba6a58bf680548216831790557fd3dd03f1fcd8d6d8ab160cf23964fc8d311babb0e7432cf9b1de698cbf879f3080548216831790557fcb161adaca6aabda2bdbc31b005604360ef3d7b10f4d2c4911d7997d94c57f8780548216831790557fce25c3e4ee22b82018b611b5afbb45cf93b58c8d6c7444d7a5dc9aa68c77ede280548216831790557f3111189fcca8bdefe3408954435c72bff1d0d9d79b3c11a1b6a8077f3325e58880548216831790557f15ee2e948bffa5fdf2f9b720efd8a6b6f8d6253930287c6694fa29c953edf64d80548216831790557f51dd4ecf048e5ef9f120ad4867b9652e64ae658bbf0deba2d7007b9b6326870280548216831790557f6e7812f35333e8d53566fe4a02f6850ba0b565ae833a017f1b744a86935494f980548216831790557f36e61c1b165a53f9e7fd7744b4f2f07270e6e6c93ccf7411473f28b97988208e80548216831790557f68902c1f5c0e52260f9dda967915da7523dcadc897709a3d3afeb40e8653e0ea80548216831790557fe372229435f273febf91ed768bf05446c35571ea5754ec28b0d2923aba53120680548216831790557f5aa5559585048f3c964b3f5f4e39bce41bd612c4f06341c3a2aa036370c29b6880548216831790557fd79156eaf85a77246f601fbeac91678a6a91e5270dda48fe0c8b8bc316ffa80780548216831790557f4588dd0f42eb06fa793bda52a25a76de6a7ff318532209bc7aadb1f962d0410e80549091168217905560057f5b9f4b3e29890e534851db0cc79af03a5861e973ebcc43c7ce7cbdc915ba9a225560197f180e5813c3d6dbfee391bda7c78a90e203593745fe288889e8b2038f078555305560647f788174486a78305a53e7f3e30c324b94119d348367a3cfe5909b18edcfd9f64b5560287feba31e7744486a1f8c0ba38c1831362670e464a45551370ddc3c482a7eb80b2d556101fa6020526114697f2c17d8e16e644355d48164662e8241a4a6ff9a8c44105e370a0d2b48fb07ac295561054b7f6b33b97f10a67f0f027b3dea661ff36fa406ac9e17a8d1467a69c91fb57d930e556101907f4c562ee05b53c60534273a7283dda48ec043d8301a3b338f9d90f9d8feee173f55600460005261012c7fa5fe82759daa34724fec0874734ce9efeb1de663eaee6bfa08b7aac2e6479b325561206b9066071afd498d0000610ec1565b6606651728988000610200556120896002661c6bf526340000610ec1565b61209b6003664fefa17b724000610ec1565b6120ad6004662c68af0bb14000610ec1565b80156120f3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b846001600160a01b038116331461211757612117336129cd565b610abe8686868686613435565b61212c612b5f565b6001600160a01b0381166121915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a44565b610d6e81612bb9565b606061013080546111d990614fd8565b60008060608082808681816001600160401b038111156121cc576121cc6147d3565b6040519080825280602002602001820160405280156121f5578160200160208202803683370190505b5090506000826001600160401b03811115612212576122126147d3565b60405190808252806020026020018201604052801561223b578160200160208202803683370190505b50905060005b8381101561235b5760008c8c8381811061225d5761225d614f55565b9050604002018036038101906122739190615117565b80519091506005811080156122885750600081115b6122c15760405162461bcd60e51b815260206004820152600a602482015269125b9d985b1a5908125160b21b6044820152606401610a44565b60208201516122d0828261347a565b60ff8216600090815261016160205260409020546122ee8282614f84565b6122f8908b614f1c565b9950612304828a614f1c565b98508287868151811061231957612319614f55565b6020026020010181815250508186868151811061233857612338614f55565b60200260200101818152505050505050808061235390614f6b565b915050612241565b50600084116123955760405162461bcd60e51b8152600401610a44906020808252600490820152635a65726f60e01b604082015260600190565b939a92995097509195509350505050565b6123c1848484604051806020016040528060008152506134fc565b61155681613648565b60006001600160e01b03198216636cdb3d1360e11b14806123fb57506001600160e01b031982166303a24d0760e21b145b80610a7257506301ffc9a760e01b6001600160e01b0319831614610a72565b60006001600160e01b0319821663152a902d60e11b1480610a725750610a72826123ca565b606061012f61244d836136ca565b610130604051602001612462939291906151d8565b6040516020818303038152906040529050919050565b6000808280820361249057600080925092505061265c565b6000805b828110156126195760008787838181106124b0576124b0614f55565b6101fb546040516331a9108f60e11b8152602092909202939093013560048201819052935033926001600160a01b03169150636352211e90602401602060405180830381865afa158015612508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252c919061520b565b6001600160a01b03161461256e5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b6044820152606401610a44565b60008181526101ff602052604090205460ff161561259857612591600284614f1c565b92506125a6565b826125a281614f6b565b9350505b6101fb54604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b1580156125ed57600080fd5b505af1158015612601573d6000803e3d6000fd5b5050505050808061261190614f6b565b915050612494565b506040805182815242602082015233917f70b70c02602ca6e3674cf269aee296d4ec20016bd0640168d48dc4c0ffd8f4eb910160405180910390a2925060009150505b9250929050565b8051600090819080820361267d5750600093849350915050565b612688600282615228565b156126cd5760405162461bcd60e51b815260206004820152601560248201527426bab9ba103132903234bb34b9b1363290313c901960591b6044820152606401610a44565b60005b818110156128235760008582815181106126ec576126ec614f55565b60209081029190910101516101fc546040516331a9108f60e11b81526004810183905291925033916001600160a01b0390911690636352211e90602401602060405180830381865afa158015612746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061276a919061520b565b6001600160a01b0316146127b05760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21027bbb732b960991b6044820152606401610a44565b6101fc54604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b1580156127f757600080fd5b505af115801561280b573d6000803e3d6000fd5b5050505050808061281b90614f6b565b9150506126d0565b506040805182815242602082015233917f79fab521652b87c8011ae6ea52cbe559f476249bc98c7e473977e9ccb5d9ca11910160405180910390a2600061286b600283614fb1565b905080610200548261287d9190614f84565b935093505050915091565b6123c18484845b612899818361347a565b6111c48382846040518060200160405280600081525061375c565b804710156129045760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a44565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612951576040519150601f19603f3d011682016040523d82523d6000602084013e612956565b606091505b50509050806111c45760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a44565b6daaeb6d7670e522a718067333cd4e3b15610d6e57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612a3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5e919061523c565b610d6e57604051633b79c77360e21b81526001600160a01b0382166004820152602401610a44565b6001600160a01b038516331480612aa25750612aa28533610918565b612abe5760405162461bcd60e51b8152600401610a4490615259565b612acb858585858561382f565b5050505050565b6000610a72612adf6139c6565b8360405161190160f01b8152600281019290925260228201526042902090565b600080612b4484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525089939250506139d59050565b6101c6546001600160a01b0391821691161495945050505050565b6097546001600160a01b0316331461118f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a44565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060cb80546111d990614fd8565b606060cc80546111d990614fd8565b612710811115612c7b5760405162461bcd60e51b815260206004820152601c60248201527f526f79616c746965733a2076616c756520697320746f6f2068696768000000006044820152606401610a44565b6040805180820182526001600160a01b03841680825262ffffff8416602092830181905261019380546001600160b81b0319168317600160a01b90920291909117905582519081529081018390527f908669f35f6fb3977a956ba70597841fe541d1e8491ca3c025161e258d3bfdb6910160405180910390a15050565b6001600160a01b038316612d5a5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610a44565b8051825114612d7b5760405162461bcd60e51b8152600401610a44906152a7565b604080516020810190915260009081905233905b8351811015612e90576000848281518110612dac57612dac614f55565b602002602001015190506000848381518110612dca57612dca614f55565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612e575760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610a44565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612e8881614f6b565b915050612d8f565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612ee19291906152ef565b60405180910390a4604080516020810190915260009052611556565b6101fd54604080516318160ddd60e01b8152905185926000926001600160a01b03909116916318160ddd916004808201926020929091908290030181865afa158015612f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f71919061531d565b90506000612f80826001614f1c565b905060005b838110156131c2576000888883818110612fa157612fa1614f55565b9050602002013590506000878784818110612fbe57612fbe614f55565b90506020020135905080600003612fd65750506131b0565b816004036131295760005b81811015613123576102015460405163459a4f9f60e11b8152600481018790523360248201526000916001600160a01b031690638b349f3e906044016020604051808303816000875af115801561303c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613060919061531d565b9050600081116130a85760405162461bcd60e51b81526020600482015260136024820152724572726f723a204f7574206f662073746f636b60681b6044820152606401610a44565b60008181526101f9602090815260409182902054825184815291820189905291810182905242606082015233907f0a687302320f32c8a887a190a8e55d073eccceafc6b5534bce199380854e3bff9060800160405180910390a261310c8188614f1c565b96505050808061311b90614f6b565b915050612fe1565b506131ad565b60008281526101f96020526040812054905b828110156131aa57604080518581526020810188905290810183905242606082015233907f0a687302320f32c8a887a190a8e55d073eccceafc6b5534bce199380854e3bff9060800160405180910390a26131968287614f1c565b9550806131a281614f6b565b91505061313b565b50505b50505b806131ba81614f6b565b915050612f85565b50600060016131d18484614fc5565b6131db9190614fc5565b90506000811161321c5760405162461bcd60e51b815260206004820152600c60248201526b4d696e74696e67205a65726f60a01b6044820152606401610a44565b6101fd546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561326957600080fd5b505af115801561327d573d6000803e3d6000fd5b505050505050505050505050565b6113fa3383836139f1565b600054610100900460ff166132bd5760405162461bcd60e51b8152600401610a4490615336565b33600090815260fd60205260409020805460ff19166001179055565b600054610100900460ff166133005760405162461bcd60e51b8152600401610a4490615336565b61012f61330d8382615381565b506101306111c48282615381565b600054610100900460ff166133425760405162461bcd60e51b8152600401610a4490615336565b610d6e81613ad1565b600054610100900460ff1661118f5760405162461bcd60e51b8152600401610a4490615336565b600054610100900460ff166133995760405162461bcd60e51b8152600401610a4490615336565b61118f733cc6cdda760b79bafa08df41ecfa224f810dceb66001613add565b600054610100900460ff166113f05760405162461bcd60e51b8152600401610a4490615336565b600054610100900460ff166134065760405162461bcd60e51b8152600401610a4490615336565b6134108383613c7c565b6101c680546001600160a01b0319166001600160a01b03929092169190911790555050565b6001600160a01b03851633148061345157506134518533610918565b61346d5760405162461bcd60e51b8152600401610a4490615259565b612acb8585858585613cad565b60008281526101fa6020526040812054613495908390614fc5565b10156134d45760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320537570706c7960901b6044820152606401610a44565b60008281526101fa6020526040812080548392906134f3908490614fc5565b90915550505050565b6001600160a01b0384166135225760405162461bcd60e51b8152600401610a4490615440565b81518351146135435760405162461bcd60e51b8152600401610a44906152a7565b3360005b84518110156135e05783818151811061356257613562614f55565b60200260200101516065600087848151811061358057613580614f55565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135c89190614f1c565b909155508190506135d881614f6b565b915050613547565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516136319291906152ef565b60405180910390a4612acb81600087878787613dd0565b803410156136895760405162461bcd60e51b815260206004820152600e60248201526d141c9a58d94e881a5b9d985b1a5960921b6044820152606401610a44565b60006136958234614fc5565b905080156113fa57604051339082156108fc029083906000818181858888f193505050501580156111c4573d6000803e3d6000fd5b606060006136d783613f2b565b60010190506000816001600160401b038111156136f6576136f66147d3565b6040519080825280601f01601f191660200182016040528015613720576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461372a57509392505050565b6001600160a01b0384166137825760405162461bcd60e51b8152600401610a4490615440565b33600061378e85614003565b9050600061379b85614003565b905060008681526065602090815260408083206001600160a01b038b168452909152812080548792906137cf908490614f1c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610c728360008989898961404e565b81518351146138505760405162461bcd60e51b8152600401610a44906152a7565b6001600160a01b0384166138765760405162461bcd60e51b8152600401610a4490615481565b3360005b845181101561396057600085828151811061389757613897614f55565b6020026020010151905060008583815181106138b5576138b5614f55565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156139065760405162461bcd60e51b8152600401610a44906154c6565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290613945908490614f1c565b925050819055505050508061395990614f6b565b905061387a565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516139b09291906152ef565b60405180910390a4610abe818787878787613dd0565b60006139d0614109565b905090565b60008060006139e4858561417d565b91509150610eb9816141bf565b816001600160a01b0316836001600160a01b031603613a645760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610a44565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60676113fa8282615381565b600054610100900460ff16613b045760405162461bcd60e51b8152600401610a4490615336565b6daaeb6d7670e522a718067333cd4e3b156113fa5760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015613b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b88919061523c565b6113fa578015613bfc57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015613be857600080fd5b505af1158015610abe573d6000803e3d6000fd5b6001600160a01b03821615613c4b5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401613bce565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401613bce565b600054610100900460ff16613ca35760405162461bcd60e51b8152600401610a4490615336565b6113fa8282614309565b6001600160a01b038416613cd35760405162461bcd60e51b8152600401610a4490615481565b336000613cdf85614003565b90506000613cec85614003565b905060008681526065602090815260408083206001600160a01b038c16845290915290205485811015613d315760405162461bcd60e51b8152600401610a44906154c6565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613d70908490614f1c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b8c848a8a8a8a8a61404e565b6001600160a01b0384163b15610abe5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613e149089908990889088908890600401615510565b6020604051808303816000875af1925050508015613e4f575060408051601f3d908101601f19168201909252613e4c9181019061556e565b60015b613efb57613e5b61558b565b806308c379a003613e945750613e6f6155a7565b80613e7a5750613e96565b8060405162461bcd60e51b8152600401610a449190614618565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610a44565b6001600160e01b0319811663bc197c8160e01b14610c725760405162461bcd60e51b8152600401610a4490615630565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613f6a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613f96576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613fb457662386f26fc10000830492506010015b6305f5e1008310613fcc576305f5e100830492506008015b6127108310613fe057612710830492506004015b60648310613ff2576064830492506002015b600a8310610a725760010192915050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061403d5761403d614f55565b602090810291909101015292915050565b6001600160a01b0384163b15610abe5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906140929089908990889088908890600401615678565b6020604051808303816000875af19250505080156140cd575060408051601f3d908101601f191682019092526140ca9181019061556e565b60015b6140d957613e5b61558b565b6001600160e01b0319811663f23a6e6160e01b14610c725760405162461bcd60e51b8152600401610a4490615630565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614134614358565b61413c6143b1565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008082516041036141b35760208301516040840151606085015160001a6141a7878285856143e2565b9450945050505061265c565b5060009050600261265c565b60008160048111156141d3576141d36156b2565b036141db5750565b60018160048111156141ef576141ef6156b2565b0361423c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a44565b6002816004811115614250576142506156b2565b0361429d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a44565b60038160048111156142b1576142b16156b2565b03610d6e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a44565b600054610100900460ff166143305760405162461bcd60e51b8152600401610a4490615336565b60cb61433c8382615381565b5060cc6143498282615381565b5050600060c981905560ca5550565b600080614363612c0b565b80519091501561437a578051602090910120919050565b60c95480156143895792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b6000806143bc612c1a565b8051909150156143d3578051602090910120919050565b60ca5480156143895792915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614419575060009050600361449d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561446d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166144965760006001925092505061449d565b9150600090505b94509492505050565b6001600160a01b0381168114610d6e57600080fd5b80356144c6816144a6565b919050565b600080604083850312156144de57600080fd5b82356144e9816144a6565b946020939093013593505050565b60008083601f84011261450957600080fd5b5081356001600160401b0381111561452057600080fd5b6020830191508360208260061b850101111561265c57600080fd5b6000806020838503121561454e57600080fd5b82356001600160401b0381111561456457600080fd5b614570858286016144f7565b90969095509350505050565b6001600160e01b031981168114610d6e57600080fd5b6000602082840312156145a457600080fd5b81356111308161457c565b6000602082840312156145c157600080fd5b5035919050565b60005b838110156145e35781810151838201526020016145cb565b50506000910152565b600081518084526146048160208601602086016145c8565b601f01601f19169290920160200192915050565b60208152600061113060208301846145ec565b60008083601f84011261463d57600080fd5b5081356001600160401b0381111561465457600080fd5b6020830191508360208260051b850101111561265c57600080fd5b6000806000806040858703121561468557600080fd5b84356001600160401b038082111561469c57600080fd5b6146a88883890161462b565b909650945060208701359150808211156146c157600080fd5b506146ce8782880161462b565b95989497509550505050565b6000806000806000606086880312156146f257600080fd5b85356001600160401b038082111561470957600080fd5b61471589838a0161462b565b9097509550602088013591508082111561472e57600080fd5b5061473b8882890161462b565b96999598509660400135949350505050565b60006020828403121561475f57600080fd5b8135611130816144a6565b8015158114610d6e57600080fd5b6000806040838503121561478b57600080fd5b8235614796816144a6565b915060208301356147a68161476a565b809150509250929050565b600080604083850312156147c457600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561480e5761480e6147d3565b6040525050565b60006001600160401b0382111561482e5761482e6147d3565b5060051b60200190565b600082601f83011261484957600080fd5b8135602061485682614815565b60405161486382826147e9565b83815260059390931b850182019282810191508684111561488357600080fd5b8286015b8481101561489e5780358352918301918301614887565b509695505050505050565b600082601f8301126148ba57600080fd5b81356001600160401b038111156148d3576148d36147d3565b6040516148ea601f8301601f1916602001826147e9565b8181528460208386010111156148ff57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561493457600080fd5b853561493f816144a6565b9450602086013561494f816144a6565b935060408601356001600160401b038082111561496b57600080fd5b61497789838a01614838565b9450606088013591508082111561498d57600080fd5b61499989838a01614838565b935060808801359150808211156149af57600080fd5b506149bc888289016148a9565b9150509295509295909350565b600080604083850312156149dc57600080fd5b82356001600160401b03808211156149f357600080fd5b818501915085601f830112614a0757600080fd5b81356020614a1482614815565b604051614a2182826147e9565b83815260059390931b8501820192828101915089841115614a4157600080fd5b948201945b83861015614a68578535614a59816144a6565b82529482019490820190614a46565b96505086013592505080821115614a7e57600080fd5b50610d3585828601614838565b600081518084526020808501945080840160005b83811015614abb57815187529582019590820190600101614a9f565b509495945050505050565b6020815260006111306020830184614a8b565b803560ff811681146144c657600080fd5b60008060408385031215614afd57600080fd5b6144e983614ad9565b60008083601f840112614b1857600080fd5b5081356001600160401b03811115614b2f57600080fd5b60208301915083602082850101111561265c57600080fd5b60008060008060008587036080811215614b6057600080fd5b6040811215614b6e57600080fd5b5085945060408601356001600160401b0380821115614b8c57600080fd5b614b9889838a016144f7565b90965094506060880135915080821115614bb157600080fd5b50614bbe88828901614b06565b969995985093965092949392505050565b60008060408385031215614be257600080fd5b614beb83614ad9565b915060208301356147a6816144a6565b60008060208385031215614c0e57600080fd5b82356001600160401b03811115614c2457600080fd5b6145708582860161462b565b60008060208385031215614c4357600080fd5b82356001600160401b03811115614c5957600080fd5b61457085828601614b06565b60ff60f81b8816815260e060208201526000614c8460e08301896145ec565b8281036040840152614c9681896145ec565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050614cc78185614a8b565b9a9950505050505050505050565b60008060408385031215614ce857600080fd5b82356001600160401b0380821115614cff57600080fd5b614d0b86838701614838565b93506020850135915080821115614a7e57600080fd5b600060208284031215614d3357600080fd5b61113082614ad9565b600080600060608486031215614d5157600080fd5b8335614d5c816144a6565b92506020840135614d6c816144a6565b91506040840135614d7c816144a6565b809150509250925092565b600080600080600080600060e0888a031215614da257600080fd5b87356001600160401b0380821115614db957600080fd5b614dc58b838c016148a9565b985060208a0135915080821115614ddb57600080fd5b614de78b838c016148a9565b9750614df560408b016144bb565b965060608a0135955060808a0135915080821115614e1257600080fd5b614e1e8b838c016148a9565b945060a08a0135915080821115614e3457600080fd5b50614e418a828b016148a9565b925050614e5060c089016144bb565b905092959891949750929550565b60008060408385031215614e7157600080fd5b8235614beb816144a6565b600080600080600060a08688031215614e9457600080fd5b8535614e9f816144a6565b94506020860135614eaf816144a6565b9350604086013592506060860135915060808601356001600160401b03811115614ed857600080fd5b6149bc888289016148a9565b6020808252600890820152674e6f74206c69766560c01b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a7257610a72614f06565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201614f7d57614f7d614f06565b5060010190565b8082028115828204841417610a7257610a72614f06565b634e487b7160e01b600052601260045260246000fd5b600082614fc057614fc0614f9b565b500490565b81810381811115610a7257610a72614f06565b600181811c90821680614fec57607f821691505b60208210810361500c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156111c457600081815260208120601f850160051c810160208610156150395750805b601f850160051c820191505b81811015610abe57828155600101615045565b6001600160401b0383111561506f5761506f6147d3565b6150838361507d8354614fd8565b83615012565b6000601f8411600181146150b7576000851561509f5750838201355b600019600387901b1c1916600186901b178355612acb565b600083815260209020601f19861690835b828110156150e857868501358255602094850194600190920191016150c8565b50868210156151055760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006040828403121561512957600080fd5b604051604081018181106001600160401b038211171561514b5761514b6147d3565b604052823581526020928301359281019290925250919050565b6000815461517281614fd8565b6001828116801561518a576001811461519f576151ce565b60ff19841687528215158302870194506151ce565b8560005260208060002060005b858110156151c55781548a8201529084019082016151ac565b50505082870194505b5050505092915050565b60006151e48286615165565b84516151f48183602089016145c8565b61520081830186615165565b979650505050505050565b60006020828403121561521d57600080fd5b8151611130816144a6565b60008261523757615237614f9b565b500690565b60006020828403121561524e57600080fd5b81516111308161476a565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6040815260006153026040830185614a8b565b82810360208401526153148185614a8b565b95945050505050565b60006020828403121561532f57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b81516001600160401b0381111561539a5761539a6147d3565b6153ae816153a88454614fd8565b84615012565b602080601f8311600181146153e357600084156153cb5750858301515b600019600386901b1c1916600185901b178555610abe565b600085815260208120601f198616915b82811015615412578886015182559484019460019091019084016153f3565b50858210156154305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061553c90830186614a8b565b828103606084015261554e8186614a8b565b9050828103608084015261556281856145ec565b98975050505050505050565b60006020828403121561558057600080fd5b81516111308161457c565b600060033d11156155a45760046000803e5060005160e01c5b90565b600060443d10156155b55790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156155e457505050505090565b82850191508151818111156155fc5750505050505090565b843d87010160208285010111156156165750505050505090565b615625602082860101876147e9565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615200908301846145ec565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b260f7ad05466e57b637c560dd57f7c057506fe81ba7e23b1e197912df87f45c64736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.