ETH Price: $3,408.13 (-0.87%)
Gas: 6 Gwei

Contract

0xf700013344D33A24C5d7907969B84CBa9C6468f0
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint Pro156633442022-10-02 22:07:11653 days ago1664748431IN
0xf7000133...a9C6468f0
0.11 ETH0.000157375.5
Mint Pro156633402022-10-02 22:06:23653 days ago1664748383IN
0xf7000133...a9C6468f0
0.11 ETH0.000210557.35841939
Mint Pro156633392022-10-02 22:06:11653 days ago1664748371IN
0xf7000133...a9C6468f0
0.11 ETH0.000260737.1598301
Mint Pro156633392022-10-02 22:06:11653 days ago1664748371IN
0xf7000133...a9C6468f0
0.11 ETH0.000260737.1598301
Mint Pro156633392022-10-02 22:06:11653 days ago1664748371IN
0xf7000133...a9C6468f0
0.11 ETH0.000260737.1598301
Mint Pro156633392022-10-02 22:06:11653 days ago1664748371IN
0xf7000133...a9C6468f0
0.11 ETH0.000278847.6598301
Mint Pro156633392022-10-02 22:06:11653 days ago1664748371IN
0xf7000133...a9C6468f0
0.11 ETH0.000282137.75
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.000266567.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.000266567.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.000266567.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.000266567.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.000266567.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.000266487.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.001344297.32010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.001436027.82010632
Mint Pro156633382022-10-02 22:05:59653 days ago1664748359IN
0xf7000133...a9C6468f0
0.11 ETH0.001703467.82010632
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.001326687.2247098
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.001326777.2247098
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.001573857.2247098
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.001326777.2247098
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.001573857.2247098
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.00151958.2747098
Mint Pro156633372022-10-02 22:05:47653 days ago1664748347IN
0xf7000133...a9C6468f0
0.11 ETH0.001602248.7247098
Mint Pro156633362022-10-02 22:05:35653 days ago1664748335IN
0xf7000133...a9C6468f0
0.11 ETH0.001319577.18550394
Mint Pro156633352022-10-02 22:05:23653 days ago1664748323IN
0xf7000133...a9C6468f0
0.11 ETH0.001684027.73042365
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
156635022022-10-02 22:38:47653 days ago1664750327
0xf7000133...a9C6468f0
622.71 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MinterPro

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 16 : MinterPro.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.15;

import "./interfaces/IMinterPro.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./interfaces/ICharacter.sol";
import "./interfaces/IBag.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

import "./helpers/Errors.sol";
import "./helpers/Permissions.sol";

/**
 * @dev ASM The Next Legends - Minter Pro contract
 * @notice
 */
