WEMIX Price: $1.20 (-1.03%)

Contract

0x732e6973595136976173AF4a56Eac99F52beCc6E

Overview

WEMIX Balance

WEMIX3.0 LogoWEMIX3.0 LogoWEMIX3.0 Logo0 WEMIX

WEMIX Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0xbc67628edb8c3e7686a143128be3e76fad571502958abf375c34be7c5b3a131b -(pending)2024-12-06 11:03:142 secs ago1733482994IN
Morion: MORION Token
0 WEMIX(Pending)(Pending)
Transfer672485522024-12-06 11:02:5422 secs ago1733482974IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672485242024-12-06 11:02:2650 secs ago1733482946IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672485152024-12-06 11:02:171 mins ago1733482937IN
Morion: MORION Token
0 WEMIX0.0098608100
Transfer672485032024-12-06 11:02:051 min ago1733482925IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672484952024-12-06 11:01:571 min ago1733482917IN
Morion: MORION Token
0 WEMIX0.0098608100
Transfer672484762024-12-06 11:01:381 min ago1733482898IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672484742024-12-06 11:01:361 min ago1733482896IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672484432024-12-06 11:01:052 mins ago1733482865IN
Morion: MORION Token
0 WEMIX0.010342100
Transfer672484282024-12-06 11:00:502 mins ago1733482850IN
Morion: MORION Token
0 WEMIX0.0098608100
Transfer672483762024-12-06 10:59:583 mins ago1733482798IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672483702024-12-06 10:59:523 mins ago1733482792IN
Morion: MORION Token
0 WEMIX0.0081508100
Approve672483632024-12-06 10:59:453 mins ago1733482785IN
Morion: MORION Token
0 WEMIX0.0046364100
Transfer672483472024-12-06 10:59:293 mins ago1733482769IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672483442024-12-06 10:59:263 mins ago1733482766IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672483342024-12-06 10:59:164 mins ago1733482756IN
Morion: MORION Token
0 WEMIX0.0103408100
Transfer672483332024-12-06 10:59:154 mins ago1733482755IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672482972024-12-06 10:58:394 mins ago1733482719IN
Morion: MORION Token
0 WEMIX0.0081508100
Approve672482522024-12-06 10:57:545 mins ago1733482674IN
Morion: MORION Token
0 WEMIX0.0046628100
Approve672482232024-12-06 10:57:255 mins ago1733482645IN
Morion: MORION Token
0 WEMIX0.0046628100
Transfer672481882024-12-06 10:56:506 mins ago1733482610IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672481842024-12-06 10:56:466 mins ago1733482606IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672481822024-12-06 10:56:446 mins ago1733482604IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672481802024-12-06 10:56:426 mins ago1733482602IN
Morion: MORION Token
0 WEMIX0.0081508100
Transfer672481392024-12-06 10:56:017 mins ago1733482561IN
Morion: MORION Token
0 WEMIX0.0081508100
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MORION

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at wemixscan.com on 2024-03-07
*/

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

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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


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


abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

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

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

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

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

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

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}


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


enum DataVersion {invalid, common}

library CommonDataFormat {
    struct CommonData {
        bytes4 selector;
        address contractAddress;
        address account;
        address requester;
    }

    function encodeToCommonFormat(CommonData memory data) internal pure returns (bytes memory encoded) {
        return abi.encode(data);
    }

    function decodeFromCommonFormat(bytes memory request) internal pure returns (CommonData memory data) {
        return abi.decode(request, (CommonData));
    }

    function manufactureToCommon(bytes memory request) internal pure returns (bytes memory commonData) {
        return request;
    }

    function dataVersion() internal pure returns (uint) {
        return uint(DataVersion.common);
    }
}

/** 
 * //===== EXAMPLE =====//
 *  struct CustomData {
 *      CommonDataFormat.CommonData common;
 *      uint cap;
 *  }
 *
 *   library CustomDataFormat {
 *       function encodeToCustomFormat(CustomData memory data) internal pure returns (bytes memory encoded) {
 *           return abi.encode(data);
 *       }
 *
 *       function decodeFromCustomFormat(bytes memory request) internal pure returns (CustomData memory data) {
 *           return abi.decode(request, (CustomData));
 *       }
 *
 *       function manufactureCustomToCommon(bytes memory request) internal pure returns (bytes memory customData) {
 *           return abi.encode(decodeFromCustomFormat(request).common);
 *       }
 * 
 *       function manufactureCommonToCustom(bytes memory request) internal pure returns (bytes memory customData) {
 *           CommonData memory common = CommonDataFormat.decodeFromCommonFormat(request);
 *           return abi.encode(CustomData(common, 0));
 *       }
 * 
 *       function dataVersion() internal pure returns (DataVersion) {
 *           return DataVersion.custom;
 *       }
 *   }
 *
*/

abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

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

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


library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

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

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

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

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

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

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


interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}


abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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


interface IRiskManager is IERC165Upgradeable {
    //===== VIEW FUNCTIONS =====//
    function isRiskedRequest(uint version, bytes memory request) external view returns (bool);
    function isRiskedRequests(uint version, bytes[] memory requests) external view returns (bool);
}

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


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

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

