Contract Address Details

0xeA1B5E16EaCC1B657A0bA57d74e2d6876389613b

Token
UndeadsPotions (UNZP)
Creator
0xdaf38d–e125de at 0x44308c–f37d6f
Balance
0
Tokens
Fetching tokens...
Transactions
1,942 Transactions
Transfers
0 Transfers
Gas Used
483,331,424
Last Balance Update
12315924
Contract name:
Potions




Optimization enabled
true
Compiler version
v0.8.17+commit.8df45f5f




Optimization runs
200
EVM Version
london




Verified at
2023-09-11T11:43:17.966834Z

Constructor Arguments

0x00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000ea6a031bbaf2eadb5ecfd32b8aa39e9a95659e460000000000000000000000007bb9cf4de4c55ebc3faff90cb44b1e5b7cff868f000000000000000000000000ab15171ec6427406dff4640dccc9ca378a9b0ded00000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000e556e6465616473506f74696f6e730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004554e5a50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000047e00000000000000000000000000000000000000000000000000000000000004f6000000000000000000000000000000000000000000000000000000000000056e00000000000000000000000000000000000000000000000000000000000005d200000000000000000000000000000000000000000000000000000000000005dc00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000d0500000000000000000000000000000000000000000000000000000000000008ae00000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000029b00000000000000000000000000000000000000000000000000000000000001bc00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000

Arg [0] (string) : UndeadsPotions
Arg [1] (string) : UNZP
Arg [2] (address) : 0xea6a031bbaf2eadb5ecfd32b8aa39e9a95659e46
Arg [3] (address) : 0x7bb9cf4de4c55ebc3faff90cb44b1e5b7cff868f
Arg [4] (address) : 0xab15171ec6427406dff4640dccc9ca378a9b0ded
Arg [5] (uint256[]) : [1150, 1270, 1390, 1490, 1500]
Arg [6] (uint256[]) : [3333, 2222, 1000, 100, 11]
Arg [7] (uint256[]) : [667, 444, 200, 20, 0]
Arg [8] (uint256) : 5

              

project:/contracts/persons/Potions.sol

Sol2uml
new
// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../interfaces/IRandomizer.sol";
import "../interfaces/ICalculator.sol";
import "./interfaces/IActors.sol";
import "./interfaces/IPotions.sol";
import "../utils/EIP2981.sol";
import "../lib/Constants.sol";
import "../utils/GuardExtension.sol";
import {
    OperatorFiltererERC721,
    ERC721
} from "../utils/OperatorFiltererERC721.sol";

contract Potions is OperatorFiltererERC721, IPotions, EIP2981, GuardExtension {
    using Counters for Counters.Counter;
    using Strings for uint256;
    Counters.Counter private _tokenIds;
    uint256 private _childs;
    uint256 private _unissued;
    uint256[] private _amounts;
    mapping(uint256 => uint256) private _total;
    mapping(uint256 => uint256) private _women;
    IActors private _zombie;
    IRandomizer private _random;
    address private _mysteryBoxAddress;
    bytes32 private constant ZERO_STRING = keccak256(bytes(""));
    string private constant WRONG_LEVEL = "Potion: wrong level";
    string private constant WRONG_OWNER = "Potion: wrong owner";
    string private constant NOT_A_BOX = "Potions: Not a box";
    string private constant TRY_AGAIN = "Potion: try again";
    string private constant SOLD_OUT = "Potion: sold out";
    string private constant WRONG_ID = "Potion: wrong id";
    string private constant NO_ZERO_LEVEL = "Potion: no zero level";
    string private constant META_ALREADY_USED = "Potion: meta already used";
    string private constant ALREADY_SET = "Potion: already set";
    string private constant BOX_NOT_SET = "Potion: box not set";
    string private constant SAME_VALUE = "Potion: same value";
    string private constant ZERO_ADDRESS = "Potion: zero address";
    string private constant IPFS_PREFIX = "ipfs://";
    string private constant PLACEHOLDERS_META_HASH =
        "QmZ9bCTRBNwgyhuaX6P7Xfm8D1c7jcUMZ4TFUDggGBE6hb";
    mapping(bytes32 => bool) private _usedMetadata;
    mapping(uint256 => string) private _tokensHashes;
    mapping(uint256 => uint256) private _issuedLevels;
    uint256[] private _limits;
    mapping(address => uint256) private _last;

    /// @notice only if one of the admins calls
    modifier onlyBox() {
        require(_mysteryBoxAddress != address(0), BOX_NOT_SET);
        require(
            _mysteryBoxAddress == msg.sender ||
                _rights().haveRights(address(this), msg.sender),
            NOT_A_BOX
        );
        _;
    }

    /// @notice validate the id
    modifier correctId(uint256 id_) {
        require(_exists(id_), WRONG_ID);
        _;
    }

    /**
@notice Constructor
@param name_ The name
@param symbol_ The symbol
@param rights_ The address of the rights contract
@param zombie_ The address of the zombie contract 
@param random_ The address of the random contract 
@param limits_ The maximum possible limits for the each parameter 
@param amounts_ The amounts of the actors according level (zero-based)   
@param childs_ The maximum number of the childs (for woman actors only)
*/
    constructor(
        string memory name_,
        string memory symbol_,
        address rights_,
        address zombie_,
        address random_,
        uint256[] memory limits_,
        uint256[] memory amounts_,
        uint256[] memory women_,
        uint256 childs_
    ) ERC721(name_, symbol_) GuardExtension(rights_) {
        require(random_ != address(0), ZERO_ADDRESS);
        require(zombie_ != address(0), ZERO_ADDRESS);

        _childs = childs_;
        _random = IRandomizer(random_);
        _zombie = IActors(zombie_);
        _saveAmounts(amounts_);
        _saveLimits(limits_);
        _saveWomen(women_);
    }

    /**
@notice Get a total amount of issued tokens
@return The number of tokens minted
*/

    function total() external view override returns (uint256) {
        return _tokenIds.current();
    }

    function _saveAmounts(uint256[] memory amounts_) private {
        uint256 len = amounts_.length;
        _unissued = 0;
        _amounts = amounts_;
        for (uint256 i = 0; i < len; ++i) {
            _unissued = _unissued + amounts_[i];
        }
    }

    function _saveWomen(uint256[] memory women_) private {
        for (uint256 i = 0; i < women_.length; i++) {
            _women[i] = women_[i];
        }
    }

    function _saveLimits(uint256[] memory limits_) private {
        _limits = limits_;
    }

    /**
@notice Get the amount of the actors remains to be created
@return The current value
*/
    function unissued() external view override returns (uint256) {
        return _unissued;
    }

    /**
@notice Get the level of the potion
@param id_ potion id
@return The level of the potion
*/
    function level(uint256 id_)
        external
        view
        override
        correctId(id_)
        returns (uint256)
    {
        return _issuedLevels[id_];
    }

    function _create(
        address owner_,
        uint256 level_,
        uint256 id_
    ) private returns (uint256) {
        require(level_ > 0, NO_ZERO_LEVEL);
        _tokenIds.increment();
        _issuedLevels[id_] = level_;
        _mint(owner_, id_);
        emit Created(owner_, id_, level_);
        return id_;
    }

    /**
@notice Set the maximum amount of the childs for the woman actor
@param childs_ New childs amount
*/
    function setChilds(uint256 childs_) external override haveRights {
        _childs = childs_;
        emit ChildsDefined(childs_);
    }

    /**
@notice Set new address of Zombie contract
@param value_ New address value
*/
    function setZombie(address value_) external haveRights {
        require(address(_zombie) != value_, SAME_VALUE);
        require(value_ != address(0), ZERO_ADDRESS);
        _zombie = IActors(value_);
    }

    /**
@notice Set new address of Randomizer contract
@param value_ New address value
*/
    function setRandom(address value_) external haveRights {
        require(address(_random) != value_, SAME_VALUE);
        require(value_ != address(0), ZERO_ADDRESS);
        _random = IRandomizer(value_);
    }

    /**
@notice Set new address of MysteryBox contract
@param value_ New address value
*/
    function setMysteryBox(address value_) external haveRights {
        require(address(_mysteryBoxAddress) != value_, SAME_VALUE);
        require(value_ != address(0), ZERO_ADDRESS);
        _mysteryBoxAddress = value_;
    }

    /**
@notice Get the current  maximum amount of the childs
@return The current value
*/
    function getChilds() external view override returns (uint256) {
        return _childs;
    }

    function _getLimits(uint256 level_)
        private
        view
        returns (uint256, uint256)
    {
        require(level_ > 0, NO_ZERO_LEVEL);
        require(level_ <= _limits.length, WRONG_LEVEL);
        if (level_ == 1) {
            return (Constants.MINIMAL, _limits[0]);
        }
        return (_limits[level_ - 2], _limits[level_ - 1]);
    }

    /**
@notice Get the limits of the properties for the level
@param level_ The desired level
@return Minimum and maximum level available
*/

    function getLimits(uint256 level_)
        external
        view
        returns (uint256, uint256)
    {
        return _getLimits(level_);
    }

    function calcSex(
        IRandomizer random_,
        uint256 total_,
        uint256 womenAvailable_
    ) internal returns (bool) {
        uint256[] memory weights = new uint256[](2);
        weights[0] = total_ - womenAvailable_;
        weights[1] = womenAvailable_;
        uint256 isWoman = random_.distributeRandom(total_, weights);
        return (isWoman == 0);
    }

    function calcProps(
        IRandomizer random,
        uint256 minRange,
        uint256 maxRange
    ) internal returns (uint256, uint16[10] memory) {
        uint16[10] memory props;
        uint256 range = maxRange - minRange;
        uint256 power = 0;

        for (uint256 i = 0; i < 10; i++) {
            props[i] = uint16(random.randomize(range) + minRange);
            power = power + props[i];
        }
        return (power, props);
    }

    function callMint(
        uint256 id_,
        uint16[10] memory props_,
        bool sex_,
        uint256 power_,
        uint8 childs_
    ) internal returns (uint256) {
        _zombie.mint(id_, msg.sender, props_, sex_, true, 0, childs_, true);
        emit Opened(msg.sender, id_);
        return id_;
    }

    /**
@notice Open the packed id with the random values
@param id_ The pack id
@return The new actor id
*/
    function open(uint256 id_)
        external
        override
        correctId(id_)
        returns (uint256)
    {
        require(ownerOf(id_) == msg.sender, WRONG_OWNER);
        uint256 level_ = _issuedLevels[id_];
        IRandomizer random = _random;
        (uint256 minRange, uint256 maxRange) = _getLimits(level_);
        (uint256 power, uint16[10] memory props) = calcProps(
            random,
            minRange,
            maxRange
        );
        bool sex = true;
        if (_women[level_ - 1] > 0) {
            sex = calcSex(
                random,
                _total[level_ - 1] + _amounts[level_ - 1],
                _women[level_ - 1]
            );
            if (!sex) {
                _women[level_ - 1] = _women[level_ - 1] - 1;
            }
        }
        uint8 childs = sex ? 0 : uint8(random.randomize(_childs + 1));
        _burn(id_);
        delete _issuedLevels[id_];
        return callMint(id_, props, sex, power, childs);
    }

    /**
@notice return max potion level
@return The max potion level (1-based)
*/

    function getMaxLevel() external view override returns (uint256) {
        return _amounts.length - 1;
    }

    /**
@notice Create the potion by box (rare or not)
@param target The potion owner
@param rare The rarity sign
@param id_ The id of a new token
@return The new pack id
*/
    function create(
        address target,
        bool rare,
        uint256 id_
    ) external override onlyBox returns (uint256) {
        uint256 level_ = _amounts.length - 1;
        if (!rare) {
            level_ = _random.distributeRandom(_unissued, _amounts);
            require(_amounts[level_] > 0, TRY_AGAIN);
            _amounts[level_] = _amounts[level_] - 1;
        }
        require(_amounts[level_] > 0, SOLD_OUT);
        _total[level_] = _total[level_] + 1;
        return _create(target, level_ + 1, id_);
    }

    /**
@notice Create the packed potion with desired level (admin only)
@param target The pack owner
@param level_ The pack level
@param id_ The id of a new token
@return The new pack id
*/
    function createPotion(
        address target,
        uint256 level_,
        uint256 id_
    ) external override haveRights returns (uint256) {
        require(level_ > 0, NO_ZERO_LEVEL);
        require(_unissued > 0, SOLD_OUT);
        require(_amounts[level_ - 1] > 0, SOLD_OUT);
        _amounts[level_ - 1] = _amounts[level_ - 1] - 1;
        _unissued = _unissued - 1;
        uint256 created = _create(target, level_, id_);
        _last[target] = created;
        return created;
    }

    /**
@notice get the last pack for the address
@param target The  owner 
@return The  pack id
*/
    function getLast(address target) external view override returns (uint256) {
        return _last[target];
    }

    /**
@notice Decrease the amount of the common or rare tokens or fails
*/
    function decreaseAmount(bool rare)
        external
        override
        onlyBox
        returns (bool)
    {
        if (_unissued == 0) return false;
        if (rare) {
            uint256 aLevel = _amounts.length - 1;
            if (_amounts[aLevel] == 0) return false;
            _amounts[aLevel] = _amounts[aLevel] - 1;
        }
        _unissued = _unissued - 1;
        return true;
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(IERC165, ERC2981, ERC721)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 id_)
        public
        view
        override(ERC721, IERC721Metadata)
        correctId(id_)
        returns (string memory)
    {
        uint256 level_ = _issuedLevels[id_];
        if (keccak256(bytes(_tokensHashes[id_])) == ZERO_STRING) {
            return
                string(
                    abi.encodePacked(
                        IPFS_PREFIX,
                        PLACEHOLDERS_META_HASH,
                        "/po/",
                        level_.toString(),
                        "/meta.json"
                    )
                );
        } else {
            return string(abi.encodePacked(IPFS_PREFIX, _tokensHashes[id_]));
        }
    }

    /**
    @notice Set an uri for the token
    @param id_ token id
    @param metadataHash_ ipfs hash of the metadata
    */
    function setMetadataHash(uint256 id_, string calldata metadataHash_)
        external
        override
        haveRights
        correctId(id_)
    {
        require(
            keccak256(bytes(_tokensHashes[id_])) == ZERO_STRING,
            ALREADY_SET
        );
        require(
            !_usedMetadata[keccak256(bytes(metadataHash_))],
            META_ALREADY_USED
        );
        _usedMetadata[keccak256(bytes(metadataHash_))] = true;
        _tokensHashes[id_] = metadataHash_;
        emit TokenUriDefined(
            id_,
            string(abi.encodePacked(IPFS_PREFIX, metadataHash_))
        );
    }
}
        