contract MinterPro is IMinterPro, Errors, AccessControl, ReentrancyGuard, Pausable {
    using ECDSA for bytes32;

    address private _signer;
    address private _manager; // ASM Owned multisig contract, used for maintenance
    address private _multisig; // another ASM Owned multisig contract, used for withdrawing ETHs

    ICharacter public char_;
    IBag public bag_;

    uint256 constant proMaxSupply = 5661;
    uint256 public mintingEthCost;

    event Minted(address indexed to, bytes32 hashId, uint256 charId, uint256 bagId);
    event ContractUpgraded(uint256 timestamp, string indexed contractName, address oldAddress, address newAddress);
    event SignerUpdated(address indexed manager, address newSigner);
    event Withdraw(address indexed manager, address to, uint256 amount);

    constructor(
        address manager,
        address multisig,
        address signer,
        address character,
        address bag
    ) {
        if (manager == address(0)) revert InvalidInput(INVALID_MANAGER);
        if (multisig == address(0)) revert InvalidInput(INVALID_MULTISIG);
        if (signer == address(0)) revert InvalidInput(INVALID_SIGNER);
        if (character == address(0)) revert InvalidInput(WRONG_CHARACTER_CONTRACT);

        _manager = manager;
        _multisig = multisig;
        _signer = signer;

        _grantRole(MANAGER_ROLE, manager);
        _grantRole(MULTISIG_ROLE, multisig);

        char_ = ICharacter(character);
        bag_ = IBag(bag);

        if (!char_.supportsInterface(type(ICharacter).interfaceId)) revert UpgradeError(WRONG_CHARACTER_CONTRACT);
        if (!bag_.supportsInterface(type(IBag).interfaceId)) revert UpgradeError(WRONG_BAG_CONTRACT);

        _pause();
    }

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

    /** ----------------------------------
     * ! Minting functions
     * ----------------------------------- */

    /**
     * @notice Minting a new character or asset
     * @dev This function can only be called inside the contract
     * @param to to which address to mint a new token
     * @param expiry timestamp (in seconds) when token expires (user can mint before that time only)
     * @param hashId user identificator, used to match user's allowance to mint with minted token.
     * @param signature Signed hash to prove the right to mint. Generated by ASM, stored in DDB, returned from Dapp. Can only be used once.
     */
    function mintPro(
        address to,
        bytes calldata signature,
        bytes32 hashId,
        uint256 expiry
    ) external payable whenPaid(msg.value) whenNotExpired(expiry) nonZeroAddress(to) whenNotPaused {
        // this check assumes that Pro Chars minted before normal characters,
        // and thus first 5661 of chars will be Pros.
        if ((char_.totalSupply() + 1) > proMaxSupply) revert MintingError(TOTAL_SUPPLY_EXCEEDED, 0);

        if (!validateSignature(to, hashId, expiry, signature)) revert InvalidInput(INVALID_SIGNATURE);

        uint256 charId = char_.mint(to, hashId);
        uint256 bagId = bag_.mint(to);

        emit Minted(to, hashId, charId, bagId);
    }

    /** ----------------------------------
     * ! Signature validating functions
     * ----------------------------------- */

    /**
     * @notice To validate the `signature` is signed by the _signer
     * @param addr User wallet address
     * @param nonce Character hashId
     * @param expiry timestamp when token expires (user can mint before that time only)
     * @param signature The signature passed from the caller
     * @return Validation result
     */
    function validateSignature(
        address addr,
        bytes32 nonce,
        uint256 expiry,
        bytes calldata signature
    ) public view returns (bool) {
        bytes32 messageHash = _hash(addr, nonce, expiry);
        bytes32 ethSignedMessageHash = _getEthSignedMessageHash(messageHash);
        return _verify(ethSignedMessageHash, signature);
    }

    /**
     * @notice Encode arguments to generate a hash, which will be used for validating signatures
     * @dev This function can only be called inside the contract
     * @param addr The user wallet address, to verify the signature can only be used by the wallet
     * @param nonce Character hashId
     * @param expiry timestamp when token expires
     * @return Encoded hash
     */
    function _hash(
        address addr,
        bytes32 nonce,
        uint256 expiry
    ) internal pure returns (bytes32) {
        return keccak256(abi.encode(addr, Strings.toHexString(uint256(nonce), 32), expiry));
    }

    /**
     * @notice Prefixing a hash with "\x19Ethereum Signed Message\n", which required for recovering signer
     * @dev This function can only be called inside the contract
     * @param _messageHash hash that need to be prefixed
     * @return Prefixed hash
     */
    function _getEthSignedMessageHash(bytes32 _messageHash) private pure returns (bytes32) {
        /*
        Signature is produced by signing a keccak256 hash with the following format:
        "\x19Ethereum Signed Message\n" + len(msg) + msg
        */
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _messageHash));
    }

    /**
     * @notice To verify the `token` is signed by the _signer
     * @dev This function can only be called inside the contract
     * @param ethSignedMessageHash The encoded hash used for signature
     * @param signature The signature passed from the caller
     * @return Verification result
     */
    function _verify(bytes32 ethSignedMessageHash, bytes memory signature) internal view returns (bool) {
        address signer_ = _recoverSigner(ethSignedMessageHash, signature);
        return (signer_ == _signer && signer_ != address(0));
    }

    /**
     * @notice Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     * @dev This function can only be called inside the contract
     * @param ethSignedMessageHash The encoded hash used for signature
     * @param signature The signature passed from the caller
     * @return The recovered address
     */
    function _recoverSigner(bytes32 ethSignedMessageHash, bytes memory signature) private pure returns (address) {
        (bytes32 r, bytes32 s, uint8 v) = _splitSignature(signature);
        return ecrecover(ethSignedMessageHash, v, r, s);
    }

    /**
     * @notice Extracting R, S, V components from the signature
     * @dev This function can only be called inside the contract
     * @param sig The signature to extract r,s,v from
     */
    function _splitSignature(bytes memory sig)
        private
        pure
        returns (
            bytes32 r,
            bytes32 s,
            uint8 v
        )
    {
        require(sig.length == 65, "invalid signature length");

        assembly {
            /*
            First 32 bytes stores the length of the signature

            add(sig, 32) = pointer of sig + 32
            effectively, skips first 32 bytes of signature

            mload(p) loads next 32 bytes starting at the memory address p into memory
            */

            // first 32 bytes, after the length prefix
            r := mload(add(sig, 32))
            // second 32 bytes
            s := mload(add(sig, 64))
            // final byte (first byte of the next 32 bytes)
            v := byte(0, mload(add(sig, 96)))
        }
        // implicitly return (r, s, v)
    }

    /** ----------------------------------
     * ! Manager functions      | UPGRADES
     * ----------------------------------- */

    /**
     * @notice Upgrade Unpacker contract address
     * @dev This function can only be called from contracts or wallets with MANAGER_ROLE
     * @param newContract Address of the new contract
     */
    function upgradeCharacterContract(address newContract) external onlyRole(MANAGER_ROLE) {
        if (newContract == address(0)) revert InvalidInput(INVALID_ADDRESS);

        address oldContract = address(char_);
        char_ = ICharacter(newContract);
        if (!char_.supportsInterface(type(ICharacter).interfaceId)) revert UpgradeError(WRONG_CHARACTER_CONTRACT);

        emit ContractUpgraded(block.timestamp, "Character.sol", oldContract, newContract);
    }

    /**
     * @notice Upgrade Bag contract address
     * @dev This function can only be called from contracts or wallets with MANAGER_ROLE
     * @param newContract Address of the new contract
     */
    function upgradeBagContract(address newContract) external onlyRole(MANAGER_ROLE) {
        if (newContract == address(0)) revert InvalidInput(INVALID_ADDRESS);

        address oldContract = address(bag_);
        bag_ = IBag(newContract);
        if (!bag_.supportsInterface(type(IBag).interfaceId)) revert UpgradeError(WRONG_BAG_CONTRACT);

        emit ContractUpgraded(block.timestamp, "Bag.sol", oldContract, newContract);
    }

    /** ----------------------------------
     * ! Admin functions
     * ----------------------------------- */

    /**
     * @notice Set manager address (contract or wallet) to manage this contract
     * @dev This function can only to called from contracts or wallets with MANAGER_ROLE
     * @dev The old manager will be removed
     * @param newManager The new manager address to be granted
     */
    function setManager(address newManager) external onlyRole(MANAGER_ROLE) {
        if (newManager == address(0)) revert InvalidInput(INVALID_ADDRESS);
        _revokeRole(MANAGER_ROLE, _manager);
        _grantRole(MANAGER_ROLE, newManager);
        _manager = newManager;
    }

    /**
     * @notice Set Multisig address (multisig wallet) to perform withdraw
     * @dev This function can only to called from contracts with MULTISIG_ROLE
     * @dev The old manager will be removed
     * @param _newMultisig The new manager address to be granted
     */
    function setMultisig(address _newMultisig) external onlyRole(MULTISIG_ROLE) {
        if (_newMultisig == address(0)) revert InvalidInput(INVALID_ADDRESS);
        _revokeRole(MULTISIG_ROLE, _multisig);
        _grantRole(MULTISIG_ROLE, _newMultisig);
        _multisig = _newMultisig;
    }

    /**
     * @notice Update signer
     * @dev This function can only to called from contracts or wallets with MANAGER_ROLE
     * @param newSigner The new signer address to update
     */
    function setSigner(address newSigner) external onlyRole(MANAGER_ROLE) {
        if (newSigner == address(0)) revert InvalidInput(INVALID_SIGNER);
        _signer = newSigner;
        emit SignerUpdated(msg.sender, newSigner);
    }

    function getSigner() public view returns (address) {
        return _signer;
    }

    /**
     * @notice Set the price to mint
     * @dev only MANAGER_ROLE can call this function
     * @param cost New price
     */
    function setMintingEthCost(uint256 cost) external onlyRole(MANAGER_ROLE) {
        mintingEthCost = cost;
    }

    /**
     * @notice Pause the minting process
     */
    function pause() external onlyRole(MANAGER_ROLE) {
        _pause();
    }

    /**
     * @notice Pause the minting process
     */
    function unpause() external onlyRole(MANAGER_ROLE) {
        _unpause();
    }

    /**
     * @notice Withdraw ETH from the contract to specified address
     * @dev only MULTISIG_ROLE can call this function
     * @param amount Token amount to withdraw
     * @param to recipient of the transfer
     */
    function withdrawEth(uint256 amount, address payable to) external onlyRole(MULTISIG_ROLE) {
        if (amount == 0) revert InvalidInput(INVALID_AMOUNT);
        if (to == address(0)) revert InvalidInput(INVALID_ADDRESS);
        (bool sent, ) = to.call{value: amount}("");
        if (!sent) revert ManagementError(CANT_SEND);
    }

    /** ----------------------------------
     * ! Modifiers
     * ----------------------------------- */

    modifier whenPaid(uint256 receivedAmount) {
        uint256 requiredAmount = mintingEthCost;
        if (receivedAmount < requiredAmount) revert PaymentError(NO_PAYMENT_RECEIVED, requiredAmount, receivedAmount);
        else _;
    }

    modifier whenNotExpired(uint256 expiry) {
        if (block.timestamp > expiry) revert MintingError(MINT_EXPIRED, expiry);
        else _;
    }

    modifier nonZeroAddress(address addr) {
        if (addr == address(0)) revert InvalidInput(INVALID_ADDRESS);
        else _;
    }
}

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