type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using
     * {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

interface IURC20 is IERC20 {
    /**
     * @dev Creates `amount` tokens and assigns them to `account`.
     * 
     * IMPORTANT: For the use of the Una Bridge, it must be implemented.
     */
    function mint(address to, uint256 amount) external;

    /**
     * @dev Destroys the tokens at the address `account` by `amount`.
     * 
     * IMPORTANT: For the use of the Una Bridge, it must be implemented.
     */
    function burnFrom(address account, uint256 amount) external;
}


contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

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

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


abstract contract RiskGuard is Context {
    using CommonDataFormat for CommonDataFormat.CommonData;

    // the contract mananging request risk
    address immutable public riskManager; 

    constructor(address riskManager_) {
        require(riskManager_.code.length > 0 && address(riskManager_) != address(0), "RiskGuard: only contract");
        riskManager = riskManager_;
    }
    /**
     * @dev Checks for risks associated with a single address before executing the function.
     * 
     * The caller's address is inherently included in the risk check.
     * 
     * TIP: It is used when there is only one address related to the function call, excluding the caller.
     */
    modifier nonRisk(bytes4 selector, address account) {
        if(account != _msgSender()) _isRiskedRequests(selector, _makeArray(account));
        else _isRiskedRequest(selector, account);
        _;
    }
    
    /**
     * @dev Checks for risks associated with addresses before executing the function.
     * 
     * The caller's address is inherently included in the risk check.
     * 
     * TIP: "It is used when there are two addresses related to the function call, excluding the caller
     *      : one for `from` and another for `to`.
     */
    modifier nonRisks(bytes4 selector, address from, address to) {
        _isRiskedRequests(selector, _makeArray(from, to));
        _;
    }

    /**
     * @dev Call `RiskManager` for requests. (false: not exist risk, true: exist risk)
     *      If it exists risk, revert it.
     * @param selector function signature to detect risk
     * @param accounts the addresses to inspect for risk
     */
    function _isRiskedRequests(bytes4 selector, address[] memory accounts) internal view {
        require(
            !IRiskManager(riskManager).isRiskedRequests(
                CommonDataFormat.dataVersion(),
                _getCommonFormatBytes(selector, accounts)
            ), "RiskGuard: risked request"
        );
    }

    /**
     * @dev Call `RiskManager` for a request. (false: not exist risk, true: exist risk)
     *      If it exists risk, revert it.
     * @param selector function selector to inspect for risk
     * @param account the address to inspect for risk
     */
    function _isRiskedRequest(bytes4 selector, address account) internal view {
        require(
            !IRiskManager(riskManager).isRiskedRequest(
                CommonDataFormat.dataVersion(),
                CommonDataFormat.encodeToCommonFormat(CommonDataFormat.CommonData(selector, address(this), account, _msgSender()))
            ), "RiskGuard: risked request"
        );
    }

    /**
     * @dev To enable the `RiskManager` to handle requests for risk assessment 
     *      for multiple addresses, it converts them into bytes format.
     * @param selector function selector to inspect for risk
     * @param accounts the addresses to inspect for risk
     * 
     */
    function _getCommonFormatBytes(
        bytes4 selector, 
        address[] memory accounts
    ) internal view returns(bytes[] memory) {
        bytes[] memory request = new bytes[](accounts.length);
        address  sender = _msgSender();
        for (uint i; i < accounts.length; ) {
            request[i] = CommonDataFormat.encodeToCommonFormat(
                CommonDataFormat.CommonData(selector, address(this), accounts[i], sender)
            );
            unchecked{ i++; }
        }
            
        return request;
    }

    /**
     * @dev Creating a data format for the `RiskManager` call.
     */
    function _makeArray (
        address from, 
        address to
    ) internal view returns(address[] memory _addressArray) {
        _addressArray = new address[](3);
        _addressArray[0] = _msgSender();
        _addressArray[1] = from;
        _addressArray[2] = to;
    }

    /**
     * @dev Creating a data format for the `RiskManager` call.
     */
    function _makeArray (
        address to
    ) internal view returns(address[] memory _addressArray) {
        _addressArray = new address[](2);
        _addressArray[0] = _msgSender();
        _addressArray[1] = to;
    }
}

contract URC20 is IURC20, ERC20, RiskGuard {    
    bytes4 private constant _BURN_SELECTOR = bytes4(keccak256(bytes("_burn(address,uint256)")));
    bytes4 private constant _MINT_SELECTOR = bytes4(keccak256(bytes("_mint(address,uint256)")));

    /**
     * @dev Sets the values for {name}, {symbol} and {riskManager}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     */
    constructor (
        string memory name_, 
        string memory symbol_, 
        address riskManager_
    ) RiskGuard(riskManager_) ERC20(name_, symbol_) {}

    /**
     * @dev Creates `amount` tokens and assigns them to `account`.
     * @param to the account to mint
     * @param amount the amount to mint
     */
    function mint(address to, uint256 amount) public virtual {}

    /**
     * @dev The caller destroys the tokens at the address `account` by `amount`.
     * @param account the account to burn tokens
     * @param amount the amount to burn
     */
    function burnFrom(address account, uint256 amount) public virtual {}

    /**
     * @dev After checking the risks associated with the `to` address, contract address, caller's address, 
     *      and the function, tokens are transferred to the `to` address with the `amount`.
     * @param to the address to receive tokens
     * @param amount the amount to transfer
     * 
     */
    function transfer(
        address to, 
        uint256 amount
    ) public override(ERC20, IERC20) nonRisk(this.transfer.selector, to) returns (bool) {
        return super.transfer(to, amount);
    }

    /**
     * @dev After checking the risks associated with the `to` address, contract address, caller's address, 
     *      and the function, tokens are transferred from the `from` address to the `to` address with the `amount`.
     * @param to the address to receive tokens
     * @param from the address to transfer tokens
     * @param amount the amount to transfer
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public override(ERC20, IERC20) nonRisks(this.transferFrom.selector, from, to) returns (bool) {   
        return super.transferFrom(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing the total supply.
     * @param account the address to receive minted tokens
     * @param amount the amount to mint tokens
     * 
     * NOTE: When creating tokens, it is essential to call this function for risk verification.
     */
    function _mint(address account, uint256 amount) internal override nonRisk(_MINT_SELECTOR, account) {
        super._mint(account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the total supply.
     * @param account the address to burn tokens
     * @param amount the amount to burn tokens
     * 
     * NOTE: When destorying tokens, it is essential to call this function for risk verification.
     */
    function _burn(address account, uint256 amount) internal override nonRisk(_BURN_SELECTOR, account) {
        super._burn(account, amount);
    }
}

abstract contract Ownable is Context {
    address private _owner;

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

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

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

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

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

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

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

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


interface IRoleManager is IAccessControl {
    //===== FUNCTIONS =====//
    function setRoleAdmin(bytes32 role, bytes32 adminRole) external;
    //===== VIEW FUNCTIONS =====//
    function getRoleList(bytes32 role) external view returns (address[] memory);
}

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) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        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 if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // 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))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } 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));
    }
}


abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

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

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

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

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _name which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Name() internal view returns (string memory) {
        return _name.toStringWithFallback(_nameFallback);
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _version which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Version() internal view returns (string memory) {
        return _version.toStringWithFallback(_versionFallback);
    }
}

interface IURC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
     * given `owner`'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     *      included whenever a signature is generated for {permit}.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

abstract contract Nonces {
    /**
     * @dev The nonce used for an `account` is not the expected current nonce.
     */
    error InvalidAccountNonce(address account, uint256 currentNonce);

    mapping(address => uint256) private _nonces;

    /**
     * @dev Returns the next unused nonce for an address.
     */
    function nonces(address owner) public view virtual returns (uint256) {
        return _nonces[owner];
    }

    /**
     * @dev Consumes a nonce.
     *
     * Returns the current value and increments nonce.
     */
    function _useNonce(address owner) internal virtual returns (uint256) {
        // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be
        // decremented or reset. This guarantees that the nonce never overflows.
        unchecked {
            // It is important to do x++ and not ++x here.
            return _nonces[owner]++;
        }
    }

    /**
     * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
     */
    function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
        uint256 current = _useNonce(owner);
        if (nonce != current) {
            revert InvalidAccountNonce(owner, current);
        }
    }
}