@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

@openzeppelin/contracts/interfaces/IERC2981.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}
          

@openzeppelin/contracts/token/ERC721/ERC721.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}
          

@openzeppelin/contracts/token/ERC721/IERC721.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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
    ) external;

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

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

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

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

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

@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
          

@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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);
}
          

@openzeppelin/contracts/token/common/ERC2981.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `tokenId` must be already minted.
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}
          

@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/Context.sol

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

pragma solidity ^0.8.0;

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

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

@openzeppelin/contracts/utils/Counters.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

@openzeppelin/contracts/utils/Strings.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

@openzeppelin/contracts/utils/introspection/ERC165.sol

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

@openzeppelin/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

operator-filter-registry/src/DefaultOperatorFilterer.sol

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

import {OperatorFilterer} from "./OperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol";
/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 * @dev    Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract DefaultOperatorFilterer is OperatorFilterer {
    /// @dev The constructor that is called when the contract is being deployed.
    constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}
          

operator-filter-registry/src/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);
}
          

operator-filter-registry/src/OperatorFilterer.sol

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

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @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.
 *         Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract OperatorFilterer {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // 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 (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 function to check if an 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 function to check if an operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @dev A helper function to check if an 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 contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}
          

operator-filter-registry/src/lib/Constants.sol

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

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

project:/contracts/interfaces/ICalculator.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;

interface ICalculator {
    function compute(bytes memory params) external view returns (uint256);
}
          

project:/contracts/interfaces/IRandomizer.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IRandomizer {
    function randomize() external returns (uint256);

    function randomize(uint256 limit) external returns (uint256);

    function distributeRandom(uint256 total, uint256[] memory weights)
        external
        returns (uint256);

    function last() external view returns (uint256);
}
          

project:/contracts/interfaces/IRights.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;

interface IRights {
    event AdminAdded(address indexed admin);
    event AdminDefined(address indexed admin, address indexed contractHash);
    event AdminRemoved(address indexed admin);
    event AdminCleared(address indexed admin, address indexed contractHash);

    /**
@notice Add a new admin for the Rigths contract
@param admin_ New admin address
*/

    function addAdmin(address admin_) external;

    /**
@notice Add a new admin for the any other contract
@param contract_ Contract address packed into address
@param admin_ New admin address
*/

    function addAdmin(address contract_, address admin_) external;

    /**
@notice Remove the existing admin from the Rigths contract
@param admin_ Admin address
*/

    function removeAdmin(address admin_) external;

    /**
@notice Remove the existing admin from the specified contract
@param contract_ Contract address packed into address
@param admin_ Admin address
*/

    function removeAdmin(address contract_, address admin_) external;

    /**
@notice Get the rights for the contract for the caller
@param contract_ Contract address packed into address
@return have rights or not
*/
    function haveRights(address contract_) external view returns (bool);

    /**
@notice Get the rights for the contract
@param contract_ Contract address packed into address
@param admin_ Admin address
@return have rights or not
*/
    function haveRights(address contract_, address admin_)
        external
        view
        returns (bool);
}
          

project:/contracts/lib/Constants.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com
pragma solidity 0.8.17;

/**
 * @dev Collection of constants
 */
library Constants {
    uint16 public constant MINIMAL = 800;
}
          

project:/contracts/lib/Structures.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com
pragma solidity 0.8.17;

/**
 * @dev Collection of structures
 */
library Structures {
    struct ActorData {
        uint256 adultTime;
        uint256 bornTime;
        string kidTokenUriHash;
        string adultTokenUriHash;
        uint16[10] props;
        uint8 childs;
        uint8 childsPossible;
        bool sex;
        bool born;
        bool immaculate;
        uint16 rank;
        address initialOwner;
    }

    struct Item {
        string itemKey;
        uint256 location;
        uint8 slots;
        string uri;
    }

    struct LootBox {
        uint256 price;
        uint16 total;
        uint16 available;
        bool paused;
        bool deleted;
        string uri;
        LootBoxItem[] items;
    }

    struct LootBoxItem {
        uint256 class;
        uint256 model;
        uint8 slots;
        uint16 promilles;
    }

    struct Estate {
        address lender;
        uint256 location;
        uint8 estateType;
        uint256 parent;
        uint256 coordinates;
    }

    struct Villa {
        uint256 location;
        uint256 fraction;
    }

    struct ManageAction {
        address target;
        address author;
        uint256 expiration;
        bytes4 signature;
        bytes data;
        bool executed;
    }

    struct InvestorData {
        address investor;
        uint256 promille;
    }

    struct Benefit {
        uint256 price;
        uint256 from;
        uint256 until;
        uint16 id;
        uint16 amount;
        uint8 level;
        uint8 issued;
    }
}
          

project:/contracts/persons/interfaces/IActors.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import {Structures} from "../../lib/Structures.sol";

interface IActors is IERC721Metadata {
    event Minted(address indexed owner, uint256 indexed id);

    event MintedImmaculate(address indexed owner, uint256 indexed id);

    event TokenUriDefined(uint256 indexed id, string kidUri, string adultUri);

    event ActorWasBorn(uint256 indexed id, uint256 bornTime);

    /**
@notice Get a total amount of issued tokens
@return The number of tokens minted
*/

    function total() external view returns (uint256);

    /**
    @notice Set an uri for the adult token (only for non immaculate)
    @param id_ token id
    @param adultHash_ ipfs hash of the kids metadata
    */
    function setMetadataHash(uint256 id_, string calldata adultHash_) external;

    /**
    @notice Set an uri for the adult and kid token (only for immaculate)
    @param id_ token id
    @param kidHash_ ipfs hash of the kids metadata
    @param adultHash_ ipfs hash of the adult metadata
    */
    function setMetadataHashes(
        uint256 id_,
        string calldata kidHash_,
        string calldata adultHash_
    ) external;

    /**
    @notice Get an uri for the kid token
    @param id_ token id
    @return Token uri for the kid actor
    */
    function tokenKidURI(uint256 id_) external view returns (string memory);

    /**
    @notice Get an uri for the adult token
    @param id_ token id
    @return Token uri for the adult actor
    */
    function tokenAdultURI(uint256 id_) external view returns (string memory);

    /**
@notice Create a new person token (not born yet)
@param id_ The id of new minted token
@param owner_ Owner of the token
@param props_ Array of the actor properties
@param sex_ The person sex (true = male, false = female)
@param born_ Is the child born or not
@param adultTime_ When child become adult actor, if 0 actor is not born yet
@param childs_ The amount of childs can be born (only for female)
@param immaculate_ True only for potion-breeded
@return The new id
*/
    function mint(
        uint256 id_,
        address owner_,
        uint16[10] memory props_,
        bool sex_,
        bool born_,
        uint256 adultTime_,
        uint8 childs_,
        bool immaculate_
    ) external returns (uint256);

    /**
@notice Get the person props
@param id_ Person token id
@return Array of the props
*/
    function getProps(uint256 id_) external view returns (uint16[10] memory);

    /**
    @notice Get the actor
    @param id_ Person token id
    @return Structures.ActorData full struct of actor
    */
    function getActor(uint256 id_)
        external
        view
        returns (Structures.ActorData memory);

    /**
@notice Get the person sex
@param id_ Person token id
@return true = male, false = female
*/
    function getSex(uint256 id_) external view returns (bool);

    /**
@notice Get the person childs
@param id_ Person token id
@return childs and possible available childs
*/
    function getChilds(uint256 id_) external view returns (uint8, uint8);

    /**
@notice Breed a child
@param id_ Person token id
*/
    function breedChild(uint256 id_) external;

    /**
@notice Get the person immaculate status
@param id_ Person token id
*/
    function getImmaculate(uint256 id_) external view returns (bool);

    /**
@notice Get the person born time
@param id_ Person token id
@return 0 = complete adult, or amount of tokens needed to be paid for
*/
    function getBornTime(uint256 id_) external view returns (uint256);

    /**
@notice Get the person born state
@param id_ Person token id
@return true = person is born
*/
    function isBorn(uint256 id_) external view returns (bool);

    /**
@notice Birth the person
@param id_ Person token id 
@param adultTime_ When person becomes adult
*/
    function born(uint256 id_, uint256 adultTime_) external;

    /**
@notice Get the person adult timestamp
@param id_ Person token id
@return timestamp
*/
    function getAdultTime(uint256 id_) external view returns (uint256);

    /**
@notice Grow the 
@param id_ Person token id 
@param time_ the deadline to grow
*/
    function setAdultTime(uint256 id_, uint256 time_) external;

    /**
@notice Get the person adult state
@param id_ Person token id
@return true = person is adult (price is 0 and current date > person's grow deadline)
*/
    function isAdult(uint256 id_) external view returns (bool);

    /**
@notice Get the person rank
@param id_ Person token id
@return person rank value
*/
    function getRank(uint256 id_) external view returns (uint16);
}
          

project:/contracts/persons/interfaces/IPotions.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";

interface IPotions is IERC721Metadata {
    event Created(
        address indexed owner,
        uint256 indexed id,
        uint256 indexed level
    );
    event Opened(address indexed owner, uint256 indexed id);
    event ChildsDefined(uint256 indexed childs);
    event TokenUriDefined(uint256 indexed id, string tokenUri);

    /**
@notice Get a total amount of issued tokens
@return The number of tokens minted
*/

    function total() external view returns (uint256);

    /**
@notice Get the amount of the actors remains to be created
@return The current value
*/
    function unissued() external view returns (uint256);

    /**
@notice Get the level of the potion
@param id_ potion id
@return The level of the potion
*/
    function level(uint256 id_) external view returns (uint256);

    /**
@notice Set the maximum amount of the childs for the woman actor
@param childs_ New childs amount
*/
    function setChilds(uint256 childs_) external;

    /**
@notice Get the current  maximum amount of the childs
@return The current value
*/
    function getChilds() external view returns (uint256);

    /**
@notice Open the packed id with the random values
@param id_ The pack id
@return The new actor id
*/
    function open(uint256 id_) external returns (uint256);

    /**
@notice return max potion level
@return The max potion level (1-based)
*/

    function getMaxLevel() external view returns (uint256);

    /**
@notice Create the potion by box (rare or not)
@param target The potion owner
@param rare The rarity sign
@param id_ The id of a new token
@return The new pack id
*/
    function create(
        address target,
        bool rare,
        uint256 id_
    ) external returns (uint256);

    /**
@notice Create the packed potion with desired level (admin only)
@param target The pack owner
@param level The pack level
@param id_ The id of a new token
@return The new pack id
*/
    function createPotion(
        address target,
        uint256 level,
        uint256 id_
    ) external returns (uint256);

    /**
@notice get the last pack for the address
@param target The  owner 
@return The  pack id
*/
    function getLast(address target) external view returns (uint256);

    /**
@notice Decrease the amount of the common or rare tokens or fails
*/
    function decreaseAmount(bool rare) external returns (bool);

    /**
    @notice Set an uri for the token
    @param id_ token id
    @param metadataHash_ ipfs hash of the metadata
    */
    function setMetadataHash(uint256 id_, string calldata metadataHash_)
        external;
}
          

project:/contracts/utils/EIP2981.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;

import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "./Guard.sol";

/**
@title The royalties base contract
@author Ilya A. Shlyakhovoy
@notice This contract manage properties of the game actor, including birth and childhood.
The new actor comes from the Breed or Box contracts
 */

abstract contract EIP2981 is ERC2981, Guard {
    event FeeChanged(
        address indexed receiver,
        uint96 collectionOwnerFeeNumerator,
        uint96 firstOwnerFeeNumerator
    );

    struct AdditionalRoyaltyInfo {
        uint96 collectionOwnerFeeNumerator;
        uint96 firstOwnerFeeNumerator;
    }

    AdditionalRoyaltyInfo private _additionalDefaultRoyaltyInfo;

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function feeDenominator() external pure returns (uint96) {
        return _feeDenominator();
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `collectionOwnerFeeNumerator` + `firstOwnerFeeNumerator` cannot be greater than the fee denominator.
     */
    function setDefaultRoyalty(
        address receiver,
        uint96 collectionOwnerFeeNumerator,
        uint96 firstOwnerFeeNumerator
    ) external haveRights {
        _setDefaultRoyalty(
            receiver,
            collectionOwnerFeeNumerator + firstOwnerFeeNumerator
        );

        _additionalDefaultRoyaltyInfo = _additionalDefaultRoyaltyInfo = AdditionalRoyaltyInfo(
            collectionOwnerFeeNumerator,
            firstOwnerFeeNumerator
        );
        emit FeeChanged(
            receiver,
            collectionOwnerFeeNumerator,
            firstOwnerFeeNumerator
        );
    }

    /**
     * @dev Returns amount of shares which should receive each party.
     */
    function additionalDefaultRoyaltyInfo()
        external
        view
        returns (AdditionalRoyaltyInfo memory)
    {
        return _additionalDefaultRoyaltyInfo;
    }

    /**
     * @dev Removes default royalty information.
     */
    function deleteDefaultRoyalty() external haveRights {
        _deleteDefaultRoyalty();
        delete _additionalDefaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `tokenId` must be already minted.
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) external haveRights {
        _setTokenRoyalty(tokenId, receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function resetTokenRoyalty(uint256 tokenId) external haveRights {
        _resetTokenRoyalty(tokenId);
    }
}
          

project:/contracts/utils/Guard.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;
import "../interfaces/IRights.sol";

abstract contract Guard {
    string constant NO_RIGHTS = "Guard: No rights";

    /// @notice only if person with rights calls the contract
    modifier haveRights() {
        require(_rights().haveRights(address(this), msg.sender), NO_RIGHTS);
        _;
    }

    /// @notice only if someone with rights calls the contract
    modifier haveRightsPerson(address who_) {
        require(_rights().haveRights(address(this), who_), NO_RIGHTS);
        _;
    }

    /// @notice only if who with rights calls the target function
    modifier haveRightsExt(address target_, address who_) {
        require(_rights().haveRights(target_, who_), NO_RIGHTS);
        _;
    }

    function _rights() internal view virtual returns (IRights);

    function setRights(address rights_) external virtual;
}
          

project:/contracts/utils/GuardExtension.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Ilya A. Shlyakhovoy
// Email: is@unicsoft.com

pragma solidity 0.8.17;
import "../interfaces/IRights.sol";
import "../utils/Guard.sol";

abstract contract GuardExtension is Guard {
    IRights private _rightsContract;

    string private constant SAME_VALUE = "Guard: same value";
    string private constant ZERO_ADDRESS = "Guard: zero address";

    constructor(address rights_) {
        require(rights_ != address(0), ZERO_ADDRESS);
        _rightsContract = IRights(rights_);
    }

    function _rights() internal view virtual override returns (IRights) {
        return _rightsContract;
    }

    function setRights(address rights_) external virtual override haveRights {
        require(address(_rightsContract) != rights_, SAME_VALUE);
        require(rights_ != address(0), ZERO_ADDRESS);
        _rightsContract = IRights(rights_);
    }
}
          

project:/contracts/utils/OperatorFiltererERC721.sol

// SPDX-License-Identifier: PROPRIERTARY

// Author: Bohdan Malkevych
// Email: bm@unicsoft.com

pragma solidity 0.8.17;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";

abstract contract OperatorFiltererERC721 is
    ERC721,
    DefaultOperatorFilterer,
    Ownable
{
    /**
     * @dev See {IERC721-setApprovalForAll}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        override
        onlyAllowedOperatorApproval(operator)
    {
        super.setApprovalForAll(operator, approved);
    }

    /**
     * @dev See {IERC721-approve}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function approve(address operator, uint256 tokenId)
        public
        override
        onlyAllowedOperatorApproval(operator)
    {
        super.approve(operator, tokenId);
    }

    /**
     * @dev See {IERC721-transferFrom}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId, data);
    }
}
          

Compiler Settings

{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{},"evmVersion":"london"}
              

Contract ABI

[{"type":"constructor","inputs":[{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"},{"type":"address","name":"rights_","internalType":"address"},{"type":"address","name":"zombie_","internalType":"address"},{"type":"address","name":"random_","internalType":"address"},{"type":"uint256[]","name":"limits_","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts_","internalType":"uint256[]"},{"type":"uint256[]","name":"women_","internalType":"uint256[]"},{"type":"uint256","name":"childs_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOperatorFilterRegistry"}],"name":"OPERATOR_FILTER_REGISTRY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct EIP2981.AdditionalRoyaltyInfo","components":[{"type":"uint96"},{"type":"uint96"}]}],"name":"additionalDefaultRoyaltyInfo","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"create","inputs":[{"type":"address","name":"target","internalType":"address"},{"type":"bool","name":"rare","internalType":"bool"},{"type":"uint256","name":"id_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"createPotion","inputs":[{"type":"address","name":"target","internalType":"address"},{"type":"uint256","name":"level_","internalType":"uint256"},{"type":"uint256","name":"id_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAmount","inputs":[{"type":"bool","name":"rare","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deleteDefaultRoyalty","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint96","name":"","internalType":"uint96"}],"name":"feeDenominator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getChilds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLast","inputs":[{"type":"address","name":"target","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLimits","inputs":[{"type":"uint256","name":"level_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMaxLevel","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"level","inputs":[{"type":"uint256","name":"id_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"open","inputs":[{"type":"uint256","name":"id_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"resetTokenRoyalty","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"royaltyInfo","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_salePrice","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setChilds","inputs":[{"type":"uint256","name":"childs_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDefaultRoyalty","inputs":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint96","name":"collectionOwnerFeeNumerator","internalType":"uint96"},{"type":"uint96","name":"firstOwnerFeeNumerator","internalType":"uint96"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMetadataHash","inputs":[{"type":"uint256","name":"id_","internalType":"uint256"},{"type":"string","name":"metadataHash_","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMysteryBox","inputs":[{"type":"address","name":"value_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRandom","inputs":[{"type":"address","name":"value_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRights","inputs":[{"type":"address","name":"rights_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokenRoyalty","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"address","name":"receiver","internalType":"address"},{"type":"uint96","name":"feeNumerator","internalType":"uint96"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setZombie","inputs":[{"type":"address","name":"value_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"id_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"total","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"unissued","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"approved","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}],"anonymous":false},{"type":"event","name":"ChildsDefined","inputs":[{"type":"uint256","name":"childs","indexed":true}],"anonymous":false},{"type":"event","name":"Created","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"uint256","name":"id","indexed":true},{"type":"uint256","name":"level","indexed":true}],"anonymous":false},{"type":"event","name":"FeeChanged","inputs":[{"type":"address","name":"receiver","indexed":true},{"type":"uint96","name":"collectionOwnerFeeNumerator","indexed":false},{"type":"uint96","name":"firstOwnerFeeNumerator","indexed":false}],"anonymous":false},{"type":"event","name":"Opened","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"uint256","name":"id","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":true},{"type":"address","name":"newOwner","indexed":true}],"anonymous":false},{"type":"event","name":"TokenUriDefined","inputs":[{"type":"uint256","name":"id","indexed":true},{"type":"string","name":"tokenUri","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false},{"type":"error","name":"OperatorNotAllowed","inputs":[{"type":"address","name":"operator","internalType":"address"}]}]
              

Contract Creation Code

0x608060409080825234620007515760006200428d803803809162000024828662000788565b8439820191610120818403126200074d5780516001600160401b03811162000749578362000054918301620007d1565b60208201519093906001600160401b03811162000745578162000079918401620007d1565b620000868684016200082c565b9062000095606085016200082c565b90620000a4608086016200082c565b60a08601519092906001600160401b038111620007415785620000c991880162000841565b60c08701519094906001600160401b0381116200058d5786620000ee91890162000841565b60e08801519096906001600160401b0381116200073d576101009162000116918a0162000841565b97015189519093906001600160401b038111620006615789549a60019b8c81811c9116801562000732575b60208210146200071e57908b82601f859411620006ea575b5050602090601f831160011462000681578c9262000675575b5050600019600383901b1c1916908b1b1789555b8051906001600160401b03821162000661578a548b81811c9116801562000656575b602082101462000642579081601f84931162000602575b50602090601f83116001146200059d578b9262000591575b5050600019600383901b1c1916908a1b1789555b6daaeb6d7670e522a718067333cd4e803b62000507575b50600680546001600160a01b031980821633908117909355956001600160a01b03938493919284929083167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08e80a316620002968d51620002638162000756565b601381527f47756172643a207a65726f2061646472657373000000000000000000000000006020820152821515620008e9565b86600a541617600a551691620002b8620002af620008ae565b841515620008e9565b1691620002c8620002af620008ae565b600c558260125416176012556011918254161781558251600d9386855560018060401b038211620004f3576801000000000000000094858311620004df57600e5483600e55808410620004b3575b50600e88526000805160206200426d833981519152602083018a8a5b8681106200049f5750505050875b8381106200045f5750508351949250506001600160401b03841190506200044b57821162000437576020906017548360175580841062000419575b5060178552017fc624b66cc0138b8fabc209247f72d758e1cf3343756d543badbf24212bed8c1585855b8481106200040557509250505082905b620003ca575b84516138d090816200099d8239f35b8151811015620003ff5780620003e5620003f8928462000971565b518185526010602052868520556200094b565b83620003b5565b620003bb565b6020845194019381840155018690620003a5565b601786528286206200043091810190850162000932565b386200037b565b634e487b7160e01b84526041600452602484fd5b634e487b7160e01b85526041600452602485fd5b81546200046d828562000971565b5181018091116200048b57825562000485906200094b565b62000340565b634e487b7160e01b8a52600486905260248afd5b6020835193019281850155018b9062000332565b600e8952620004d8906000805160206200426d83398151915290810190850162000932565b3862000316565b634e487b7160e01b88526041600452602488fd5b634e487b7160e01b87526041600452602487fd5b803b156200058d5788809160448d5180948193633e9f1edf60e11b8352306004840152733cc6cdda760b79bafa08df41ecfa224f810dceb660248401525af1801562000583571562000202579097906001600160401b0381116200056f578a52963862000202565b634e487b7160e01b82526041600452602482fd5b8b513d8b823e3d90fd5b8880fd5b015190503880620001d7565b8c8c5260208c208d94509190601f1984168d5b818110620005e957508411620005cf575b505050811b018955620001eb565b015160001960f88460031b161c19169055388080620005c1565b8284015185558f969094019360209384019301620005b0565b62000630908d8d5260208d20601f850160051c8101916020861062000637575b601f0160051c019062000932565b38620001bf565b909150819062000622565b634e487b7160e01b8b52602260045260248bfd5b90607f1690620001a8565b634e487b7160e01b8a52604160045260248afd5b01519050388062000172565b908d93508c805260208d20918d5b601f1985168110620006d1575083601f19811610620006b7575b505050811b01895562000186565b015160001960f88460031b161c19169055388080620006a9565b8183015184558f9590930192602092830192016200068f565b6020828062000716945220601f850160051c810191602086106200063757601f0160051c019062000932565b8b3862000159565b634e487b7160e01b8c52602260045260248cfd5b90607f169062000141565b8980fd5b8780fd5b8380fd5b8280fd5b5080fd5b600080fd5b604081019081106001600160401b038211176200077257604052565b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b038211908210176200077257604052565b60005b838110620007c05750506000910152565b8181015183820152602001620007af565b81601f82011215620007515780516001600160401b03811162000772576040519262000808601f8301601f19166020018562000788565b818452602082840101116200075157620008299160208085019101620007ac565b90565b51906001600160a01b03821682036200075157565b9080601f8301121562000751578151906001600160401b03821162000772578160051b60405193602093620008798584018762000788565b8552838086019282010192831162000751578301905b8282106200089e575050505090565b815181529083019083016200088f565b60405190620008bd8262000756565b601482527f506f74696f6e3a207a65726f20616464726573730000000000000000000000006020830152565b15620008f25750565b6044604051809262461bcd60e51b825260206004830152620009248151809281602486015260208686019101620007ac565b601f01601f19168101030190fd5b8181106200093e575050565b6000815560010162000932565b60001981146200095b5760010190565b634e487b7160e01b600052601160045260246000fd5b8051821015620009865760209160051b010190565b634e487b7160e01b600052603260045260246000fdfe60806040526004361015610013575b600080fd5b60003560e01c806301ffc9a71461034757806305c58df21461033e57806306fdde0314610335578063081812fc1461032c578063095ea7b3146103235780630d9b13c41461031a578063180b0d7e1461031157806323b872dd146103085780632a55205a146102ff5780632ddbd13a146102f65780633798fe56146102ed57806337d2aae9146102e457806341f43434146102db57806342842e0e146102d2578063512c97e9146102c95780635944c753146102c05780636352211e146102b7578063690e7c09146102ae57806370a08231146102a5578063715018a61461029c57806376082715146102935780637b43b8271461028a57806387b95404146102815780638a616bc0146102785780638da5cb5b1461026f57806395d89b4114610266578063a22cb4651461025d578063aa1b103f14610254578063b45392ca1461024b578063b88d4fde14610242578063b9140a5a14610239578063c87b56dd14610230578063ca9c0bad14610227578063cc26f3d21461021e578063d6e18b3e14610215578063dbed85581461020c578063dc87599714610203578063e0aa90a4146101fa578063e985e9c5146101f1578063f2fde38b146101e85763f5fe3526146101e057600080fd5b61000e611ca2565b5061000e611c0b565b5061000e611bad565b5061000e611b30565b5061000e611adc565b5061000e611ab1565b5061000e611a92565b5061000e611922565b5061000e61189d565b5061000e611844565b5061000e6117e4565b5061000e61176b565b5061000e6115db565b5061000e611564565b5061000e61146e565b5061000e6113c8565b5061000e61139e565b5061000e61133f565b5061000e611320565b5061000e611289565b5061000e61124e565b5061000e6111ec565b5061000e611149565b5061000e610f40565b5061000e610f21565b5061000e610db1565b5061000e610b79565b5061000e610add565b5061000e610ab3565b5061000e61099d565b5061000e610964565b5061000e610945565b5061000e610888565b5061000e61083f565b5061000e6107ec565b5061000e6106e5565b5061000e6105e2565b5061000e610585565b5061000e6104a1565b5061000e6103eb565b5061000e610362565b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e57602060043561038281610350565b63ffffffff60e01b1663152a902d60e11b81149081156103a8575b506040519015158152f35b6380ac58cd60e01b8114915081156103da575b81156103c9575b503861039d565b6301ffc9a760e01b149050386103c2565b635b5e139f60e01b811491506103bb565b503461000e57602036600319011261000e5760043560008181526002602052604090205461042d906001600160a01b031615155b6104276120f4565b90612120565b60005260166020526020604060002054604051908152f35b60005b8381106104585750506000910152565b8181015183820152602001610448565b9060209161048181518092818552858086019101610445565b601f01601f1916010190565b90602061049e928181520190610468565b90565b503461000e5760008060031936011261058257604051908080546104c481611fc6565b8085529160019180831690811561055857506001146104fe575b6104fa856104ee818703826116d8565b6040519182918261048d565b0390f35b80809450527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106105405750505081016020016104ee826104fa6104de565b80546020858701810191909152909301928101610525565b8695506104fa969350602092506104ee94915060ff191682840152151560051b82010192936104de565b80fd5b503461000e57602036600319011261000e5760206105a4600435612000565b6040516001600160a01b039091168152f35b600435906001600160a01b038216820361000e57565b602435906001600160a01b038216820361000e57565b503461000e57604036600319011261000e576105fc6105b6565b60243561060882613329565b61061181611f4e565b916001600160a01b03808416908216811461068c576106439361063e913314908115610645575b506133d7565b6124ef565b005b6001600160a01b03166000908152600560205260409020610686915061067f9033905b9060018060a01b0316600052602052604060002090565b5460ff1690565b38610638565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b8015150361000e57565b503461000e57606036600319011261000e576104fa6107566107056105b6565b602435610711816106db565b60135461074d906001600160a01b0390819081165b1661073a6107326128db565b821515612120565b3314908115610766575b5061042761290a565b604435916129fb565b6040519081529081906020820190565b600a54604051630f6266a760e01b8152306004820152336024820152925060209183916044918391166001600160a01b03165afa9081156107df575b6000916107b1575b5038610744565b6107d2915060203d81116107d8575b6107ca81836116d8565b81019061214c565b386107aa565b503d6107c0565b6107e7612161565b6107a2565b503461000e57600036600319011261000e5760206040516127108152f35b606090600319011261000e576001600160a01b0390600435828116810361000e5791602435908116810361000e579060443590565b503461000e576106436108513661080a565b91336001600160a01b0382160361087a575b61087561087084336134af565b613449565b6135f7565b61088333613329565b610863565b503461000e57604036600319011261000e5761271060243560043560005260086020526108b860406000206120b8565b80516001600160a01b03161561092e575b6108fd816001600160601b0360206104fa9401511693848102948186041490151715610921575b516001600160a01b031690565b604080516001600160a01b0390921682529390920460208301529091829190820190565b6109296120dd565b6108f0565b506104fa6108fd61093d612092565b9150506108c9565b503461000e57600036600319011261000e576020600b54604051908152f35b503461000e57600036600319011261000e576020600e546000198101908111610990575b604051908152f35b6109986120dd565b610988565b503461000e5760208060031936011261000e576109b86105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b03808316949293610a799392610a46929190610a129085816044818c5afa908115610aa6575b600091610a89575b5061042761216e565b16948560405191610a2283611677565b601183527047756172643a2073616d652076616c756560781b858401521415612120565b7247756172643a207a65726f206164647265737360681b60405191610a6a83611677565b60138352820152831515612120565b6001600160a01b03191617600a55005b610aa09150863d88116107d8576107ca81836116d8565b38610a09565b610aae612161565b610a01565b503461000e57600036600319011261000e5760206040516daaeb6d7670e522a718067333cd4e8152f35b503461000e57610b39610aef3661080a565b6001600160a01b0383163314159290919083610b6b575b60405193610b13856116a0565b60008552610b5d575b610b2961087084336134af565b610b348383836135f7565b6137d7565b15610b4057005b60405162461bcd60e51b815280610b596004820161370e565b0390fd5b610b6633613329565b610b1c565b610b7433613329565b610b06565b503461000e57604036600319011261000e5760043567ffffffffffffffff60243581811161000e573660238201121561000e57806004013591821161000e576024810190602483369201011161000e57600a54604051630f6266a760e01b81523060048201523360248201527f32ca4bd288f17c941679e795f9f3eb354b8c940b37c6d25a0b56d5017bc2355593610d5c9390926104ee92602092610d4e929091610c4a918590829060449082906001600160a01b03165afa908115610d78575b600091610d61575061042761216e565b600088815260026020526040902054610c6d906001600160a01b0316151561041f565b610ca3610c8c610c878a6000526015602052604060002090565b612d78565b848151910120610c9a612e1c565b1461042761312a565b610cdc610cd4610cd061067f610cba368a87611734565b8781519101206000526014602052604060002090565b1590565b610427613159565b610d10610d03610ced368885611734565b8581519101206000526014602052604060002090565b805460ff19166001179055565b610d2e8582610d298b6000526015602052604060002090565b6131e6565b610d36612e4f565b94610d48604051968795860190612e72565b916132bc565b03601f1981018352826116d8565b0390a2005b610aa09150853d87116107d8576107ca81836116d8565b610d80612161565b610c3a565b604435906001600160601b038216820361000e57565b602435906001600160601b038216820361000e57565b503461000e57606036600319011261000e57610dcb6105cc565b610dd3610d85565b600a54604051630f6266a760e01b81523060048201523360248201529192916001600160a01b0391610e2a9190602090829085168180604481015b03915afa908115610f14575b600091610efc575061042761216e565b610e416127106001600160601b03851611156132ca565b811615610eb757610e7961064392610e69610e5a6116fa565b6001600160a01b039094168452565b6001600160601b03166020830152565b610e8f6004356000526008602052604060002090565b815160209092015160a01b6001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606490fd5b610aa0915060203d81116107d8576107ca81836116d8565b610f1c612161565b610e1a565b503461000e57602036600319011261000e5760206105a4600435611f4e565b503461000e57602036600319011261000e576004356000818152600260205260409020546104fa9161075691610f80906001600160a01b0316151561041f565b610f8981611f4e565b610fa6610f946123b8565b6001600160a01b039283163314612120565b610fba826000526016602052604060002090565b546012549091906001600160a01b0316610fdd610fd6846122ee565b90836126dc565b929050600193610fff610fef826122ca565b6000526010602052604060002090565b546110be575b506000908415611033575050506000925b61101f81612411565b6000818152601660205260408120556127dd565b602061106860ff94611046600c546123e7565b85604051958680958194633ac13e5760e11b8352600483019190602083019252565b0393165af19182156110b1575b91611083575b501692611016565b6110a4915060203d81116110aa575b61109c81836116d8565b810190612402565b3861107b565b503d611092565b6110b9612161565b611075565b935061111b6111076110e26110d2876122ca565b600052600f602052604060002090565b546111016110f76110f2896122ca565b612240565b90549060031b1c90565b906123f5565b611113610fef876122ca565b5490846125b4565b938461100557611142610fef61113c611136610fef856122ca565b546122ca565b926122ca565b5538611005565b503461000e57602036600319011261000e576001600160a01b0361116b6105b6565b1680156111945760005260036020526104fa604060002054604051918291829190602083019252565b60405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608490fd5b503461000e576000806003193601126105825760065481906001600160a01b0381169061121a338314611eba565b6001600160a01b0319166006557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461000e57602036600319011261000e576001600160a01b036112706105b6565b1660005260186020526020604060002054604051908152f35b503461000e57602036600319011261000e576112a36105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b0392916112e0919060209082908616818060448101610e0e565b6112fd82601354921692836112f361219a565b9184161415612120565b6113106113086121c8565b831515612120565b6001600160a01b03191617601355005b503461000e57600036600319011261000e576020600d54604051908152f35b503461000e57602036600319011261000e57600a54604051630f6266a760e01b815230600482015233602482015261138a9160209082906001600160a01b0316818060448101610e0e565b600435600090815260086020526040812055005b503461000e57600036600319011261000e576006546040516001600160a01b039091168152602090f35b503461000e5760008060031936011261058257604051908060018054916113ee83611fc6565b808652928281169081156105585750600114611414576104fa856104ee818703826116d8565b92508083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8284106114565750505081016020016104ee826104fa6104de565b8054602085870181019190915290930192810161143b565b503461000e57604036600319011261000e576114886105b6565b602435611494816106db565b61149d82613329565b6001600160a01b0382169133831461151f57816114dc6114ed9233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b503461000e5760008060031936011261058257600a54604051630f6266a760e01b81523060048201523360248201526115c391602090829060449082906001600160a01b03165afa9081156115ce575b8391610efc575061042761216e565b806007558060095580f35b6115d6612161565b6115b4565b503461000e57602036600319011261000e576115f56105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b039291611632919060209082908616818060448101610e0e565b61164582601154921692836112f361219a565b6116506113086121c8565b6001600160a01b03191617601155005b50634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761169357604052565b61169b611660565b604052565b6020810190811067ffffffffffffffff82111761169357604052565b6060810190811067ffffffffffffffff82111761169357604052565b90601f8019910116810190811067ffffffffffffffff82111761169357604052565b6040519061170782611677565b565b60209067ffffffffffffffff8111611727575b601f01601f19160190565b61172f611660565b61171c565b92919261174082611709565b9161174e60405193846116d8565b82948184528183011161000e578281602093846000960137010152565b503461000e57608036600319011261000e576117856105b6565b61178d6105cc565b906044356064359267ffffffffffffffff841161000e573660238501121561000e576117c6610b39943690602481600401359101611734565b92336001600160a01b03821603610b5d57610b2961087084336134af565b503461000e57600036600319011261000e576000602060405161180681611677565b82815201526040805161181881611677565b6009546001600160601b039081602081831694858152019160601c168152835192835251166020820152f35b503461000e57602036600319011261000e576004356000818152600260205260409020546104fa9161188991611884906001600160a01b0316151561041f565b612f58565b604051918291602083526020830190610468565b503461000e57602036600319011261000e576118b76105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b0392916118f4919060209082908616818060448101610e0e565b61190782601254921692836112f361219a565b6119126113086121c8565b6001600160a01b03191617601255005b503461000e57606036600319011261000e576104fa611a676119426105b6565b600a54604051630f6266a760e01b815230600482015233602482810191909152611a4c929035916119869160209082906001600160a01b0316818060448101610e0e565b6119916107326121f8565b6119a1600d5415156104276129cf565b6000198101818111611a85575b600e541115611a78575b600e6000526119ee7fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fc82015415156104276129cf565b611a2f611a08611a036110f76110f2856122ca565b6122ca565b611a146110f2846122ca565b90919082549060031b600019811b9283911b16911916179055565b611a42611a3d600d546122ca565b600d55565b6044359083612b32565b91829160018060a01b03166000526018602052604060002090565b556040519081529081906020820190565b611a80612229565b6119b8565b611a8d6120dd565b6119ae565b503461000e57600036600319011261000e576020600c54604051908152f35b503461000e57602036600319011261000e576040611ad06004356122ee565b82519182526020820152f35b503461000e57602036600319011261000e576104fa611b1e600435611b00816106db565b601354611b19906001600160a01b039081908116610726565b612ccd565b60405190151581529081906020820190565b503461000e57602036600319011261000e57600a54604051630f6266a760e01b8152306004828101919091523360248301523591611b82919060209082906001600160a01b0316818060448101610e0e565b80600c557f4f441af7cfd7ca1e0f18c1dae2f9a5401c997fd7f7ff246b6c89b67312302c6b600080a2005b503461000e57604036600319011261000e57602060ff611bff611bce6105b6565b611bd66105cc565b6001600160a01b0391821660009081526005865260408082209290931681526020919091522090565b54166040519015158152f35b503461000e57602036600319011261000e57611c256105b6565b6006546001600160a01b0390611c3e9082163314611eba565b811615611c4e5761064390611f05565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b503461000e57606036600319011261000e57611cbc6105b6565b611cc4610d9b565b611ccc610d85565b600a54604051630f6266a760e01b81523060048201523360248201526020946001600160a01b0394929091611d20918790829060449082908a165afa908115611ead575b600091611e96575061042761216e565b6001600160601b0393611d486127108686168786160196808811611e89575b871611156132ca565b8116938415611e445794611dc0611e2192611d997fb8e5032b0e405c7f726d44adcae73cc1939b1c7988441ea33922a7723d3345b59798611d8a610e5a6116fa565b6001600160601b031682850152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600755565b611de984611dcc6116fa565b6001600160601b0386168152928301906001600160601b03169052565b6001600160601b038151166009549160206001600160601b0360601b91015160601b169167ffffffffffffffff60c01b161717600955565b604080516001600160601b03928316815292909116602083015281908101610d5c565b60405162461bcd60e51b815260048101879052601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b611e916120dd565b611d3f565b610aa09150873d89116107d8576107ca81836116d8565b611eb5612161565b611d10565b15611ec157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600680546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b6000908152600260205260409020546001600160a01b03168015611f6f5790565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608490fd5b90600182811c92168015611ff6575b6020831014611fe057565b634e487b7160e01b600052602260045260246000fd5b91607f1691611fd5565b6000818152600260205260409020546001600160a01b031615612038576000908152600460205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b6040519061209f82611677565b6007546001600160a01b038116835260a01c6020830152565b906040516120c581611677565b91546001600160a01b038116835260a01c6020830152565b50634e487b7160e01b600052601160045260246000fd5b6040519061210182611677565b601082526f141bdd1a5bdb8e881ddc9bdb99c81a5960821b6020830152565b156121285750565b60405162461bcd60e51b815260206004820152908190610b59906024830190610468565b9081602091031261000e575161049e816106db565b506040513d6000823e3d90fd5b6040519061217b82611677565b601082526f47756172643a204e6f2072696768747360801b6020830152565b604051906121a782611677565b6012825271506f74696f6e3a2073616d652076616c756560701b6020830152565b604051906121d582611677565b6014825273506f74696f6e3a207a65726f206164647265737360601b6020830152565b6040519061220582611677565b6015825274141bdd1a5bdb8e881b9bc81e995c9bc81b195d995b605a1b6020830152565b50634e487b7160e01b600052603260045260246000fd5b600e54811015612278575b600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0190600090565b612280612229565b61224b565b6017548110156122bd575b60176000527fc624b66cc0138b8fabc209247f72d758e1cf3343756d543badbf24212bed8c150190600090565b6122c5612229565b612290565b6000198101919082116122d957565b6117076120dd565b919082039182116122d957565b906122fa6113086121f8565b60175461233560405161230c81611677565b6013815272141bdd1a5bdb8e881ddc9bdb99c81b195d995b606a1b602082015282851115612120565b60018314612375575061049e6110f761236861235b600119860186811161236d57612285565b90549060031b1c946122ca565b612285565b6123686120dd565b909150156123ab575b60176000527fc624b66cc0138b8fabc209247f72d758e1cf3343756d543badbf24212bed8c155461032091565b6123b3612229565b61237e565b604051906123c582611677565b60138252722837ba34b7b71d103bb937b7339037bbb732b960691b6020830152565b90600182018092116122d957565b919082018092116122d957565b9081602091031261000e575190565b61241a81611f4e565b6124238261249b565b6001600160a01b03166000818152600360205260408120805491929160001981019190821161248e575b5582825260026020526040822080546001600160a01b03191690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4565b6124966120dd565b61244d565b600081815260046020526040812080546001600160a01b03191690556001600160a01b036124c883611f4e565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258280a4565b600082815260046020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b038061252884611f4e565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b604090805160011015612564570190565b61256c612229565b0190565b9060609160408101918152602092816040858094015285518094520193019160005b8281106125a0575050505090565b835185529381019392810192600101612592565b9161261292602092604051926125c9846116bc565b60028452848401604036823781830390838211612665575b855115612658575b526125f384612553565b52600060405180968195829463116cc47f60e21b845260048401612570565b03926001600160a01b03165af190811561264b575b60009161263357501590565b610cd0915060203d81116110aa5761109c81836116d8565b612653612161565b612627565b612660612229565b6125e9565b61266d6120dd565b6125e1565b6040519061014080830183811067ffffffffffffffff821117612698575b604052368337565b6126a0611660565b612690565b60019060001981146126b5570190565b61256c6120dd565b90600a8110156126cf575b60051b0190565b6126d7612229565b6126c8565b9291926126e7612672565b506126fa826126f4612672565b956122e1565b60009283925b600a841061271057505050509190565b909192936127a56127ab9161278d61277a6127738761274f604051633ac13e5760e11b81528b818b816000816020978896600483019190602083019252565b03926001600160a01b03165af19182156127d0575b6000926127b3575b50506123f5565b61ffff1690565b612784898c6126bd565b9061ffff169052565b61110161277361279d898c6126bd565b5161ffff1690565b946126a5565b929190612700565b6127c99250803d106110aa5761109c81836116d8565b388061276c565b6127d8612161565b612764565b929060018060a01b036011541691604051938492630610bbd160e11b845286600485015233602485015260448401906000915b600a83106128be575050506000602094612852610224948694151561018486015261283f6101a4860160019052565b6101c4850184905260ff166101e4850152565b60016102048401525af180156128b1575b612893575b5080337fc4b27f09c64550fd678a5b3c3a00f454814732e346e0f1c79d0add8f980346de600080a390565b6128aa9060203d81116110aa5761109c81836116d8565b5038612868565b6128b9612161565b612863565b815161ffff16815287955060019092019160209182019101612810565b604051906128e882611677565b6013825272141bdd1a5bdb8e88189bde081b9bdd081cd95d606a1b6020830152565b6040519061291782611677565b60128252710a0dee8d2dedce674409cdee840c240c4def60731b6020830152565b604081019181526060602091604083820152600e548094520191600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd916000905b82821061298b575050505090565b83548552938401936001938401939091019061297d565b604051906129af82611677565b60118252702837ba34b7b71d103a393c9030b3b0b4b760791b6020830152565b604051906129dc82611677565b601082526f141bdd1a5bdb8e881cdbdb19081bdd5d60821b6020830152565b61049e9291612a0b600e546122ca565b9015612a6c575b80612a2f612a256110f7612a6694612240565b15156104276129cf565b612a4c612a4682600052600f602052604060002090565b546123e7565b612a6082600052600f602052604060002090565b556123e7565b90612b32565b50612a6660006020612ab6612a97612a8b60125460018060a01b031690565b6001600160a01b031690565b600d5460405194858094819363116cc47f60e21b835260048301612938565b03925af1908115612b25575b600091612b07575b50612b0081612ae8612ade6110f783612240565b15156104276129a2565b611a14612afa611a036110f784612240565b91612240565b9050612a12565b612b1f915060203d81116110aa5761109c81836116d8565b38612aca565b612b2d612161565b612ac2565b612b3d6113086121f8565b600b805460010190556000838152601660205260408120839055906001600160a01b038116908115612c3d578492612c117f95b18bbe5373dcbe675d3ab2ae6e3888392575c51b8b8c9c3cbbdb431af1929992612bba612bb5610cd088600052600260205260018060a01b0360406000205416151590565b612c81565b6001600160a01b0381166000908152600360205260409020612bdc81546123e7565b9055612bf2866000526002602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b8383827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a480a490565b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b15612c8857565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b600d5415612d5857612ced575b612ce5600d546122ca565b600d55600190565b600e547fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fc600019820191808311612d6b575b80831015612d5e575b600e600052015415612d585780611a14612afa612d47612d5394612240565b90549060031b1c6122ca565b612cda565b50600090565b612d66612229565b612d28565b612d736120dd565b612d1f565b9060405191826000825492612d8c84611fc6565b908184526001948581169081600014612df95750600114612db6575b5050611707925003836116d8565b9093915060005260209081600020936000915b818310612de157505061170793508201013880612da8565b85548884018501529485019487945091830191612dc9565b91505061170794506020925060ff191682840152151560051b8201013880612da8565b6000604051612e2a816116a0565b527fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b60405190612e5c82611677565b6007825266697066733a2f2f60c81b6020830152565b9061256c60209282815194859201610445565b600092918154612e9481611fc6565b92600191808316908115612eed5750600114612eb1575b50505050565b90919293945060005260209081600020906000915b858310612edc5750505050019038808080612eab565b805485840152918301918101612ec6565b60ff1916845250505081151590910201915038808080612eab565b60405190612f15826116bc565b602e82526d2d1a2a232aa233b3a3a1229b343160911b6040837f516d5a3962435452424e7767796875615836503758666d38443163376a63554d60208201520152565b612f6c816000526016602052604060002090565b5490612f85610c87826000526015602052604060002090565b60208151910120612f94612e1c565b03613004575061049e612fd891610d4e612fee612faf612e4f565b92612fd8612fde612fc7612fc1612f08565b93613061565b926040519889976020890190612e72565b90612e72565b632f706f2f60e01b815260040190565b6917b6b2ba30973539b7b760b11b8152600a0190565b61303c915061049e90610d4e61302c61301b612e4f565b926000526015602052604060002090565b6040519485936020850190612e72565b90612e85565b90602091805182101561305457010190565b61305c612229565b010190565b801561310c57806000908282935b6130f8575061307d83611709565b9261308b60405194856116d8565b80845281601f1961309b83611709565b013660208701375b6130ad5750505090565b6130b6906122ca565b90600a90603082820681018091116130eb575b60f81b6001600160f81b031916841a6130e28487613042565b530490816130a3565b6130f36120dd565b6130c9565b92613104600a916126a5565b93048061306f565b5060405161311981611677565b60018152600360fc1b602082015290565b6040519061313782611677565b6013825272141bdd1a5bdb8e88185b1c9958591e481cd95d606a1b6020830152565b6040519061316682611677565b601982527f506f74696f6e3a206d65746120616c72656164792075736564000000000000006020830152565b90601f81116131a057505050565b600091825260208220906020601f850160051c830194106131dc575b601f0160051c01915b8281106131d157505050565b8181556001016131c5565b90925082906131bc565b90929167ffffffffffffffff81116132af575b61320d816132078454611fc6565b84613192565b6000601f8211600114613247578192939460009261323c575b50508160011b916000199060031b1c1916179055565b013590503880613226565b601f1982169461325c84600052602060002090565b91805b87811061329757508360019596971061327d575b505050811b019055565b0135600019600384901b60f8161c19169055388080613273565b9092602060018192868601358155019401910161325f565b6132b7611660565b6131f9565b908092918237016000815290565b156132d157565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b6daaeb6d7670e522a718067333cd4e803b613342575050565b604051633185c44d60e21b81523060048201526001600160a01b038316602482015290602090829060449082905afa9081156133ca575b6000916133ac575b501561338a5750565b604051633b79c77360e21b81526001600160a01b039091166004820152602490fd5b6133c4915060203d81116107d8576107ca81836116d8565b38613381565b6133d2612161565b613379565b156133de57565b60405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608490fd5b1561345057565b60405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608490fd5b6000828152600260205260409020546001600160a01b031615613545576134d582611f4e565b9160018060a01b0390818316928285168414948515613514575b505083156134fe575b50505090565b61350a91929350612000565b16143880806134f8565b6001600160a01b0316600090815260056020526040902091945060ff9161353b9190610668565b54169238806134ef565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b156135a657565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9061360183611f4e565b6001600160a01b0383811692909182168390036136bb576136506136949282169461362d86151561359f565b6136368761249b565b6001600160a01b0316600090815260036020526040902090565b61365a81546122ca565b90556001600160a01b038116600090815260036020526040902061367e81546123e7565b9055612bf2856000526002602052604060002090565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b9081602091031261000e575161049e81610350565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261049e92910190610468565b3d156137d2573d906137b882611709565b916137c660405193846116d8565b82523d6000602084013e565b606090565b92909190823b156138915761380a926020926000604051809681958294630a85bd0160e11b9a8b85523360048601613776565b03926001600160a01b03165af160009181613861575b506138535761382d6137a7565b8051908161384e5760405162461bcd60e51b815280610b596004820161370e565b602001fd5b6001600160e01b0319161490565b61388391925060203d811161388a575b61387b81836116d8565b810190613761565b9038613820565b503d613871565b5050505060019056fea264697066735822122000855a3cc2b78c5871beaa9861e285721195ad09b4dea30d3118ccf11e43a25064736f6c63430008110033bb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000ea6a031bbaf2eadb5ecfd32b8aa39e9a95659e460000000000000000000000007bb9cf4de4c55ebc3faff90cb44b1e5b7cff868f000000000000000000000000ab15171ec6427406dff4640dccc9ca378a9b0ded00000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000e556e6465616473506f74696f6e730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004554e5a50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000047e00000000000000000000000000000000000000000000000000000000000004f6000000000000000000000000000000000000000000000000000000000000056e00000000000000000000000000000000000000000000000000000000000005d200000000000000000000000000000000000000000000000000000000000005dc00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000d0500000000000000000000000000000000000000000000000000000000000008ae00000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000029b00000000000000000000000000000000000000000000000000000000000001bc00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000

Deployed ByteCode

0x60806040526004361015610013575b600080fd5b60003560e01c806301ffc9a71461034757806305c58df21461033e57806306fdde0314610335578063081812fc1461032c578063095ea7b3146103235780630d9b13c41461031a578063180b0d7e1461031157806323b872dd146103085780632a55205a146102ff5780632ddbd13a146102f65780633798fe56146102ed57806337d2aae9146102e457806341f43434146102db57806342842e0e146102d2578063512c97e9146102c95780635944c753146102c05780636352211e146102b7578063690e7c09146102ae57806370a08231146102a5578063715018a61461029c57806376082715146102935780637b43b8271461028a57806387b95404146102815780638a616bc0146102785780638da5cb5b1461026f57806395d89b4114610266578063a22cb4651461025d578063aa1b103f14610254578063b45392ca1461024b578063b88d4fde14610242578063b9140a5a14610239578063c87b56dd14610230578063ca9c0bad14610227578063cc26f3d21461021e578063d6e18b3e14610215578063dbed85581461020c578063dc87599714610203578063e0aa90a4146101fa578063e985e9c5146101f1578063f2fde38b146101e85763f5fe3526146101e057600080fd5b61000e611ca2565b5061000e611c0b565b5061000e611bad565b5061000e611b30565b5061000e611adc565b5061000e611ab1565b5061000e611a92565b5061000e611922565b5061000e61189d565b5061000e611844565b5061000e6117e4565b5061000e61176b565b5061000e6115db565b5061000e611564565b5061000e61146e565b5061000e6113c8565b5061000e61139e565b5061000e61133f565b5061000e611320565b5061000e611289565b5061000e61124e565b5061000e6111ec565b5061000e611149565b5061000e610f40565b5061000e610f21565b5061000e610db1565b5061000e610b79565b5061000e610add565b5061000e610ab3565b5061000e61099d565b5061000e610964565b5061000e610945565b5061000e610888565b5061000e61083f565b5061000e6107ec565b5061000e6106e5565b5061000e6105e2565b5061000e610585565b5061000e6104a1565b5061000e6103eb565b5061000e610362565b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e57602060043561038281610350565b63ffffffff60e01b1663152a902d60e11b81149081156103a8575b506040519015158152f35b6380ac58cd60e01b8114915081156103da575b81156103c9575b503861039d565b6301ffc9a760e01b149050386103c2565b635b5e139f60e01b811491506103bb565b503461000e57602036600319011261000e5760043560008181526002602052604090205461042d906001600160a01b031615155b6104276120f4565b90612120565b60005260166020526020604060002054604051908152f35b60005b8381106104585750506000910152565b8181015183820152602001610448565b9060209161048181518092818552858086019101610445565b601f01601f1916010190565b90602061049e928181520190610468565b90565b503461000e5760008060031936011261058257604051908080546104c481611fc6565b8085529160019180831690811561055857506001146104fe575b6104fa856104ee818703826116d8565b6040519182918261048d565b0390f35b80809450527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106105405750505081016020016104ee826104fa6104de565b80546020858701810191909152909301928101610525565b8695506104fa969350602092506104ee94915060ff191682840152151560051b82010192936104de565b80fd5b503461000e57602036600319011261000e5760206105a4600435612000565b6040516001600160a01b039091168152f35b600435906001600160a01b038216820361000e57565b602435906001600160a01b038216820361000e57565b503461000e57604036600319011261000e576105fc6105b6565b60243561060882613329565b61061181611f4e565b916001600160a01b03808416908216811461068c576106439361063e913314908115610645575b506133d7565b6124ef565b005b6001600160a01b03166000908152600560205260409020610686915061067f9033905b9060018060a01b0316600052602052604060002090565b5460ff1690565b38610638565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b8015150361000e57565b503461000e57606036600319011261000e576104fa6107566107056105b6565b602435610711816106db565b60135461074d906001600160a01b0390819081165b1661073a6107326128db565b821515612120565b3314908115610766575b5061042761290a565b604435916129fb565b6040519081529081906020820190565b600a54604051630f6266a760e01b8152306004820152336024820152925060209183916044918391166001600160a01b03165afa9081156107df575b6000916107b1575b5038610744565b6107d2915060203d81116107d8575b6107ca81836116d8565b81019061214c565b386107aa565b503d6107c0565b6107e7612161565b6107a2565b503461000e57600036600319011261000e5760206040516127108152f35b606090600319011261000e576001600160a01b0390600435828116810361000e5791602435908116810361000e579060443590565b503461000e576106436108513661080a565b91336001600160a01b0382160361087a575b61087561087084336134af565b613449565b6135f7565b61088333613329565b610863565b503461000e57604036600319011261000e5761271060243560043560005260086020526108b860406000206120b8565b80516001600160a01b03161561092e575b6108fd816001600160601b0360206104fa9401511693848102948186041490151715610921575b516001600160a01b031690565b604080516001600160a01b0390921682529390920460208301529091829190820190565b6109296120dd565b6108f0565b506104fa6108fd61093d612092565b9150506108c9565b503461000e57600036600319011261000e576020600b54604051908152f35b503461000e57600036600319011261000e576020600e546000198101908111610990575b604051908152f35b6109986120dd565b610988565b503461000e5760208060031936011261000e576109b86105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b03808316949293610a799392610a46929190610a129085816044818c5afa908115610aa6575b600091610a89575b5061042761216e565b16948560405191610a2283611677565b601183527047756172643a2073616d652076616c756560781b858401521415612120565b7247756172643a207a65726f206164647265737360681b60405191610a6a83611677565b60138352820152831515612120565b6001600160a01b03191617600a55005b610aa09150863d88116107d8576107ca81836116d8565b38610a09565b610aae612161565b610a01565b503461000e57600036600319011261000e5760206040516daaeb6d7670e522a718067333cd4e8152f35b503461000e57610b39610aef3661080a565b6001600160a01b0383163314159290919083610b6b575b60405193610b13856116a0565b60008552610b5d575b610b2961087084336134af565b610b348383836135f7565b6137d7565b15610b4057005b60405162461bcd60e51b815280610b596004820161370e565b0390fd5b610b6633613329565b610b1c565b610b7433613329565b610b06565b503461000e57604036600319011261000e5760043567ffffffffffffffff60243581811161000e573660238201121561000e57806004013591821161000e576024810190602483369201011161000e57600a54604051630f6266a760e01b81523060048201523360248201527f32ca4bd288f17c941679e795f9f3eb354b8c940b37c6d25a0b56d5017bc2355593610d5c9390926104ee92602092610d4e929091610c4a918590829060449082906001600160a01b03165afa908115610d78575b600091610d61575061042761216e565b600088815260026020526040902054610c6d906001600160a01b0316151561041f565b610ca3610c8c610c878a6000526015602052604060002090565b612d78565b848151910120610c9a612e1c565b1461042761312a565b610cdc610cd4610cd061067f610cba368a87611734565b8781519101206000526014602052604060002090565b1590565b610427613159565b610d10610d03610ced368885611734565b8581519101206000526014602052604060002090565b805460ff19166001179055565b610d2e8582610d298b6000526015602052604060002090565b6131e6565b610d36612e4f565b94610d48604051968795860190612e72565b916132bc565b03601f1981018352826116d8565b0390a2005b610aa09150853d87116107d8576107ca81836116d8565b610d80612161565b610c3a565b604435906001600160601b038216820361000e57565b602435906001600160601b038216820361000e57565b503461000e57606036600319011261000e57610dcb6105cc565b610dd3610d85565b600a54604051630f6266a760e01b81523060048201523360248201529192916001600160a01b0391610e2a9190602090829085168180604481015b03915afa908115610f14575b600091610efc575061042761216e565b610e416127106001600160601b03851611156132ca565b811615610eb757610e7961064392610e69610e5a6116fa565b6001600160a01b039094168452565b6001600160601b03166020830152565b610e8f6004356000526008602052604060002090565b815160209092015160a01b6001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606490fd5b610aa0915060203d81116107d8576107ca81836116d8565b610f1c612161565b610e1a565b503461000e57602036600319011261000e5760206105a4600435611f4e565b503461000e57602036600319011261000e576004356000818152600260205260409020546104fa9161075691610f80906001600160a01b0316151561041f565b610f8981611f4e565b610fa6610f946123b8565b6001600160a01b039283163314612120565b610fba826000526016602052604060002090565b546012549091906001600160a01b0316610fdd610fd6846122ee565b90836126dc565b929050600193610fff610fef826122ca565b6000526010602052604060002090565b546110be575b506000908415611033575050506000925b61101f81612411565b6000818152601660205260408120556127dd565b602061106860ff94611046600c546123e7565b85604051958680958194633ac13e5760e11b8352600483019190602083019252565b0393165af19182156110b1575b91611083575b501692611016565b6110a4915060203d81116110aa575b61109c81836116d8565b810190612402565b3861107b565b503d611092565b6110b9612161565b611075565b935061111b6111076110e26110d2876122ca565b600052600f602052604060002090565b546111016110f76110f2896122ca565b612240565b90549060031b1c90565b906123f5565b611113610fef876122ca565b5490846125b4565b938461100557611142610fef61113c611136610fef856122ca565b546122ca565b926122ca565b5538611005565b503461000e57602036600319011261000e576001600160a01b0361116b6105b6565b1680156111945760005260036020526104fa604060002054604051918291829190602083019252565b60405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608490fd5b503461000e576000806003193601126105825760065481906001600160a01b0381169061121a338314611eba565b6001600160a01b0319166006557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461000e57602036600319011261000e576001600160a01b036112706105b6565b1660005260186020526020604060002054604051908152f35b503461000e57602036600319011261000e576112a36105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b0392916112e0919060209082908616818060448101610e0e565b6112fd82601354921692836112f361219a565b9184161415612120565b6113106113086121c8565b831515612120565b6001600160a01b03191617601355005b503461000e57600036600319011261000e576020600d54604051908152f35b503461000e57602036600319011261000e57600a54604051630f6266a760e01b815230600482015233602482015261138a9160209082906001600160a01b0316818060448101610e0e565b600435600090815260086020526040812055005b503461000e57600036600319011261000e576006546040516001600160a01b039091168152602090f35b503461000e5760008060031936011261058257604051908060018054916113ee83611fc6565b808652928281169081156105585750600114611414576104fa856104ee818703826116d8565b92508083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8284106114565750505081016020016104ee826104fa6104de565b8054602085870181019190915290930192810161143b565b503461000e57604036600319011261000e576114886105b6565b602435611494816106db565b61149d82613329565b6001600160a01b0382169133831461151f57816114dc6114ed9233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b503461000e5760008060031936011261058257600a54604051630f6266a760e01b81523060048201523360248201526115c391602090829060449082906001600160a01b03165afa9081156115ce575b8391610efc575061042761216e565b806007558060095580f35b6115d6612161565b6115b4565b503461000e57602036600319011261000e576115f56105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b039291611632919060209082908616818060448101610e0e565b61164582601154921692836112f361219a565b6116506113086121c8565b6001600160a01b03191617601155005b50634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761169357604052565b61169b611660565b604052565b6020810190811067ffffffffffffffff82111761169357604052565b6060810190811067ffffffffffffffff82111761169357604052565b90601f8019910116810190811067ffffffffffffffff82111761169357604052565b6040519061170782611677565b565b60209067ffffffffffffffff8111611727575b601f01601f19160190565b61172f611660565b61171c565b92919261174082611709565b9161174e60405193846116d8565b82948184528183011161000e578281602093846000960137010152565b503461000e57608036600319011261000e576117856105b6565b61178d6105cc565b906044356064359267ffffffffffffffff841161000e573660238501121561000e576117c6610b39943690602481600401359101611734565b92336001600160a01b03821603610b5d57610b2961087084336134af565b503461000e57600036600319011261000e576000602060405161180681611677565b82815201526040805161181881611677565b6009546001600160601b039081602081831694858152019160601c168152835192835251166020820152f35b503461000e57602036600319011261000e576004356000818152600260205260409020546104fa9161188991611884906001600160a01b0316151561041f565b612f58565b604051918291602083526020830190610468565b503461000e57602036600319011261000e576118b76105b6565b600a54604051630f6266a760e01b81523060048201523360248201526001600160a01b0392916118f4919060209082908616818060448101610e0e565b61190782601254921692836112f361219a565b6119126113086121c8565b6001600160a01b03191617601255005b503461000e57606036600319011261000e576104fa611a676119426105b6565b600a54604051630f6266a760e01b815230600482015233602482810191909152611a4c929035916119869160209082906001600160a01b0316818060448101610e0e565b6119916107326121f8565b6119a1600d5415156104276129cf565b6000198101818111611a85575b600e541115611a78575b600e6000526119ee7fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fc82015415156104276129cf565b611a2f611a08611a036110f76110f2856122ca565b6122ca565b611a146110f2846122ca565b90919082549060031b600019811b9283911b16911916179055565b611a42611a3d600d546122ca565b600d55565b6044359083612b32565b91829160018060a01b03166000526018602052604060002090565b556040519081529081906020820190565b611a80612229565b6119b8565b611a8d6120dd565b6119ae565b503461000e57600036600319011261000e576020600c54604051908152f35b503461000e57602036600319011261000e576040611ad06004356122ee565b82519182526020820152f35b503461000e57602036600319011261000e576104fa611b1e600435611b00816106db565b601354611b19906001600160a01b039081908116610726565b612ccd565b60405190151581529081906020820190565b503461000e57602036600319011261000e57600a54604051630f6266a760e01b8152306004828101919091523360248301523591611b82919060209082906001600160a01b0316818060448101610e0e565b80600c557f4f441af7cfd7ca1e0f18c1dae2f9a5401c997fd7f7ff246b6c89b67312302c6b600080a2005b503461000e57604036600319011261000e57602060ff611bff611bce6105b6565b611bd66105cc565b6001600160a01b0391821660009081526005865260408082209290931681526020919091522090565b54166040519015158152f35b503461000e57602036600319011261000e57611c256105b6565b6006546001600160a01b0390611c3e9082163314611eba565b811615611c4e5761064390611f05565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b503461000e57606036600319011261000e57611cbc6105b6565b611cc4610d9b565b611ccc610d85565b600a54604051630f6266a760e01b81523060048201523360248201526020946001600160a01b0394929091611d20918790829060449082908a165afa908115611ead575b600091611e96575061042761216e565b6001600160601b0393611d486127108686168786160196808811611e89575b871611156132ca565b8116938415611e445794611dc0611e2192611d997fb8e5032b0e405c7f726d44adcae73cc1939b1c7988441ea33922a7723d3345b59798611d8a610e5a6116fa565b6001600160601b031682850152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600755565b611de984611dcc6116fa565b6001600160601b0386168152928301906001600160601b03169052565b6001600160601b038151166009549160206001600160601b0360601b91015160601b169167ffffffffffffffff60c01b161717600955565b604080516001600160601b03928316815292909116602083015281908101610d5c565b60405162461bcd60e51b815260048101879052601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b611e916120dd565b611d3f565b610aa09150873d89116107d8576107ca81836116d8565b611eb5612161565b611d10565b15611ec157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600680546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b6000908152600260205260409020546001600160a01b03168015611f6f5790565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608490fd5b90600182811c92168015611ff6575b6020831014611fe057565b634e487b7160e01b600052602260045260246000fd5b91607f1691611fd5565b6000818152600260205260409020546001600160a01b031615612038576000908152600460205260409020546001600160a01b031690565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b6040519061209f82611677565b6007546001600160a01b038116835260a01c6020830152565b906040516120c581611677565b91546001600160a01b038116835260a01c6020830152565b50634e487b7160e01b600052601160045260246000fd5b6040519061210182611677565b601082526f141bdd1a5bdb8e881ddc9bdb99c81a5960821b6020830152565b156121285750565b60405162461bcd60e51b815260206004820152908190610b59906024830190610468565b9081602091031261000e575161049e816106db565b506040513d6000823e3d90fd5b6040519061217b82611677565b601082526f47756172643a204e6f2072696768747360801b6020830152565b604051906121a782611677565b6012825271506f74696f6e3a2073616d652076616c756560701b6020830152565b604051906121d582611677565b6014825273506f74696f6e3a207a65726f206164647265737360601b6020830152565b6040519061220582611677565b6015825274141bdd1a5bdb8e881b9bc81e995c9bc81b195d995b605a1b6020830152565b50634e487b7160e01b600052603260045260246000fd5b600e54811015612278575b600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0190600090565b612280612229565b61224b565b6017548110156122bd575b60176000527fc624b66cc0138b8fabc209247f72d758e1cf3343756d543badbf24212bed8c150190600090565b6122c5612229565b612290565b6000198101919082116122d957565b6117076120dd565b919082039182116122d957565b906122fa6113086121f8565b60175461233560405161230c81611677565b6013815272141bdd1a5bdb8e881ddc9bdb99c81b195d995b606a1b602082015282851115612120565b60018314612375575061049e6110f761236861235b600119860186811161236d57612285565b90549060031b1c946122ca565b612285565b6123686120dd565b909150156123ab575b60176000527fc624b66cc0138b8fabc209247f72d758e1cf3343756d543badbf24212bed8c155461032091565b6123b3612229565b61237e565b604051906123c582611677565b60138252722837ba34b7b71d103bb937b7339037bbb732b960691b6020830152565b90600182018092116122d957565b919082018092116122d957565b9081602091031261000e575190565b61241a81611f4e565b6124238261249b565b6001600160a01b03166000818152600360205260408120805491929160001981019190821161248e575b5582825260026020526040822080546001600160a01b03191690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4565b6124966120dd565b61244d565b600081815260046020526040812080546001600160a01b03191690556001600160a01b036124c883611f4e565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258280a4565b600082815260046020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b038061252884611f4e565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b604090805160011015612564570190565b61256c612229565b0190565b9060609160408101918152602092816040858094015285518094520193019160005b8281106125a0575050505090565b835185529381019392810192600101612592565b9161261292602092604051926125c9846116bc565b60028452848401604036823781830390838211612665575b855115612658575b526125f384612553565b52600060405180968195829463116cc47f60e21b845260048401612570565b03926001600160a01b03165af190811561264b575b60009161263357501590565b610cd0915060203d81116110aa5761109c81836116d8565b612653612161565b612627565b612660612229565b6125e9565b61266d6120dd565b6125e1565b6040519061014080830183811067ffffffffffffffff821117612698575b604052368337565b6126a0611660565b612690565b60019060001981146126b5570190565b61256c6120dd565b90600a8110156126cf575b60051b0190565b6126d7612229565b6126c8565b9291926126e7612672565b506126fa826126f4612672565b956122e1565b60009283925b600a841061271057505050509190565b909192936127a56127ab9161278d61277a6127738761274f604051633ac13e5760e11b81528b818b816000816020978896600483019190602083019252565b03926001600160a01b03165af19182156127d0575b6000926127b3575b50506123f5565b61ffff1690565b612784898c6126bd565b9061ffff169052565b61110161277361279d898c6126bd565b5161ffff1690565b946126a5565b929190612700565b6127c99250803d106110aa5761109c81836116d8565b388061276c565b6127d8612161565b612764565b929060018060a01b036011541691604051938492630610bbd160e11b845286600485015233602485015260448401906000915b600a83106128be575050506000602094612852610224948694151561018486015261283f6101a4860160019052565b6101c4850184905260ff166101e4850152565b60016102048401525af180156128b1575b612893575b5080337fc4b27f09c64550fd678a5b3c3a00f454814732e346e0f1c79d0add8f980346de600080a390565b6128aa9060203d81116110aa5761109c81836116d8565b5038612868565b6128b9612161565b612863565b815161ffff16815287955060019092019160209182019101612810565b604051906128e882611677565b6013825272141bdd1a5bdb8e88189bde081b9bdd081cd95d606a1b6020830152565b6040519061291782611677565b60128252710a0dee8d2dedce674409cdee840c240c4def60731b6020830152565b604081019181526060602091604083820152600e548094520191600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd916000905b82821061298b575050505090565b83548552938401936001938401939091019061297d565b604051906129af82611677565b60118252702837ba34b7b71d103a393c9030b3b0b4b760791b6020830152565b604051906129dc82611677565b601082526f141bdd1a5bdb8e881cdbdb19081bdd5d60821b6020830152565b61049e9291612a0b600e546122ca565b9015612a6c575b80612a2f612a256110f7612a6694612240565b15156104276129cf565b612a4c612a4682600052600f602052604060002090565b546123e7565b612a6082600052600f602052604060002090565b556123e7565b90612b32565b50612a6660006020612ab6612a97612a8b60125460018060a01b031690565b6001600160a01b031690565b600d5460405194858094819363116cc47f60e21b835260048301612938565b03925af1908115612b25575b600091612b07575b50612b0081612ae8612ade6110f783612240565b15156104276129a2565b611a14612afa611a036110f784612240565b91612240565b9050612a12565b612b1f915060203d81116110aa5761109c81836116d8565b38612aca565b612b2d612161565b612ac2565b612b3d6113086121f8565b600b805460010190556000838152601660205260408120839055906001600160a01b038116908115612c3d578492612c117f95b18bbe5373dcbe675d3ab2ae6e3888392575c51b8b8c9c3cbbdb431af1929992612bba612bb5610cd088600052600260205260018060a01b0360406000205416151590565b612c81565b6001600160a01b0381166000908152600360205260409020612bdc81546123e7565b9055612bf2866000526002602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b8383827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a480a490565b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b15612c8857565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b600d5415612d5857612ced575b612ce5600d546122ca565b600d55600190565b600e547fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fc600019820191808311612d6b575b80831015612d5e575b600e600052015415612d585780611a14612afa612d47612d5394612240565b90549060031b1c6122ca565b612cda565b50600090565b612d66612229565b612d28565b612d736120dd565b612d1f565b9060405191826000825492612d8c84611fc6565b908184526001948581169081600014612df95750600114612db6575b5050611707925003836116d8565b9093915060005260209081600020936000915b818310612de157505061170793508201013880612da8565b85548884018501529485019487945091830191612dc9565b91505061170794506020925060ff191682840152151560051b8201013880612da8565b6000604051612e2a816116a0565b527fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b60405190612e5c82611677565b6007825266697066733a2f2f60c81b6020830152565b9061256c60209282815194859201610445565b600092918154612e9481611fc6565b92600191808316908115612eed5750600114612eb1575b50505050565b90919293945060005260209081600020906000915b858310612edc5750505050019038808080612eab565b805485840152918301918101612ec6565b60ff1916845250505081151590910201915038808080612eab565b60405190612f15826116bc565b602e82526d2d1a2a232aa233b3a3a1229b343160911b6040837f516d5a3962435452424e7767796875615836503758666d38443163376a63554d60208201520152565b612f6c816000526016602052604060002090565b5490612f85610c87826000526015602052604060002090565b60208151910120612f94612e1c565b03613004575061049e612fd891610d4e612fee612faf612e4f565b92612fd8612fde612fc7612fc1612f08565b93613061565b926040519889976020890190612e72565b90612e72565b632f706f2f60e01b815260040190565b6917b6b2ba30973539b7b760b11b8152600a0190565b61303c915061049e90610d4e61302c61301b612e4f565b926000526015602052604060002090565b6040519485936020850190612e72565b90612e85565b90602091805182101561305457010190565b61305c612229565b010190565b801561310c57806000908282935b6130f8575061307d83611709565b9261308b60405194856116d8565b80845281601f1961309b83611709565b013660208701375b6130ad5750505090565b6130b6906122ca565b90600a90603082820681018091116130eb575b60f81b6001600160f81b031916841a6130e28487613042565b530490816130a3565b6130f36120dd565b6130c9565b92613104600a916126a5565b93048061306f565b5060405161311981611677565b60018152600360fc1b602082015290565b6040519061313782611677565b6013825272141bdd1a5bdb8e88185b1c9958591e481cd95d606a1b6020830152565b6040519061316682611677565b601982527f506f74696f6e3a206d65746120616c72656164792075736564000000000000006020830152565b90601f81116131a057505050565b600091825260208220906020601f850160051c830194106131dc575b601f0160051c01915b8281106131d157505050565b8181556001016131c5565b90925082906131bc565b90929167ffffffffffffffff81116132af575b61320d816132078454611fc6565b84613192565b6000601f8211600114613247578192939460009261323c575b50508160011b916000199060031b1c1916179055565b013590503880613226565b601f1982169461325c84600052602060002090565b91805b87811061329757508360019596971061327d575b505050811b019055565b0135600019600384901b60f8161c19169055388080613273565b9092602060018192868601358155019401910161325f565b6132b7611660565b6131f9565b908092918237016000815290565b156132d157565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b6daaeb6d7670e522a718067333cd4e803b613342575050565b604051633185c44d60e21b81523060048201526001600160a01b038316602482015290602090829060449082905afa9081156133ca575b6000916133ac575b501561338a5750565b604051633b79c77360e21b81526001600160a01b039091166004820152602490fd5b6133c4915060203d81116107d8576107ca81836116d8565b38613381565b6133d2612161565b613379565b156133de57565b60405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608490fd5b1561345057565b60405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608490fd5b6000828152600260205260409020546001600160a01b031615613545576134d582611f4e565b9160018060a01b0390818316928285168414948515613514575b505083156134fe575b50505090565b61350a91929350612000565b16143880806134f8565b6001600160a01b0316600090815260056020526040902091945060ff9161353b9190610668565b54169238806134ef565b60405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608490fd5b156135a657565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9061360183611f4e565b6001600160a01b0383811692909182168390036136bb576136506136949282169461362d86151561359f565b6136368761249b565b6001600160a01b0316600090815260036020526040902090565b61365a81546122ca565b90556001600160a01b038116600090815260036020526040902061367e81546123e7565b9055612bf2856000526002602052604060002090565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b9081602091031261000e575161049e81610350565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261049e92910190610468565b3d156137d2573d906137b882611709565b916137c660405193846116d8565b82523d6000602084013e565b606090565b92909190823b156138915761380a926020926000604051809681958294630a85bd0160e11b9a8b85523360048601613776565b03926001600160a01b03165af160009181613861575b506138535761382d6137a7565b8051908161384e5760405162461bcd60e51b815280610b596004820161370e565b602001fd5b6001600160e01b0319161490565b61388391925060203d811161388a575b61387b81836116d8565b810190613761565b9038613820565b503d613871565b5050505060019056fea264697066735822122000855a3cc2b78c5871beaa9861e285721195ad09b4dea30d3118ccf11e43a25064736f6c63430008110033