pragma solidity ^0.8.0;

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

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

File 3 of 16 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 4 of 16 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

File 5 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 6 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

File 8 of 16 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // 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);
    }

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

File 9 of 16 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 12 of 16 : Errors.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.15;

/**
 * @dev ASM The Next Legends - Error definition contract
 */
contract Errors {
    error InvalidInput(string errMsg);
    string constant INVALID_MULTISIG = "Invalid Multisig contract";
    string constant INVALID_MANAGER = "Invalid Manager contract";
    string constant INVALID_SIGNER = "Invalid signer address";
    string constant INVALID_MINTER = "Invalid Minter contract";
    string constant INVALID_SIGNATURE = "Invalid signature";
    string constant INVALID_CURRENCY = "Invalid currency";
    string constant INVALID_ADDRESS = "Invalid wallet address";
    string constant INVALID_AMOUNT = "Invalid amount";

    error UpgradeError(string errMsg);
    string constant WRONG_CHARACTER_CONTRACT = "Wrong character contract";
    string constant WRONG_BAG_CONTRACT = "Wrong bag contract";
    string constant WRONG_UNPACKER_CONTRACT = "Wrong unpacker contract";
    string constant WRONG_MINTER_CONTRACT = "Wrong minter contract";
    string constant WRONG_ASSET_CONTRACT = "Wrong asset contract";
    string constant WRONG_PAYMENT_CONTRACT = "Wrong payment contract";
    string constant WRONG_ASTO_CONTRACT = "Wrong ASTO contract";
    string constant WRONG_LP_CONTRACT = "Wrong LP contract";

    error AccessError(string errMsg);
    string constant WRONG_TOKEN_ID = "Wrong token ID";
    string constant WRONG_TOKEN_OWNER = "Wrong token owner";
    string constant WRONG_HASH = "Wrong hash";
    string constant NOT_ASSIGNED = "Address not assigned";

    error PaymentError(string errMsg, uint256 requiredAmount, uint256 receivedAmount);
    string constant INSUFFICIENT_BALANCE = "Insufficient balance";
    string constant NO_PAYMENT_RECEIVED = "No payment received";
    string constant NO_PAYMENT_RECOGNIZED = "MintType/Currency not recognized";
    string constant CURRENCY_DOES_NOT_SUIT_TYPE = "Currency doesn't suit type";
    string constant MINT_TYPE_IS_NOT_SUPPORTED = "MintType isn't supported";

    error MintingError(string errMsg, uint256 expiry);
    error OpenError(string errMsg);
    string constant MINT_EXPIRED = "Mint hash has expired";
    string constant TOKEN_ALREADY_MINTED = "Token has already minted";
    string constant NOT_ALLOWED = "Currently is not allowed";
    string constant TOTAL_SUPPLY_EXCEEDED = "Total supply exceeded";

    error ManagementError(string errMsg);
    string constant CANT_SEND = "Failed to send Ether";
}

File 13 of 16 : Permissions.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.15;

/**
 * @dev ASM The Next Legends - Roles
 */

bytes32 constant MULTISIG_ROLE = keccak256("MULTISIG_ROLE");
bytes32 constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
bytes32 constant MINTER_ROLE = keccak256("MINTER_ROLE");