library Converter {
    /**
    * @dev Function to change bytes to bytes32
    */
    function bytesToBytes32(bytes memory input) internal pure returns (bytes32 output) {
        uint length = input.length >= 32 ? 32 : input.length;

        for (uint i = 0; i < length; i++) {
            output |= bytes32(input[i] & 0xFF) >> (i * 8);
        }
    }

    /**
    * @dev Function to change bytes32 to string
    */
    function bytes32ToString(bytes32 _bytes32) internal pure returns (string memory) {
        uint8 i = 0;
        while(i < 32 && _bytes32[i] != 0) {
            i++;
        }
        bytes memory bytesArray = new bytes(i);
        for (i = 0; i < 32 && _bytes32[i] != 0; i++) {
            bytesArray[i] = _bytes32[i];
        }
        return string(bytesArray);
    }

    /**
    * @dev Function to change string to bytes32
    * If string length is less than 32, pad for 0 (LSB)
    */
    function stringToBytes32(string memory source) internal pure returns (bytes32 result) {
        require(bytes(source).length <= 32, "E: string too long");
        assembly {
            result := mload(add(source, 32))
        }
    }

    function concat(string memory str1, string memory str2) internal pure returns (bytes32) {
        bytes memory concatenated = bytes(string(abi.encodePacked(str1, str2)));
        require(concatenated.length <= 32, "E: string too long");
        bytes32 result;

        assembly {
            result := mload(add(concatenated, 32))
        }
        return result;
    }
}

abstract contract URC20Permit is URC20, IURC20Permit, EIP712, Nonces {
    bytes32 private constant PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");

    /**
     * @dev Initializes the domain separator using the `name` parameter, and setting `version` to `"1"`.
     *
     * It's a good idea to use the same `name` that is defined as the URC20 token name.
     */
    constructor(string memory name) EIP712(name, "1") {}

    /**
     * @dev Allows a token `owner` to sign an approval for a `spender` to spend tokens on their behalf.
     * @param owner token owner address
     * @param spender address spending the tokens of `owner`
     * @param value the amount of tokens to allow for spender
     * @param deadline the time when the signature expires
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(block.timestamp <= deadline, "URC20Permit: expired signature");
        
        address signer = 
            ECDSA.recover(
                _getDigest(owner, spender, value, deadline),
                v, 
                r, 
                s
            );
        require(signer == owner, "URC20Permit: invalid signer");
        
        _approve(owner, spender, value);
    }

    /**
     * @dev Allows a token `owner` to sign an approval for a `spender` to spend tokens on their behalf.
     * @param owner token owner address
     * @param spender address spending the tokens of `owner`
     * @param value the amount of tokens to allow for spender
     * @param deadline the time when the signature expires
     * @param signature token owner signature
     * 
     * NOTE: This function receives the complete signature as a parameter and extracts `v`, `r`, `s` on-chain. 
     */
    function permitWithSignature(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        bytes memory signature
    ) public virtual {
        require(block.timestamp <= deadline, "URC20Permit: expired signature");
        
        address signer = 
            ECDSA.recover(
                _getDigest(owner, spender, value, deadline), 
                signature
            );
        require(signer == owner, "URC20Permit: invalid signer"); 

        _approve(owner, spender, value);
    }

    /**
     * @dev Returns the current nonce for `owner`.
     * @param owner requester address
     */
    function nonces(address owner) public view virtual override(IURC20Permit, Nonces) returns (uint256) {
        return super.nonces(owner);
    }

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev Returns the message hash of the content where the token owner approves the spender. 
     *      The returned message hash is uniquely generated for each token and chain.
     * @param owner token owner address
     * @param spender address spending the tokens of `owner`
     * @param value the amount of tokens to allow for spender
     * @param deadline token owner signature
     */
    function getDigest(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline
    ) external view returns(bytes32){
        return _hashTypedDataV4(
            keccak256(
                abi.encode(
                    PERMIT_TYPEHASH,
                    owner,
                    spender,
                    value,
                    nonces(owner),
                    deadline
                )
            )
        );
    }

    /**
     * @dev Returns the message hash of the content where the token owner approves the spender. 
     *      The returned message hash is uniquely generated for each token and chain.
     * @param owner token owner address
     * @param spender address spending the tokens of `owner`
     * @param value the amount of tokens to allow for spender
     * @param deadline token owner signature
     * 
     *  NOTE: Increase the user nonce.
     */
    function _getDigest(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline
    ) internal returns(bytes32){
        return _hashTypedDataV4(
            keccak256(
                abi.encode(
                    PERMIT_TYPEHASH,
                    owner,
                    spender,
                    value,
                    _useNonce(owner),
                    deadline
                )
            )
        );
    }
}