File 14 of 16 : IBag.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.15;

interface IBag {
    function mint(address) external returns (uint256);

    function open(uint256, address) external;

    function allowToOpen(bool newState) external;

    function burn(uint256) external;

    function upgradeUnpackerContract(address) external;

    function setBaseURI(string calldata) external;

    function totalSupply() external returns (uint256);

    function supportsInterface(bytes4 interfaceId) external returns (bool);
}

File 15 of 16 : ICharacter.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.15;

interface ICharacter {
    function mint(address, bytes32) external returns (uint256);

    function setBaseURI(string calldata) external;

    function totalSupply() external returns (uint256);

    function supportsInterface(bytes4 interfaceId) external returns (bool);
}

File 16 of 16 : IMinterPro.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.15;

interface IMinterPro {
    function mintPro(
        address to,
        bytes calldata signature,
        bytes32 hashId,
        uint256 expiry
    ) external payable;

    function setMintingEthCost(uint256 cost) external;

    function withdrawEth(uint256 amount, address payable to) external;

    function upgradeBagContract(address) external;

    function upgradeCharacterContract(address) external;

    function setManager(address) external;

    function setMultisig(address) external;

    function setSigner(address) external;

    function supportsInterface(bytes4 interfaceId) external returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"multisig","type":"address"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"character","type":"address"},{"internalType":"address","name":"bag","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"AccessError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"InvalidInput","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"ManagementError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"MintingError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"OpenError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256","name":"receivedAmount","type":"uint256"}],"name":"PaymentError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"UpgradeError","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":true,"internalType":"string","name":"contractName","type":"string"},{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"ContractUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes32","name":"hashId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"charId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bagId","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"manager","type":"address"},{"indexed":false,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"manager","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bag_","outputs":[{"internalType":"contract IBag","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"char_","outputs":[{"internalType":"contract ICharacter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes32","name":"hashId","type":"bytes32"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"mintPro","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintingEthCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newManager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"setMintingEthCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMultisig","type":"address"}],"name":"setMultisig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newContract","type":"address"}],"name":"upgradeBagContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newContract","type":"address"}],"name":"upgradeCharacterContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"validateSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"}],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200210838038062002108833981016040819052620000349162000587565b600180556002805460ff191690556001600160a01b038516620000a857604080518082018252601881527f496e76616c6964204d616e6167657220636f6e747261637400000000000000006020820152905163d647364f60e01b81526200009f9190600401620005f7565b60405180910390fd5b6001600160a01b0384166200010557604080518082018252601981527f496e76616c6964204d756c746973696720636f6e7472616374000000000000006020820152905163d647364f60e01b81526200009f9190600401620005f7565b6001600160a01b0383166200016257604080518082018252601681527f496e76616c6964207369676e65722061646472657373000000000000000000006020820152905163d647364f60e01b81526200009f9190600401620005f7565b6001600160a01b038216620001bf57604080518082018252601881527f57726f6e672063686172616374657220636f6e747261637400000000000000006020820152905163d647364f60e01b81526200009f9190600401620005f7565b600380546001600160a01b038088166001600160a01b0319928316179092556004805487841692169190911790556002805491851661010002610100600160a81b0319909216919091179055620002377f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b088662000422565b620002637fa5a0b70b385ff7611cd3840916bd08b10829e5bf9e6637cf79dd9a427fc0e2ab8562000422565b600580546001600160a01b038481166001600160a01b0319928316811790935560068054918516919092161790556040516301ffc9a760e01b815263183b3c3360e21b60048201526301ffc9a7906024016020604051808303816000875af1158015620002d4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002fa91906200064f565b6200034d57604080518082018252601881527f57726f6e672063686172616374657220636f6e7472616374000000000000000060208201529051632b79e12f60e11b81526200009f9190600401620005f7565b6006546040516301ffc9a760e01b81526330076fd760e21b60048201526001600160a01b03909116906301ffc9a7906024016020604051808303816000875af11580156200039f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003c591906200064f565b6200040d57604080518082018252601281527115dc9bdb99c8189859c818dbdb9d1c9858dd60721b60208201529051632b79e12f60e11b81526200009f9190600401620005f7565b62000417620004c3565b50505050506200067a565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620004bf576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200047e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b620004cd62000520565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620005033390565b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff1615620005685760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016200009f565b565b80516001600160a01b03811681146200058257600080fd5b919050565b600080600080600060a08688031215620005a057600080fd5b620005ab866200056a565b9450620005bb602087016200056a565b9350620005cb604087016200056a565b9250620005db606087016200056a565b9150620005eb608087016200056a565b90509295509295909350565b600060208083528351808285015260005b81811015620006265785810183015185820160400152820162000608565b8181111562000639576000604083870101525b50601f01601f1916929092016040019392505050565b6000602082840312156200066257600080fd5b815180151581146200067357600080fd5b9392505050565b611a7e806200068a6000396000f3fe6080604052600436106101405760003560e01c80636c19e783116100b6578063a158657c1161006f578063a158657c14610380578063a217fddf146103a0578063d0ebdbe7146103b5578063d547741f146103d5578063f3283fba146103f5578063fe443ccb1461041557600080fd5b80636c19e783146102d55780636c5ef723146102f55780637ac3c02f146103085780638456cb591461032b57806391d14854146103405780639958ca471461036057600080fd5b80632f2ff15d116101085780632f2ff15d1461023257806336568abe14610252578063383c9830146102725780633f4ba83a1461029257806354909153146102a75780635c975abb146102bd57600080fd5b806301ffc9a7146101455780630f03b6ee1461017a5780630f3b7689146101b25780631cd00acb146101d4578063248a9ca3146101f4575b600080fd5b34801561015157600080fd5b50610165610160366004611603565b610435565b60405190151581526020015b60405180910390f35b34801561018657600080fd5b5060065461019a906001600160a01b031681565b6040516001600160a01b039091168152602001610171565b3480156101be57600080fd5b506101d26101cd36600461162d565b610487565b005b3480156101e057600080fd5b5060055461019a906001600160a01b031681565b34801561020057600080fd5b5061022461020f36600461162d565b60009081526020819052604090206001015490565b604051908152602001610171565b34801561023e57600080fd5b506101d261024d36600461165b565b6104a5565b34801561025e57600080fd5b506101d261026d36600461165b565b6104cf565b34801561027e57600080fd5b506101d261028d36600461168b565b610552565b34801561029e57600080fd5b506101d26106eb565b3480156102b357600080fd5b5061022460075481565b3480156102c957600080fd5b5060025460ff16610165565b3480156102e157600080fd5b506101d26102f036600461168b565b61070e565b6101d26103033660046116f1565b6107d8565b34801561031457600080fd5b5060025461010090046001600160a01b031661019a565b34801561033757600080fd5b506101d2610b2f565b34801561034c57600080fd5b5061016561035b36600461165b565b610b4f565b34801561036c57600080fd5b5061016561037b366004611758565b610b78565b34801561038c57600080fd5b506101d261039b36600461165b565b610c2f565b3480156103ac57600080fd5b50610224600081565b3480156103c157600080fd5b506101d26103d036600461168b565b610d78565b3480156103e157600080fd5b506101d26103f036600461165b565b610e38565b34801561040157600080fd5b506101d261041036600461168b565b610e5d565b34801561042157600080fd5b506101d261043036600461168b565b610f1d565b60006001600160e01b03198216631298229560e21b148061046657506001600160e01b031982166301ffc9a760e01b145b8061048157506001600160e01b0319821663da8def7360e01b145b92915050565b600080516020611a0983398151915261049f81611074565b50600755565b6000828152602081905260409020600101546104c081611074565b6104ca838361107e565b505050565b6001600160a01b03811633146105445760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61054e8282611102565b5050565b600080516020611a0983398151915261056a81611074565b6001600160a01b0382166105b25760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600680546001600160a01b038481166001600160a01b0319831681179093556040516301ffc9a760e01b81526330076fd760e21b6004820152911691906301ffc9a7906024016020604051808303816000875af1158015610617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063b919061182d565b61068057604080518082018252601281527115dc9bdb99c8189859c818dbdb9d1c9858dd60721b60208201529051632b79e12f60e11b815261053b919060040161181a565b60405166109859cb9cdbdb60ca1b81526007015b604080519182900382204283526001600160a01b038481166020850152861683830152905190917fe4d55c707519acf60c7217a3808567f013d2f024d787d1a9ef3004196219f680919081900360600190a2505050565b600080516020611a0983398151915261070381611074565b61070b611167565b50565b600080516020611a0983398151915261072681611074565b6001600160a01b038216610779576040805180820182526016815275496e76616c6964207369676e6572206164647265737360501b6020820152905163d647364f60e01b815261053b919060040161181a565b60028054610100600160a81b0319166101006001600160a01b0385169081029190911790915560405190815233907f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb9060200160405180910390a25050565b60075434908082101561082b576040805180820182526013815272139bc81c185e5b595b9d081c9958d95a5d9959606a1b6020820152905163010762d560e41b815261053b91908390859060040161184f565b828042111561087a576040805180820182526015815274135a5b9d081a185cda081a185cc8195e1c1a5c9959605a1b60208201529051638dc66ba160e01b815261053b91908390600401611874565b876001600160a01b0381166108c35760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b6108cb6111b9565b600554604080516318160ddd60e01b8152905161161d926001600160a01b0316916318160ddd91600480830192602092919082900301816000875af1158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190611896565b6109479060016118c5565b1115610994576040805180820182526015815274151bdd185b081cdd5c1c1b1e48195e18d959591959605a1b60208201529051638dc66ba160e01b815261053b9190600090600401611874565b6109a18987878b8b610b78565b6109e5576040805180820182526011815270496e76616c6964207369676e617475726560781b6020820152905163d647364f60e01b815261053b919060040161181a565b600554604051632cfd300560e01b81526001600160a01b038b81166004830152602482018990526000921690632cfd3005906044016020604051808303816000875af1158015610a39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5d9190611896565b6006546040516335313c2160e11b81526001600160a01b038d8116600483015292935060009290911690636a627842906024016020604051808303816000875af1158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190611896565b604080518a8152602081018590529081018290529091506001600160a01b038c16907f1eba155afe217abd462a2edbeadbfc49bcc9c9fb4ea11f28992964f6527c518e9060600160405180910390a25050505050505050505050565b600080516020611a09833981519152610b4781611074565b61070b611201565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080610b8687878761123e565b90506000610be1826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050610c238186868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061127e92505050565b98975050505050505050565b6000805160206119e9833981519152610c4781611074565b82600003610c8c57604080518082018252600e81526d125b9d985b1a5908185b5bdd5b9d60921b6020820152905163d647364f60e01b815261053b919060040161181a565b6001600160a01b038216610cd45760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b6000826001600160a01b03168460405160006040518083038185875af1925050503d8060008114610d21576040519150601f19603f3d011682016040523d82523d6000602084013e610d26565b606091505b5050905080610d725760408051808201825260148152732330b4b632b2103a379039b2b7321022ba3432b960611b60208201529051632dd96c8360e21b815261053b919060040161181a565b50505050565b600080516020611a09833981519152610d9081611074565b6001600160a01b038216610dd85760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600354610dfd90600080516020611a09833981519152906001600160a01b0316611102565b610e15600080516020611a098339815191528361107e565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154610e5381611074565b6104ca8383611102565b6000805160206119e9833981519152610e7581611074565b6001600160a01b038216610ebd5760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600454610ee2906000805160206119e9833981519152906001600160a01b0316611102565b610efa6000805160206119e98339815191528361107e565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020611a09833981519152610f3581611074565b6001600160a01b038216610f7d5760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600580546001600160a01b038481166001600160a01b0319831681179093556040516301ffc9a760e01b815263183b3c3360e21b6004820152911691906301ffc9a7906024016020604051808303816000875af1158015610fe2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611006919061182d565b61105657604080518082018252601881527f57726f6e672063686172616374657220636f6e7472616374000000000000000060208201529051632b79e12f60e11b815261053b919060040161181a565b6040516c10da185c9858dd195c8b9cdbdb609a1b8152600d01610694565b61070b81336112c0565b6110888282610b4f565b61054e576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556110be3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61110c8282610b4f565b1561054e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61116f611324565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff16156111ff5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161053b565b565b6112096111b9565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861119c3390565b60008361124c84602061136d565b8360405160200161125f939291906118dd565b6040516020818303038152906040528051906020012090509392505050565b60008061128b8484611510565b6002549091506001600160a01b03808316610100909204161480156112b857506001600160a01b03811615155b949350505050565b6112ca8282610b4f565b61054e576112e2816001600160a01b0316601461136d565b6112ed83602061136d565b6040516020016112fe929190611911565b60408051601f198184030181529082905262461bcd60e51b825261053b9160040161181a565b60025460ff166111ff5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161053b565b6060600061137c836002611986565b6113879060026118c5565b67ffffffffffffffff81111561139f5761139f6119a5565b6040519080825280601f01601f1916602001820160405280156113c9576020820181803683370190505b509050600360fc1b816000815181106113e4576113e46119bb565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611413576114136119bb565b60200101906001600160f81b031916908160001a9053506000611437846002611986565b6114429060016118c5565b90505b60018111156114ba576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611476576114766119bb565b1a60f81b82828151811061148c5761148c6119bb565b60200101906001600160f81b031916908160001a90535060049490941c936114b3816119d1565b9050611445565b5083156115095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161053b565b9392505050565b60008060008061151f8561158f565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa15801561157a573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600080600083516041146115e55760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e6774680000000000000000604482015260640161053b565b50505060208101516040820151606090920151909260009190911a90565b60006020828403121561161557600080fd5b81356001600160e01b03198116811461150957600080fd5b60006020828403121561163f57600080fd5b5035919050565b6001600160a01b038116811461070b57600080fd5b6000806040838503121561166e57600080fd5b82359150602083013561168081611646565b809150509250929050565b60006020828403121561169d57600080fd5b813561150981611646565b60008083601f8401126116ba57600080fd5b50813567ffffffffffffffff8111156116d257600080fd5b6020830191508360208285010111156116ea57600080fd5b9250929050565b60008060008060006080868803121561170957600080fd5b853561171481611646565b9450602086013567ffffffffffffffff81111561173057600080fd5b61173c888289016116a8565b9699909850959660408101359660609091013595509350505050565b60008060008060006080868803121561177057600080fd5b853561177b81611646565b94506020860135935060408601359250606086013567ffffffffffffffff8111156117a557600080fd5b6117b1888289016116a8565b969995985093965092949392505050565b60005b838110156117dd5781810151838201526020016117c5565b83811115610d725750506000910152565b600081518084526118068160208601602086016117c2565b601f01601f19169290920160200192915050565b60208152600061150960208301846117ee565b60006020828403121561183f57600080fd5b8151801515811461150957600080fd5b60608152600061186260608301866117ee565b60208301949094525060400152919050565b60408152600061188760408301856117ee565b90508260208301529392505050565b6000602082840312156118a857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156118d8576118d86118af565b500190565b6001600160a01b0384168152606060208201819052600090611901908301856117ee565b9050826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516119498160178501602088016117c2565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161197a8160288401602088016117c2565b01602801949350505050565b60008160001904831182151516156119a0576119a06118af565b500290565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000816119e0576119e06118af565b50600019019056fea5a0b70b385ff7611cd3840916bd08b10829e5bf9e6637cf79dd9a427fc0e2ab241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08496e76616c69642077616c6c6574206164647265737300000000000000000000a26469706673582212209ba35359f0d6e78ad9a2e8b58133723aa5d6fd43bf1bcdd417a0e7638e4c40a664736f6c634300080f00330000000000000000000000005f3f357194c32f9c2f1176cc39b9d6c214a1fdca0000000000000000000000000be1d9a27e6483105770e5eb081c0807cf2d163c0000000000000000000000005a0c717085ff891ad0940612b403035d425ba83f0000000000000000000000006bca6de2dbdc4e0d41f7273011785ea16ba471820000000000000000000000001ea66a857de297471bc12dd12d93853ff6617284

Deployed Bytecode

0x6080604052600436106101405760003560e01c80636c19e783116100b6578063a158657c1161006f578063a158657c14610380578063a217fddf146103a0578063d0ebdbe7146103b5578063d547741f146103d5578063f3283fba146103f5578063fe443ccb1461041557600080fd5b80636c19e783146102d55780636c5ef723146102f55780637ac3c02f146103085780638456cb591461032b57806391d14854146103405780639958ca471461036057600080fd5b80632f2ff15d116101085780632f2ff15d1461023257806336568abe14610252578063383c9830146102725780633f4ba83a1461029257806354909153146102a75780635c975abb146102bd57600080fd5b806301ffc9a7146101455780630f03b6ee1461017a5780630f3b7689146101b25780631cd00acb146101d4578063248a9ca3146101f4575b600080fd5b34801561015157600080fd5b50610165610160366004611603565b610435565b60405190151581526020015b60405180910390f35b34801561018657600080fd5b5060065461019a906001600160a01b031681565b6040516001600160a01b039091168152602001610171565b3480156101be57600080fd5b506101d26101cd36600461162d565b610487565b005b3480156101e057600080fd5b5060055461019a906001600160a01b031681565b34801561020057600080fd5b5061022461020f36600461162d565b60009081526020819052604090206001015490565b604051908152602001610171565b34801561023e57600080fd5b506101d261024d36600461165b565b6104a5565b34801561025e57600080fd5b506101d261026d36600461165b565b6104cf565b34801561027e57600080fd5b506101d261028d36600461168b565b610552565b34801561029e57600080fd5b506101d26106eb565b3480156102b357600080fd5b5061022460075481565b3480156102c957600080fd5b5060025460ff16610165565b3480156102e157600080fd5b506101d26102f036600461168b565b61070e565b6101d26103033660046116f1565b6107d8565b34801561031457600080fd5b5060025461010090046001600160a01b031661019a565b34801561033757600080fd5b506101d2610b2f565b34801561034c57600080fd5b5061016561035b36600461165b565b610b4f565b34801561036c57600080fd5b5061016561037b366004611758565b610b78565b34801561038c57600080fd5b506101d261039b36600461165b565b610c2f565b3480156103ac57600080fd5b50610224600081565b3480156103c157600080fd5b506101d26103d036600461168b565b610d78565b3480156103e157600080fd5b506101d26103f036600461165b565b610e38565b34801561040157600080fd5b506101d261041036600461168b565b610e5d565b34801561042157600080fd5b506101d261043036600461168b565b610f1d565b60006001600160e01b03198216631298229560e21b148061046657506001600160e01b031982166301ffc9a760e01b145b8061048157506001600160e01b0319821663da8def7360e01b145b92915050565b600080516020611a0983398151915261049f81611074565b50600755565b6000828152602081905260409020600101546104c081611074565b6104ca838361107e565b505050565b6001600160a01b03811633146105445760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61054e8282611102565b5050565b600080516020611a0983398151915261056a81611074565b6001600160a01b0382166105b25760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600680546001600160a01b038481166001600160a01b0319831681179093556040516301ffc9a760e01b81526330076fd760e21b6004820152911691906301ffc9a7906024016020604051808303816000875af1158015610617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063b919061182d565b61068057604080518082018252601281527115dc9bdb99c8189859c818dbdb9d1c9858dd60721b60208201529051632b79e12f60e11b815261053b919060040161181a565b60405166109859cb9cdbdb60ca1b81526007015b604080519182900382204283526001600160a01b038481166020850152861683830152905190917fe4d55c707519acf60c7217a3808567f013d2f024d787d1a9ef3004196219f680919081900360600190a2505050565b600080516020611a0983398151915261070381611074565b61070b611167565b50565b600080516020611a0983398151915261072681611074565b6001600160a01b038216610779576040805180820182526016815275496e76616c6964207369676e6572206164647265737360501b6020820152905163d647364f60e01b815261053b919060040161181a565b60028054610100600160a81b0319166101006001600160a01b0385169081029190911790915560405190815233907f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb9060200160405180910390a25050565b60075434908082101561082b576040805180820182526013815272139bc81c185e5b595b9d081c9958d95a5d9959606a1b6020820152905163010762d560e41b815261053b91908390859060040161184f565b828042111561087a576040805180820182526015815274135a5b9d081a185cda081a185cc8195e1c1a5c9959605a1b60208201529051638dc66ba160e01b815261053b91908390600401611874565b876001600160a01b0381166108c35760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b6108cb6111b9565b600554604080516318160ddd60e01b8152905161161d926001600160a01b0316916318160ddd91600480830192602092919082900301816000875af1158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190611896565b6109479060016118c5565b1115610994576040805180820182526015815274151bdd185b081cdd5c1c1b1e48195e18d959591959605a1b60208201529051638dc66ba160e01b815261053b9190600090600401611874565b6109a18987878b8b610b78565b6109e5576040805180820182526011815270496e76616c6964207369676e617475726560781b6020820152905163d647364f60e01b815261053b919060040161181a565b600554604051632cfd300560e01b81526001600160a01b038b81166004830152602482018990526000921690632cfd3005906044016020604051808303816000875af1158015610a39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5d9190611896565b6006546040516335313c2160e11b81526001600160a01b038d8116600483015292935060009290911690636a627842906024016020604051808303816000875af1158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190611896565b604080518a8152602081018590529081018290529091506001600160a01b038c16907f1eba155afe217abd462a2edbeadbfc49bcc9c9fb4ea11f28992964f6527c518e9060600160405180910390a25050505050505050505050565b600080516020611a09833981519152610b4781611074565b61070b611201565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080610b8687878761123e565b90506000610be1826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050610c238186868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061127e92505050565b98975050505050505050565b6000805160206119e9833981519152610c4781611074565b82600003610c8c57604080518082018252600e81526d125b9d985b1a5908185b5bdd5b9d60921b6020820152905163d647364f60e01b815261053b919060040161181a565b6001600160a01b038216610cd45760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b6000826001600160a01b03168460405160006040518083038185875af1925050503d8060008114610d21576040519150601f19603f3d011682016040523d82523d6000602084013e610d26565b606091505b5050905080610d725760408051808201825260148152732330b4b632b2103a379039b2b7321022ba3432b960611b60208201529051632dd96c8360e21b815261053b919060040161181a565b50505050565b600080516020611a09833981519152610d9081611074565b6001600160a01b038216610dd85760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600354610dfd90600080516020611a09833981519152906001600160a01b0316611102565b610e15600080516020611a098339815191528361107e565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154610e5381611074565b6104ca8383611102565b6000805160206119e9833981519152610e7581611074565b6001600160a01b038216610ebd5760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600454610ee2906000805160206119e9833981519152906001600160a01b0316611102565b610efa6000805160206119e98339815191528361107e565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020611a09833981519152610f3581611074565b6001600160a01b038216610f7d5760408051808201825260168152600080516020611a298339815191526020820152905163d647364f60e01b815261053b919060040161181a565b600580546001600160a01b038481166001600160a01b0319831681179093556040516301ffc9a760e01b815263183b3c3360e21b6004820152911691906301ffc9a7906024016020604051808303816000875af1158015610fe2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611006919061182d565b61105657604080518082018252601881527f57726f6e672063686172616374657220636f6e7472616374000000000000000060208201529051632b79e12f60e11b815261053b919060040161181a565b6040516c10da185c9858dd195c8b9cdbdb609a1b8152600d01610694565b61070b81336112c0565b6110888282610b4f565b61054e576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556110be3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61110c8282610b4f565b1561054e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61116f611324565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff16156111ff5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161053b565b565b6112096111b9565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861119c3390565b60008361124c84602061136d565b8360405160200161125f939291906118dd565b6040516020818303038152906040528051906020012090509392505050565b60008061128b8484611510565b6002549091506001600160a01b03808316610100909204161480156112b857506001600160a01b03811615155b949350505050565b6112ca8282610b4f565b61054e576112e2816001600160a01b0316601461136d565b6112ed83602061136d565b6040516020016112fe929190611911565b60408051601f198184030181529082905262461bcd60e51b825261053b9160040161181a565b60025460ff166111ff5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161053b565b6060600061137c836002611986565b6113879060026118c5565b67ffffffffffffffff81111561139f5761139f6119a5565b6040519080825280601f01601f1916602001820160405280156113c9576020820181803683370190505b509050600360fc1b816000815181106113e4576113e46119bb565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611413576114136119bb565b60200101906001600160f81b031916908160001a9053506000611437846002611986565b6114429060016118c5565b90505b60018111156114ba576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611476576114766119bb565b1a60f81b82828151811061148c5761148c6119bb565b60200101906001600160f81b031916908160001a90535060049490941c936114b3816119d1565b9050611445565b5083156115095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161053b565b9392505050565b60008060008061151f8561158f565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa15801561157a573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600080600083516041146115e55760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e6774680000000000000000604482015260640161053b565b50505060208101516040820151606090920151909260009190911a90565b60006020828403121561161557600080fd5b81356001600160e01b03198116811461150957600080fd5b60006020828403121561163f57600080fd5b5035919050565b6001600160a01b038116811461070b57600080fd5b6000806040838503121561166e57600080fd5b82359150602083013561168081611646565b809150509250929050565b60006020828403121561169d57600080fd5b813561150981611646565b60008083601f8401126116ba57600080fd5b50813567ffffffffffffffff8111156116d257600080fd5b6020830191508360208285010111156116ea57600080fd5b9250929050565b60008060008060006080868803121561170957600080fd5b853561171481611646565b9450602086013567ffffffffffffffff81111561173057600080fd5b61173c888289016116a8565b9699909850959660408101359660609091013595509350505050565b60008060008060006080868803121561177057600080fd5b853561177b81611646565b94506020860135935060408601359250606086013567ffffffffffffffff8111156117a557600080fd5b6117b1888289016116a8565b969995985093965092949392505050565b60005b838110156117dd5781810151838201526020016117c5565b83811115610d725750506000910152565b600081518084526118068160208601602086016117c2565b601f01601f19169290920160200192915050565b60208152600061150960208301846117ee565b60006020828403121561183f57600080fd5b8151801515811461150957600080fd5b60608152600061186260608301866117ee565b60208301949094525060400152919050565b60408152600061188760408301856117ee565b90508260208301529392505050565b6000602082840312156118a857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156118d8576118d86118af565b500190565b6001600160a01b0384168152606060208201819052600090611901908301856117ee565b9050826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516119498160178501602088016117c2565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161197a8160288401602088016117c2565b01602801949350505050565b60008160001904831182151516156119a0576119a06118af565b500290565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000816119e0576119e06118af565b50600019019056fea5a0b70b385ff7611cd3840916bd08b10829e5bf9e6637cf79dd9a427fc0e2ab241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08496e76616c69642077616c6c6574206164647265737300000000000000000000a26469706673582212209ba35359f0d6e78ad9a2e8b58133723aa5d6fd43bf1bcdd417a0e7638e4c40a664736f6c634300080f0033

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