abstract contract URC20Burnable is URC20 {
    /**
     * @dev The caller's tokens are destroyed by the `amount`.
     * @param amount the amount to burn
     * 
     */
    function burn(
        uint256 amount
    ) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev The caller, who has an allowance from the `account`, destroys `amount` tokens 
     *      from the `account`.
     * @param account the account to burn tokens
     * @param amount the amount to burn
     */
    function burnFrom(
        address account, 
        uint256 amount
    ) public virtual override {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}

contract NightCrowBase is Ownable {
    //===== VARIABLES =====//
    address public roleManager;
    bytes32 constant public setterRole = "NightCrowSetter";
    bytes32 constant public validatorRole = "NightCrowValidator";

    //===== MODIFIERS =====//
    modifier onlyValidRole(bytes32 role) {
        require(_msgSender() == owner() || _hasRole(role, msg.sender),
            "NightCrow: sender has not the role"
        );
        _;
    }

    modifier onlyCA(address addr) {
        require(addr != address(0) && addr.code.length > 0,
            "NightCrow: address is not CA"
        );
        _;
    }

    //===== CONSTRUCTOR =====//
    constructor(address _roleManager) {
        setRoleManager(_roleManager);
    }

    //===== FUNCTIONS =====//
    function setRoleManager(address _roleManager) public onlyValidRole(setterRole) onlyCA(_roleManager) {
        roleManager = _roleManager;
    }

    function _hasRole(bytes32 role, address addr) internal view returns (bool) {
        return IRoleManager(roleManager).hasRole(role, addr);
    }
}

contract NightCrowFT is URC20Permit, URC20Burnable, NightCrowBase {
   using Converter for string;
   
   //===== VARIABLES =====//
   bytes32 public immutable minterRole;

   //===== CONSTRUCTOR =====//
    constructor(
        string memory name,
        string memory symbol,
        address roleManager,
        address riskManager
    )
        URC20(name, symbol, riskManager)
        URC20Permit(name)
        NightCrowBase(roleManager)
    {
        minterRole = symbol.concat("Minter");
    }

    //===== FUNCTIONS ======//
    /**
     *  @dev mint token
     *  @param to mint to
     *  @param amount mint amount
     */
    function mint(address to, uint amount) public override onlyValidRole(minterRole) {
        super._mint(to, amount);
    }

    /**
     * @dev The Una token can only be burned by addresses 
     *      with either the UnaStation or BURNER authority.
     * @param amount the amount to burn
     * 
     * See {URC20-_burn}.
     */
    function burn(uint256 amount) public override {
        super.burn(amount);
    } 

    /**
     * @dev An address with BURNER authority burns the Una Token held in the `account`.
     * @param amount the amount to burn
     * 
     * See {URC20-_burn} and {URC20-allowance}.
     */
    function burnFrom(address account, uint256 amount) public override(URC20, URC20Burnable) {
        super.burnFrom(account, amount);
    }
}

contract MORION is NightCrowFT {
    constructor(
        string memory name,
        string memory symbol,
        address roleManager,
        address riskManager
    ) NightCrowFT(
        name,
        symbol,
        roleManager,
        riskManager
    ) {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"roleManager","type":"address"},{"internalType":"address","name":"riskManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"getDigest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minterRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permitWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"riskManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roleManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_roleManager","type":"address"}],"name":"setRoleManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setterRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validatorRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]

6101a06040523480156200001257600080fd5b5060405162002df938038062002df9833981016040819052620000359162000707565b83838383818480604051806040016040528060018152602001603160f81b8152508787868083838160039080519060200190620000749291906200056a565b5080516200008a9060049060208401906200056a565b5050506000816001600160a01b03163b118015620000b057506001600160a01b03811615155b620001025760405162461bcd60e51b815260206004820152601860248201527f5269736b47756172643a206f6e6c7920636f6e7472616374000000000000000060448201526064015b60405180910390fd5b6001600160a01b0316608052506200012c9150839050600562000245602090811b62000b4217901c565b610140526200014981600662000245602090811b62000b4217901c565b61016052815160208084019190912061010052815190820120610120524660c052620001d96101005161012051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60a05250503060e05250620001ee3362000299565b620001f981620002eb565b50620002326040518060400160405280600681526020016526b4b73a32b960d11b815250846200042760201b62000b791790919060201c565b6101805250620008819650505050505050565b600060208351101562000265576200025d83620004a4565b905062000293565b826200027c83620004e760201b62000bf21760201c565b81516200028d92602001906200056a565b5060ff90505b92915050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6e2734b3b43a21b937bba9b2ba3a32b960891b620003116008546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480620003385750620003388133620004ea565b620003915760405162461bcd60e51b815260206004820152602260248201527f4e6967687443726f773a2073656e64657220686173206e6f742074686520726f6044820152616c6560f01b6064820152608401620000f9565b816001600160a01b03811615801590620003b557506000816001600160a01b03163b115b620004035760405162461bcd60e51b815260206004820152601c60248201527f4e6967687443726f773a2061646472657373206973206e6f74204341000000006044820152606401620000f9565b5050600980546001600160a01b0319166001600160a01b0392909216919091179055565b60008083836040516020016200043f92919062000796565b6040516020818303038152906040529050602081511115620004995760405162461bcd60e51b8152602060048201526012602482015271453a20737472696e6720746f6f206c6f6e6760701b6044820152606401620000f9565b602001519392505050565b600080829050601f81511115620004d2578260405163305a27a960e01b8152600401620000f99190620007c9565b8051620004df82620007fe565b179392505050565b90565b600954604051632474521560e21b8152600481018490526001600160a01b03838116602483015260009216906391d1485490604401602060405180830381865afa1580156200053d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000563919062000826565b9392505050565b82805462000578906200084a565b90600052602060002090601f0160209004810192826200059c5760008555620005e7565b82601f10620005b757805160ff1916838001178555620005e7565b82800160010185558215620005e7579182015b82811115620005e7578251825591602001919060010190620005ca565b50620005f5929150620005f9565b5090565b5b80821115620005f55760008155600101620005fa565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200064357818101518382015260200162000629565b8381111562000653576000848401525b50505050565b600082601f8301126200066b57600080fd5b81516001600160401b038082111562000688576200068862000610565b604051601f8301601f19908116603f01168101908282118183101715620006b357620006b362000610565b81604052838152866020858801011115620006cd57600080fd5b620006e084602083016020890162000626565b9695505050505050565b80516001600160a01b03811681146200070257600080fd5b919050565b600080600080608085870312156200071e57600080fd5b84516001600160401b03808211156200073657600080fd5b620007448883890162000659565b955060208701519150808211156200075b57600080fd5b506200076a8782880162000659565b9350506200077b60408601620006ea565b91506200078b60608601620006ea565b905092959194509250565b60008351620007aa81846020880162000626565b835190830190620007c081836020880162000626565b01949350505050565b6020815260008251806020840152620007ea81604085016020870162000626565b601f01601f19169190910160400192915050565b8051602080830151919081101562000820576000198160200360031b1b821691505b50919050565b6000602082840312156200083957600080fd5b815180151581146200056357600080fd5b600181811c908216806200085f57607f821691505b602082108114156200082057634e487b7160e01b600052602260045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051610180516124f26200090760003960008181610410015261056c0152600061120f015260006111e201526000610fb601526000610f8e01526000610ee901526000610f1301526000610f3d0152600081816102d301528181610de701526112cc01526124f26000f3fe608060405234801561001057600080fd5b50600436106101ce5760003560e01c806379cc679011610104578063bba76a05116100a2578063dd62ed3e11610071578063dd62ed3e146103f8578063f084219e1461040b578063f1d588c514610432578063f2fde38b1461044557600080fd5b8063bba76a05146103a6578063c39a717a146103b9578063c92fb947146103cc578063d505accf146103e557600080fd5b80638da5cb5b116100de5780638da5cb5b1461036757806395d89b4114610378578063a457c2d714610380578063a9059cbb1461039357600080fd5b806379cc6790146103265780637ecebe001461033957806384b0196e1461034c57600080fd5b8063395093511161017157806342f7022e1161014b57806342f7022e146102b257806347842663146102ce57806370a08231146102f5578063715018a61461031e57600080fd5b8063395093511461027757806340c10f191461028a57806342966c681461029f57600080fd5b806318160ddd116101ad57806318160ddd1461023b57806323b872dd1461024d578063313ce567146102605780633644e5151461026f57600080fd5b8062435da5146101d357806306fdde0314610203578063095ea7b314610218575b600080fd5b6009546101e6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61020b610458565b6040516101fa9190611faa565b61022b610226366004611fd9565b6104ea565b60405190151581526020016101fa565b6002545b6040519081526020016101fa565b61022b61025b366004612003565b610504565b604051601281526020016101fa565b61023f610539565b61022b610285366004611fd9565b610548565b61029d610298366004611fd9565b61056a565b005b61029d6102ad36600461203f565b6105f5565b61023f712734b3b43a21b937bbab30b634b230ba37b960711b81565b6101e67f000000000000000000000000000000000000000000000000000000000000000081565b61023f610303366004612058565b6001600160a01b031660009081526020819052604090205490565b61029d610601565b61029d610334366004611fd9565b610615565b61023f610347366004612058565b610623565b610354610641565b6040516101fa9796959493929190612073565b6008546001600160a01b03166101e6565b61020b610687565b61022b61038e366004611fd9565b610696565b61022b6103a1366004611fd9565b61071c565b61023f6103b4366004612109565b610766565b61029d6103c7366004612161565b6107eb565b61023f6e2734b3b43a21b937bba9b2ba3a32b960891b81565b61029d6103f3366004612247565b6108c8565b61023f6104063660046122ba565b6109a9565b61023f7f000000000000000000000000000000000000000000000000000000000000000081565b61029d610440366004612058565b6109d4565b61029d610453366004612058565b610acc565b606060038054610467906122ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610493906122ed565b80156104e05780601f106104b5576101008083540402835291602001916104e0565b820191906000526020600020905b8154815290600101906020018083116104c357829003601f168201915b5050505050905090565b6000336104f8818585610bf5565b60019150505b92915050565b60006323b872dd60e01b84846105238361051e8484610d19565b610ddd565b61052e878787610ec3565b979650505050505050565b6000610543610edc565b905090565b6000336104f881858561055b83836109a9565b6105659190612328565b610bf5565b7f000000000000000000000000000000000000000000000000000000000000000061059d6008546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806105c157506105c18133611007565b6105e65760405162461bcd60e51b81526004016105dd9061234e565b60405180910390fd5b6105f08383611084565b505050565b6105fe81611110565b50565b61060961111a565b6106136000611174565b565b61061f82826111c6565b5050565b6001600160a01b0381166000908152600760205260408120546104fe565b6000606080600080600060606106556111db565b61065d611208565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b606060048054610467906122ed565b600033816106a482866109a9565b9050838110156107045760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105dd565b6107118286868403610bf5565b506001949350505050565b600063a9059cbb60e01b836001600160a01b0381163314610749576107448261051e83611235565b610753565b61075382826112c2565b61075d8585611363565b95945050505050565b600061075d7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98686866107988a610623565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810184905260e00160405160208183030381529060405280519060200120611371565b8142111561083b5760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105dd565b600061085261084c8787878761139e565b836113ee565b9050856001600160a01b0316816001600160a01b0316146108b55760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105dd565b6108c0868686610bf5565b505050505050565b834211156109185760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105dd565b60006109316109298989898961139e565b858585611412565b9050876001600160a01b0316816001600160a01b0316146109945760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105dd565b61099f888888610bf5565b5050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6e2734b3b43a21b937bba9b2ba3a32b960891b6109f96008546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610a1d5750610a1d8133611007565b610a395760405162461bcd60e51b81526004016105dd9061234e565b816001600160a01b03811615801590610a5c57506000816001600160a01b03163b115b610aa85760405162461bcd60e51b815260206004820152601c60248201527f4e6967687443726f773a2061646472657373206973206e6f742043410000000060448201526064016105dd565b5050600980546001600160a01b0319166001600160a01b0392909216919091179055565b610ad461111a565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105dd565b6105fe81611174565b6000602083511015610b5e57610b578361143a565b90506104fe565b82828151610b6f9260200190611eb9565b5060ff90506104fe565b6000808383604051602001610b8f929190612390565b6040516020818303038152906040529050602081511115610be75760405162461bcd60e51b8152602060048201526012602482015271453a20737472696e6720746f6f206c6f6e6760701b60448201526064016105dd565b602001519392505050565b90565b6001600160a01b038316610c575760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105dd565b6001600160a01b038216610cb85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105dd565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b604080516003808252608082019092526060916020820183803683370190505090503381600081518110610d4f57610d4f6123bf565b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110610d8357610d836123bf565b60200260200101906001600160a01b031690816001600160a01b0316815250508181600281518110610db757610db76123bf565b60200260200101906001600160a01b031690816001600160a01b03168152505092915050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663afa960e36001610e188585611478565b6040518363ffffffff1660e01b8152600401610e359291906123d5565b602060405180830381865afa158015610e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e76919061243f565b1561061f5760405162461bcd60e51b815260206004820152601960248201527f5269736b47756172643a207269736b656420726571756573740000000000000060448201526064016105dd565b600033610ed185828561156f565b6107118585856115e3565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610f3557507f000000000000000000000000000000000000000000000000000000000000000046145b15610f5f57507f000000000000000000000000000000000000000000000000000000000000000090565b610543604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600954604051632474521560e21b8152600481018490526001600160a01b03838116602483015260009216906391d1485490604401602060405180830381865afa158015611059573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107d919061243f565b9392505050565b6040805180820190915260168152755f6d696e7428616464726573732c75696e743235362960501b6020909101527f4e6ec2477b215d44bbbdd0f5815b8827188f1eb827c01cc00f7f983582322afa826001600160a01b03811633146110f6576110f18261051e83611235565b611100565b61110082826112c2565b61110a8484611787565b50505050565b6105fe3382611846565b6008546001600160a01b031633146106135760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105dd565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6111d182338361156f565b61061f8282611846565b60606105437f000000000000000000000000000000000000000000000000000000000000000060056118cc565b60606105437f000000000000000000000000000000000000000000000000000000000000000060066118cc565b60408051600280825260608083018452926020830190803683370190505090503381600081518110611269576112696123bf565b60200260200101906001600160a01b031690816001600160a01b031681525050818160018151811061129d5761129d6123bf565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663d37c475160016113466040518060800160405280876001600160e01b0319168152602001306001600160a01b03168152602001866001600160a01b031681526020016113363390565b6001600160a01b03169052611970565b6040518363ffffffff1660e01b8152600401610e35929190612461565b6000336104f88185856115e3565b60006104fe61137e610edc565b8360405161190160f01b8152600281019290925260228201526042902090565b600061075d7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98686866107988a6001600160a01b0316600090815260076020526040902080546001810190915590565b60008060006113fd85856119cf565b9150915061140a81611a3f565b509392505050565b600080600061142387878787611bfa565b9150915061143081611a3f565b5095945050505050565b600080829050601f81511115611465578260405163305a27a960e01b81526004016105dd9190611faa565b805161147082612482565b179392505050565b60606000825167ffffffffffffffff8111156114965761149661214b565b6040519080825280602002602001820160405280156114c957816020015b60608152602001906001900390816114b45790505b5090503360005b8451811015611565576115406040518060800160405280886001600160e01b0319168152602001306001600160a01b03168152602001878481518110611518576115186123bf565b60200260200101516001600160a01b03168152602001846001600160a01b0316815250611970565b838281518110611552576115526123bf565b60209081029190910101526001016114d0565b5090949350505050565b600061157b84846109a9565b9050600019811461110a57818110156115d65760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105dd565b61110a8484848403610bf5565b6001600160a01b0383166116475760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105dd565b6001600160a01b0382166116a95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105dd565b6001600160a01b038316600090815260208190526040902054818110156117215760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105dd565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361110a565b6001600160a01b0382166117dd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105dd565b80600260008282546117ef9190612328565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6040805180820190915260168152755f6275726e28616464726573732c75696e743235362960501b6020909101527f6161eb1814eb615e35a7abf22bf65277ce47a5a31644b90c2ab4d1570410a1e8826001600160a01b03811633146118b8576118b38261051e83611235565b6118c2565b6118c282826112c2565b61110a8484611ce7565b606060ff83146118df57610b5783611e19565b8180546118eb906122ed565b80601f0160208091040260200160405190810160405280929190818152602001828054611917906122ed565b80156119645780601f1061193957610100808354040283529160200191611964565b820191906000526020600020905b81548152906001019060200180831161194757829003601f168201915b505050505090506104fe565b6040805182516001600160e01b0319166020808301919091528301516001600160a01b039081168284015291830151821660608281019190915283810151909216608082015260a0016040516020818303038152906040529050919050565b600080825160411415611a065760208301516040840151606085015160001a6119fa87828585611bfa565b94509450505050611a38565b825160401415611a305760208301516040840151611a25868383611e58565b935093505050611a38565b506000905060025b9250929050565b6000816004811115611a5357611a536124a6565b1415611a5c5750565b6001816004811115611a7057611a706124a6565b1415611abe5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105dd565b6002816004811115611ad257611ad26124a6565b1415611b205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105dd565b6003816004811115611b3457611b346124a6565b1415611b8d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105dd565b6004816004811115611ba157611ba16124a6565b14156105fe5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105dd565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611c315750600090506003611cde565b8460ff16601b14158015611c4957508460ff16601c14155b15611c5a5750600090506004611cde565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611cae573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611cd757600060019250925050611cde565b9150600090505b94509492505050565b6001600160a01b038216611d475760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105dd565b6001600160a01b03821660009081526020819052604090205481811015611dbb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105dd565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b60606000611e2683611e91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806001600160ff1b03831681611e7560ff86901c601b612328565b9050611e8387828885611bfa565b935093505050935093915050565b600060ff8216601f8111156104fe57604051632cd44ac360e21b815260040160405180910390fd5b828054611ec5906122ed565b90600052602060002090601f016020900481019282611ee75760008555611f2d565b82601f10611f0057805160ff1916838001178555611f2d565b82800160010185558215611f2d579182015b82811115611f2d578251825591602001919060010190611f12565b50611f39929150611f3d565b5090565b5b80821115611f395760008155600101611f3e565b60005b83811015611f6d578181015183820152602001611f55565b8381111561110a5750506000910152565b60008151808452611f96816020860160208601611f52565b601f01601f19169290920160200192915050565b60208152600061107d6020830184611f7e565b80356001600160a01b0381168114611fd457600080fd5b919050565b60008060408385031215611fec57600080fd5b611ff583611fbd565b946020939093013593505050565b60008060006060848603121561201857600080fd5b61202184611fbd565b925061202f60208501611fbd565b9150604084013590509250925092565b60006020828403121561205157600080fd5b5035919050565b60006020828403121561206a57600080fd5b61107d82611fbd565b60ff60f81b881681526000602060e08184015261209360e084018a611f7e565b83810360408501526120a5818a611f7e565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156120f7578351835292840192918401916001016120db565b50909c9b505050505050505050505050565b6000806000806080858703121561211f57600080fd5b61212885611fbd565b935061213660208601611fbd565b93969395505050506040820135916060013590565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a0868803121561217957600080fd5b61218286611fbd565b945061219060208701611fbd565b93506040860135925060608601359150608086013567ffffffffffffffff808211156121bb57600080fd5b818801915088601f8301126121cf57600080fd5b8135818111156121e1576121e161214b565b604051601f8201601f19908116603f011681019083821181831017156122095761220961214b565b816040528281528b602084870101111561222257600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b600080600080600080600060e0888a03121561226257600080fd5b61226b88611fbd565b965061227960208901611fbd565b95506040880135945060608801359350608088013560ff8116811461229d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156122cd57600080fd5b6122d683611fbd565b91506122e460208401611fbd565b90509250929050565b600181811c9082168061230157607f821691505b6020821081141561232257634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561234957634e487b7160e01b600052601160045260246000fd5b500190565b60208082526022908201527f4e6967687443726f773a2073656e64657220686173206e6f742074686520726f6040820152616c6560f01b606082015260800190565b600083516123a2818460208801611f52565b8351908301906123b6818360208801611f52565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b8281101561243157605f1988870301845261241f868351611f7e565b95509284019290840190600101612403565b509398975050505050505050565b60006020828403121561245157600080fd5b8151801515811461107d57600080fd5b82815260406020820152600061247a6040830184611f7e565b949350505050565b805160208083015191908110156123225760001960209190910360031b1b16919050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220be83c7a89a61130f1f03fb111d60af92234b133447ceffd02adee9ccfd7d2fff64736f6c634300080a0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000604100d89f9eac0f0118dff40296232abe0283ca0000000000000000000000008d64dc8ffffb472f98ab3fbcf74f0684133d233200000000000000000000000000000000000000000000000000000000000000064d4f52494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064d4f52494f4e0000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101ce5760003560e01c806379cc679011610104578063bba76a05116100a2578063dd62ed3e11610071578063dd62ed3e146103f8578063f084219e1461040b578063f1d588c514610432578063f2fde38b1461044557600080fd5b8063bba76a05146103a6578063c39a717a146103b9578063c92fb947146103cc578063d505accf146103e557600080fd5b80638da5cb5b116100de5780638da5cb5b1461036757806395d89b4114610378578063a457c2d714610380578063a9059cbb1461039357600080fd5b806379cc6790146103265780637ecebe001461033957806384b0196e1461034c57600080fd5b8063395093511161017157806342f7022e1161014b57806342f7022e146102b257806347842663146102ce57806370a08231146102f5578063715018a61461031e57600080fd5b8063395093511461027757806340c10f191461028a57806342966c681461029f57600080fd5b806318160ddd116101ad57806318160ddd1461023b57806323b872dd1461024d578063313ce567146102605780633644e5151461026f57600080fd5b8062435da5146101d357806306fdde0314610203578063095ea7b314610218575b600080fd5b6009546101e6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61020b610458565b6040516101fa9190611faa565b61022b610226366004611fd9565b6104ea565b60405190151581526020016101fa565b6002545b6040519081526020016101fa565b61022b61025b366004612003565b610504565b604051601281526020016101fa565b61023f610539565b61022b610285366004611fd9565b610548565b61029d610298366004611fd9565b61056a565b005b61029d6102ad36600461203f565b6105f5565b61023f712734b3b43a21b937bbab30b634b230ba37b960711b81565b6101e67f0000000000000000000000008d64dc8ffffb472f98ab3fbcf74f0684133d233281565b61023f610303366004612058565b6001600160a01b031660009081526020819052604090205490565b61029d610601565b61029d610334366004611fd9565b610615565b61023f610347366004612058565b610623565b610354610641565b6040516101fa9796959493929190612073565b6008546001600160a01b03166101e6565b61020b610687565b61022b61038e366004611fd9565b610696565b61022b6103a1366004611fd9565b61071c565b61023f6103b4366004612109565b610766565b61029d6103c7366004612161565b6107eb565b61023f6e2734b3b43a21b937bba9b2ba3a32b960891b81565b61029d6103f3366004612247565b6108c8565b61023f6104063660046122ba565b6109a9565b61023f7f4d4f52494f4e4d696e746572000000000000000000000000000000000000000081565b61029d610440366004612058565b6109d4565b61029d610453366004612058565b610acc565b606060038054610467906122ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610493906122ed565b80156104e05780601f106104b5576101008083540402835291602001916104e0565b820191906000526020600020905b8154815290600101906020018083116104c357829003601f168201915b5050505050905090565b6000336104f8818585610bf5565b60019150505b92915050565b60006323b872dd60e01b84846105238361051e8484610d19565b610ddd565b61052e878787610ec3565b979650505050505050565b6000610543610edc565b905090565b6000336104f881858561055b83836109a9565b6105659190612328565b610bf5565b7f4d4f52494f4e4d696e746572000000000000000000000000000000000000000061059d6008546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806105c157506105c18133611007565b6105e65760405162461bcd60e51b81526004016105dd9061234e565b60405180910390fd5b6105f08383611084565b505050565b6105fe81611110565b50565b61060961111a565b6106136000611174565b565b61061f82826111c6565b5050565b6001600160a01b0381166000908152600760205260408120546104fe565b6000606080600080600060606106556111db565b61065d611208565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b606060048054610467906122ed565b600033816106a482866109a9565b9050838110156107045760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105dd565b6107118286868403610bf5565b506001949350505050565b600063a9059cbb60e01b836001600160a01b0381163314610749576107448261051e83611235565b610753565b61075382826112c2565b61075d8585611363565b95945050505050565b600061075d7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98686866107988a610623565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810184905260e00160405160208183030381529060405280519060200120611371565b8142111561083b5760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105dd565b600061085261084c8787878761139e565b836113ee565b9050856001600160a01b0316816001600160a01b0316146108b55760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105dd565b6108c0868686610bf5565b505050505050565b834211156109185760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105dd565b60006109316109298989898961139e565b858585611412565b9050876001600160a01b0316816001600160a01b0316146109945760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105dd565b61099f888888610bf5565b5050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6e2734b3b43a21b937bba9b2ba3a32b960891b6109f96008546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610a1d5750610a1d8133611007565b610a395760405162461bcd60e51b81526004016105dd9061234e565b816001600160a01b03811615801590610a5c57506000816001600160a01b03163b115b610aa85760405162461bcd60e51b815260206004820152601c60248201527f4e6967687443726f773a2061646472657373206973206e6f742043410000000060448201526064016105dd565b5050600980546001600160a01b0319166001600160a01b0392909216919091179055565b610ad461111a565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105dd565b6105fe81611174565b6000602083511015610b5e57610b578361143a565b90506104fe565b82828151610b6f9260200190611eb9565b5060ff90506104fe565b6000808383604051602001610b8f929190612390565b6040516020818303038152906040529050602081511115610be75760405162461bcd60e51b8152602060048201526012602482015271453a20737472696e6720746f6f206c6f6e6760701b60448201526064016105dd565b602001519392505050565b90565b6001600160a01b038316610c575760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105dd565b6001600160a01b038216610cb85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105dd565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b604080516003808252608082019092526060916020820183803683370190505090503381600081518110610d4f57610d4f6123bf565b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110610d8357610d836123bf565b60200260200101906001600160a01b031690816001600160a01b0316815250508181600281518110610db757610db76123bf565b60200260200101906001600160a01b031690816001600160a01b03168152505092915050565b6001600160a01b037f0000000000000000000000008d64dc8ffffb472f98ab3fbcf74f0684133d23321663afa960e36001610e188585611478565b6040518363ffffffff1660e01b8152600401610e359291906123d5565b602060405180830381865afa158015610e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e76919061243f565b1561061f5760405162461bcd60e51b815260206004820152601960248201527f5269736b47756172643a207269736b656420726571756573740000000000000060448201526064016105dd565b600033610ed185828561156f565b6107118585856115e3565b6000306001600160a01b037f000000000000000000000000732e6973595136976173af4a56eac99f52becc6e16148015610f3557507f000000000000000000000000000000000000000000000000000000000000045746145b15610f5f57507fdd107fc417392c08e0344ec656bdd68cf501b0681d5d4a2cf4329dda80b2f7f590565b610543604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f189405425793620db2158dabc1494e5cff340b21a6f60d1bac9fef49147d79c7918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600954604051632474521560e21b8152600481018490526001600160a01b03838116602483015260009216906391d1485490604401602060405180830381865afa158015611059573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107d919061243f565b9392505050565b6040805180820190915260168152755f6d696e7428616464726573732c75696e743235362960501b6020909101527f4e6ec2477b215d44bbbdd0f5815b8827188f1eb827c01cc00f7f983582322afa826001600160a01b03811633146110f6576110f18261051e83611235565b611100565b61110082826112c2565b61110a8484611787565b50505050565b6105fe3382611846565b6008546001600160a01b031633146106135760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105dd565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6111d182338361156f565b61061f8282611846565b60606105437f4d4f52494f4e000000000000000000000000000000000000000000000000000660056118cc565b60606105437f310000000000000000000000000000000000000000000000000000000000000160066118cc565b60408051600280825260608083018452926020830190803683370190505090503381600081518110611269576112696123bf565b60200260200101906001600160a01b031690816001600160a01b031681525050818160018151811061129d5761129d6123bf565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b6001600160a01b037f0000000000000000000000008d64dc8ffffb472f98ab3fbcf74f0684133d23321663d37c475160016113466040518060800160405280876001600160e01b0319168152602001306001600160a01b03168152602001866001600160a01b031681526020016113363390565b6001600160a01b03169052611970565b6040518363ffffffff1660e01b8152600401610e35929190612461565b6000336104f88185856115e3565b60006104fe61137e610edc565b8360405161190160f01b8152600281019290925260228201526042902090565b600061075d7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98686866107988a6001600160a01b0316600090815260076020526040902080546001810190915590565b60008060006113fd85856119cf565b9150915061140a81611a3f565b509392505050565b600080600061142387878787611bfa565b9150915061143081611a3f565b5095945050505050565b600080829050601f81511115611465578260405163305a27a960e01b81526004016105dd9190611faa565b805161147082612482565b179392505050565b60606000825167ffffffffffffffff8111156114965761149661214b565b6040519080825280602002602001820160405280156114c957816020015b60608152602001906001900390816114b45790505b5090503360005b8451811015611565576115406040518060800160405280886001600160e01b0319168152602001306001600160a01b03168152602001878481518110611518576115186123bf565b60200260200101516001600160a01b03168152602001846001600160a01b0316815250611970565b838281518110611552576115526123bf565b60209081029190910101526001016114d0565b5090949350505050565b600061157b84846109a9565b9050600019811461110a57818110156115d65760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105dd565b61110a8484848403610bf5565b6001600160a01b0383166116475760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105dd565b6001600160a01b0382166116a95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105dd565b6001600160a01b038316600090815260208190526040902054818110156117215760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105dd565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361110a565b6001600160a01b0382166117dd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105dd565b80600260008282546117ef9190612328565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6040805180820190915260168152755f6275726e28616464726573732c75696e743235362960501b6020909101527f6161eb1814eb615e35a7abf22bf65277ce47a5a31644b90c2ab4d1570410a1e8826001600160a01b03811633146118b8576118b38261051e83611235565b6118c2565b6118c282826112c2565b61110a8484611ce7565b606060ff83146118df57610b5783611e19565b8180546118eb906122ed565b80601f0160208091040260200160405190810160405280929190818152602001828054611917906122ed565b80156119645780601f1061193957610100808354040283529160200191611964565b820191906000526020600020905b81548152906001019060200180831161194757829003601f168201915b505050505090506104fe565b6040805182516001600160e01b0319166020808301919091528301516001600160a01b039081168284015291830151821660608281019190915283810151909216608082015260a0016040516020818303038152906040529050919050565b600080825160411415611a065760208301516040840151606085015160001a6119fa87828585611bfa565b94509450505050611a38565b825160401415611a305760208301516040840151611a25868383611e58565b935093505050611a38565b506000905060025b9250929050565b6000816004811115611a5357611a536124a6565b1415611a5c5750565b6001816004811115611a7057611a706124a6565b1415611abe5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105dd565b6002816004811115611ad257611ad26124a6565b1415611b205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105dd565b6003816004811115611b3457611b346124a6565b1415611b8d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105dd565b6004816004811115611ba157611ba16124a6565b14156105fe5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105dd565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611c315750600090506003611cde565b8460ff16601b14158015611c4957508460ff16601c14155b15611c5a5750600090506004611cde565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611cae573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611cd757600060019250925050611cde565b9150600090505b94509492505050565b6001600160a01b038216611d475760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105dd565b6001600160a01b03821660009081526020819052604090205481811015611dbb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105dd565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b60606000611e2683611e91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806001600160ff1b03831681611e7560ff86901c601b612328565b9050611e8387828885611bfa565b935093505050935093915050565b600060ff8216601f8111156104fe57604051632cd44ac360e21b815260040160405180910390fd5b828054611ec5906122ed565b90600052602060002090601f016020900481019282611ee75760008555611f2d565b82601f10611f0057805160ff1916838001178555611f2d565b82800160010185558215611f2d579182015b82811115611f2d578251825591602001919060010190611f12565b50611f39929150611f3d565b5090565b5b80821115611f395760008155600101611f3e565b60005b83811015611f6d578181015183820152602001611f55565b8381111561110a5750506000910152565b60008151808452611f96816020860160208601611f52565b601f01601f19169290920160200192915050565b60208152600061107d6020830184611f7e565b80356001600160a01b0381168114611fd457600080fd5b919050565b60008060408385031215611fec57600080fd5b611ff583611fbd565b946020939093013593505050565b60008060006060848603121561201857600080fd5b61202184611fbd565b925061202f60208501611fbd565b9150604084013590509250925092565b60006020828403121561205157600080fd5b5035919050565b60006020828403121561206a57600080fd5b61107d82611fbd565b60ff60f81b881681526000602060e08184015261209360e084018a611f7e565b83810360408501526120a5818a611f7e565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156120f7578351835292840192918401916001016120db565b50909c9b505050505050505050505050565b6000806000806080858703121561211f57600080fd5b61212885611fbd565b935061213660208601611fbd565b93969395505050506040820135916060013590565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a0868803121561217957600080fd5b61218286611fbd565b945061219060208701611fbd565b93506040860135925060608601359150608086013567ffffffffffffffff808211156121bb57600080fd5b818801915088601f8301126121cf57600080fd5b8135818111156121e1576121e161214b565b604051601f8201601f19908116603f011681019083821181831017156122095761220961214b565b816040528281528b602084870101111561222257600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b600080600080600080600060e0888a03121561226257600080fd5b61226b88611fbd565b965061227960208901611fbd565b95506040880135945060608801359350608088013560ff8116811461229d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156122cd57600080fd5b6122d683611fbd565b91506122e460208401611fbd565b90509250929050565b600181811c9082168061230157607f821691505b6020821081141561232257634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561234957634e487b7160e01b600052601160045260246000fd5b500190565b60208082526022908201527f4e6967687443726f773a2073656e64657220686173206e6f742074686520726f6040820152616c6560f01b606082015260800190565b600083516123a2818460208801611f52565b8351908301906123b6818360208801611f52565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b8281101561243157605f1988870301845261241f868351611f7e565b95509284019290840190600101612403565b509398975050505050505050565b60006020828403121561245157600080fd5b8151801515811461107d57600080fd5b82815260406020820152600061247a6040830184611f7e565b949350505050565b805160208083015191908110156123225760001960209190910360031b1b16919050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220be83c7a89a61130f1f03fb111d60af92234b133447ceffd02adee9ccfd7d2fff64736f6c634300080a0033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000604100d89f9eac0f0118dff40296232abe0283ca0000000000000000000000008d64dc8ffffb472f98ab3fbcf74f0684133d233200000000000000000000000000000000000000000000000000000000000000064d4f52494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064d4f52494f4e0000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): MORION
Arg [1] : symbol (string): MORION
Arg [2] : roleManager (address): 0x604100d89F9eaC0F0118dff40296232aBe0283ca
Arg [3] : riskManager (address): 0x8d64dC8fffFB472f98aB3FBcf74f0684133D2332

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 000000000000000000000000604100d89f9eac0f0118dff40296232abe0283ca
Arg [3] : 0000000000000000000000008d64dc8ffffb472f98ab3fbcf74f0684133d2332
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [5] : 4d4f52494f4e0000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [7] : 4d4f52494f4e0000000000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
view all blocks validated

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

OVERVIEW

MORION is a utility token minted by tokenizing the in-game item ‘Morion’ that can be used for crafting various items and for your character. Once the supply of a token reaches its Max Supply, minting is ceased for a while and it is resumed when its supply drops below its Max Supply.

Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.