0000000000000000000000005f3f357194c32f9c2f1176cc39b9d6c214a1fdca0000000000000000000000000be1d9a27e6483105770e5eb081c0807cf2d163c0000000000000000000000005a0c717085ff891ad0940612b403035d425ba83f0000000000000000000000006bca6de2dbdc4e0d41f7273011785ea16ba471820000000000000000000000001ea66a857de297471bc12dd12d93853ff6617284

-----Decoded View---------------
Arg [0] : manager (address): 0x5F3F357194C32f9c2f1176CC39B9d6c214A1fDCA
Arg [1] : multisig (address): 0x0be1d9a27E6483105770e5eb081c0807cf2D163c
Arg [2] : signer (address): 0x5A0C717085fF891Ad0940612b403035d425BA83F
Arg [3] : character (address): 0x6bCa6de2dbDc4E0d41f7273011785ea16Ba47182
Arg [4] : bag (address): 0x1eA66A857dE297471bC12Dd12D93853Ff6617284

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000005f3f357194c32f9c2f1176cc39b9d6c214a1fdca
Arg [1] : 0000000000000000000000000be1d9a27e6483105770e5eb081c0807cf2d163c
Arg [2] : 0000000000000000000000005a0c717085ff891ad0940612b403035d425ba83f
Arg [3] : 0000000000000000000000006bca6de2dbdc4e0d41f7273011785ea16ba47182
Arg [4] : 0000000000000000000000001ea66a857de297471bc12dd12d93853ff6617284


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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