POL Price: $0.44366 (+3.27%)
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Connect User253019282022-02-24 21:16:431064 days ago1645737403IN
0x284B8546...08382886F
0 POL0.0023051730.18355121
Disconnect User253018452022-02-24 21:12:291064 days ago1645737149IN
0x284B8546...08382886F
0 POL0.0016406530.1835512
Connect User251692622022-02-20 21:54:051068 days ago1645394045IN
0x284B8546...08382886F
0 POL0.0025202833.0001
Connect User250050072022-02-16 9:43:551073 days ago1645004635IN
0x284B8546...08382886F
0 POL0.0024972132.68948362
Connect User249838012022-02-15 20:48:301073 days ago1644958110IN
0x284B8546...08382886F
0 POL0.000229052.99916155
Connect User249837212022-02-15 20:43:501073 days ago1644957830IN
0x284B8546...08382886F
0 POL0.0023000730.10880002
Connect User249828302022-02-15 20:10:421073 days ago1644955842IN
0x284B8546...08382886F
0 POL0.0018041423.62316751
Connect User249828192022-02-15 20:10:201073 days ago1644955820IN
0x284B8546...08382886F
0 POL0.0022281929.16790001
Connect User249827932022-02-15 20:09:281073 days ago1644955768IN
0x284B8546...08382886F
0 POL0.002297130.06999999
Connect User249827702022-02-15 20:08:381073 days ago1644955718IN
0x284B8546...08382886F
0 POL0.0022961430.06999999
Connect User249806192022-02-15 18:52:221073 days ago1644951142IN
0x284B8546...08382886F
0 POL0.0022732229.76205237
Connect User249804132022-02-15 18:42:341073 days ago1644950554IN
0x284B8546...08382886F
0 POL0.0018682924.46308814
Connect User249804022022-02-15 18:42:111073 days ago1644950531IN
0x284B8546...08382886F
0 POL0.0020222626.47919937
Connect User249803962022-02-15 18:41:591073 days ago1644950519IN
0x284B8546...08382886F
0 POL0.0020964827.45669704
Connect User249803882022-02-15 18:41:431073 days ago1644950503IN
0x284B8546...08382886F
0 POL0.002265329.65362997
Connect User249803832022-02-15 18:41:331073 days ago1644950493IN
0x284B8546...08382886F
0 POL0.0022684129.7022401
Connect User249803712022-02-15 18:41:091073 days ago1644950469IN
0x284B8546...08382886F
0 POL0.0023156930.32129165
Connect User249803642022-02-15 18:40:551073 days ago1644950455IN
0x284B8546...08382886F
0 POL0.0023154130.31437254
Connect User249803602022-02-15 18:40:471073 days ago1644950447IN
0x284B8546...08382886F
0 POL0.002314730.30514473
Connect User249803542022-02-15 18:40:351073 days ago1644950435IN
0x284B8546...08382886F
0 POL0.0023138830.29443988
Connect User249803462022-02-15 18:40:151073 days ago1644950415IN
0x284B8546...08382886F
0 POL0.0023166130.32542436
Connect User249803432022-02-15 18:40:091073 days ago1644950409IN
0x284B8546...08382886F
0 POL0.0023170230.34029746
Connect User249803372022-02-15 18:39:571073 days ago1644950397IN
0x284B8546...08382886F
0 POL0.0023193430.36899378
Connect User249803342022-02-15 18:39:511073 days ago1644950391IN
0x284B8546...08382886F
0 POL0.0023199830.38702163
Connect User249803222022-02-15 18:39:271073 days ago1644950367IN
0x284B8546...08382886F
0 POL0.0023242630.43828366
View all transactions

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

Contract Source Code Verified (Exact Match)

Contract Name:
SystemCheckerV2

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : SystemCheckerV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./RolesAndKeys.sol";

/**
Cool Cats contract structure allows members of the community the ability to create their own
contracts for things like quests, adventures, battles, anything really. As long as a contract
is audited and determined to be safe it simply needs to adopt the conventions within systemChecker.
It can then be plugged in/removed by the admins - Have fun coming up with new features :)
*/
contract SystemCheckerV2 is RolesAndKeys, AccessControl {
  using ECDSA for bytes32;

  // serves as a single reference point for all other contracts to get the
  // latest approved addresses of the system
  mapping(bytes32 => address) _safeAddresses;

  mapping(address => bool) _users;

  mapping(address => mapping(uint256 => bool)) _usedNonces;

  event LogUserConnected(address user);
  event LogUserDisconnected(address user);

  constructor() {
    _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    _setupRole(MASTER_ROLE, _msgSender());

    _setupRole(ADMIN_ROLE, _msgSender());
    _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);

    _setupRole(CONTRACT_ROLE, _msgSender());
    _setRoleAdmin(CONTRACT_ROLE, ADMIN_ROLE);

    _setupRole(GAME_ROLE, _msgSender());
    _setRoleAdmin(GAME_ROLE, ADMIN_ROLE);

    _setupRole(TREASURY_ROLE, _msgSender());
    _setRoleAdmin(TREASURY_ROLE, ADMIN_ROLE);

    _safeAddresses[SYSTEM_KEY_BYTES] = _msgSender();
  }

  /// @notice Does address have permissions for the desired role
  /// @param role Role to check
  /// @param account Address being checked
  function hasPermission(bytes32 role, address account) external view {
    require(hasRole(role, account), "SC: Invalid transaction source");
  }

  /// @notice External check if address is connected
  /// @param user Address to check
  /// @return bool Returns boolean after checking _users mapping
  function isConnected(address user) external view returns (bool) {
    return _users[user];
  }

  /// @notice Check if a user is part of the system
  /// @param user Address to check
  function isUser(address user) external view {
    require(_users[user] == true, "SC: Not a user");
  }

  /// @notice Connect user from the system
  /// @param user Address of user to disconnect
  /// @param nonce Salt for hash and security
  /// @param signature Signed data sig
  function connectUser(address user, uint256 nonce, bytes memory signature) external onlyRole(GAME_ROLE) {
    bytes32 msgHash = keccak256(abi.encodePacked(user, nonce));
    require(
      _isValidSignature(msgHash, user, signature),
      "SC: Invalid signature"
    );
    require(!_usedNonces[user][nonce], "SC: Nonce already used");
    _usedNonces[user][nonce] = true;
    _users[user] = true;

    emit LogUserConnected(user);
  }

  /// @notice Disconnect user from the system
  /// @param user Address of user to disconnect
  /// @param nonce Salt for hash and security
  /// @param signature Signed data sig
  function disconnectUser(address user, uint256 nonce, bytes memory signature) external onlyRole(GAME_ROLE) {
    bytes32 msgHash = keccak256(abi.encodePacked(user, nonce));
    require(
      _isValidSignature(msgHash, user, signature),
      "SC: Invalid signature"
    );
    require(!_usedNonces[user][nonce], "SC: Nonce already used");
    _usedNonces[user][nonce] = true;
    _users[user] = false;

    emit LogUserDisconnected(user);
  }

  /// @notice see {_setRoleAdmin} - AccessControl.sol}
  /// @dev Acts as both getter and setter
  /// @param role Key of role being targeted
  function setRoleAdmin(bytes32 role) external onlyRole(MASTER_ROLE) {
    _setRoleAdmin(role, ADMIN_ROLE);
  }

  /// @notice see {_setRoleAdmin} - AccessControl.sol}
  /// @dev Sets ADMIN_ROLE as the administrator for the desired role
  /// @param role Key of role being targeted
  function createNewRole(bytes32 role) external onlyRole(MASTER_ROLE) {
    _setupRole(role, _msgSender());
    _setRoleAdmin(role, ADMIN_ROLE);
  }

  /// @notice Set the system address
  /// @dev Address of the `system` wallet
  /// @param key Address identifier
  /// @param safeAddress Address to add
  function setSafeAddress(bytes32 key, address safeAddress) external onlyRole(ADMIN_ROLE) {
    _safeAddresses[key] = safeAddress;
  }

  /// @notice see {_setRoleAdmin} - AccessControl.sol}
  /// @dev Sets ADMIN_ROLE as the administrator for the desired role
  /// @param key Key of role being targeted
  function deleteSafeAddress(bytes32 key) external onlyRole(ADMIN_ROLE) {
    require(_safeAddresses[key] != address(0), "SC: Key doesnt exist");
    delete _safeAddresses[key];
  }

  /// @notice Query the current systemAddress
  /// @param key Address identifier
  /// @return address Address of the gaming system
  function getSafeAddress(bytes32 key) external view returns (address) {
    require(_safeAddresses[key] != address(0), "SC: Key doesnt exist");
    return _safeAddresses[key];
  }

  /// @notice Verify that a signature if valid
  /// @param hash Hashed data to validate
  /// @return address Address of the gaming system
  function _isValidSignature(
    bytes32 hash,
    address user,
    bytes memory signature
  ) internal pure returns (bool) {
    bytes32 signedHash = hash.toEthSignedMessageHash();
    return signedHash.recover(signature) == user;
  }
}

File 2 of 9 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

File 4 of 9 : RolesAndKeys.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/utils/Context.sol';

abstract contract RolesAndKeys is Context {
    // ROLES
    bytes32 constant MASTER_ROLE = keccak256("MASTER_ROLE");
    bytes32 constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 constant GAME_ROLE = keccak256("GAME_ROLE");
    bytes32 constant CONTRACT_ROLE = keccak256("CONTRACT_ROLE");
    bytes32 constant TREASURY_ROLE = keccak256("TREASURY_ROLE");

    // KEYS
    bytes32 constant MARKETPLACE_KEY_BYTES = keccak256("MARKETPLACE");
    bytes32 constant SYSTEM_KEY_BYTES = keccak256("SYSTEM");
    bytes32 constant QUEST_KEY_BYTES = keccak256("QUEST");
    bytes32 constant BATTLE_KEY_BYTES = keccak256("BATTLE");
    bytes32 constant HOUSE_KEY_BYTES = keccak256("HOUSE");
    bytes32 constant QUEST_GUILD_KEY_BYTES = keccak256("QUEST_GUILD");

    // COMMON
    bytes32 constant public PET_BYTES = 0x5065740000000000000000000000000000000000000000000000000000000000;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"LogUserConnected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"LogUserDisconnected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PET_BYTES","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"connectUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"createNewRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"deleteSafeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"disconnectUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"getSafeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasPermission","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"isConnected","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"isUser","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"setRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"address","name":"safeAddress","type":"address"}],"name":"setSafeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506200001f600033620001b0565b6200004b7f8b8c0776df2c2176edf6f82391c35ea4891146d7a976ee36fd07f1a6fb4ead4c33620001b0565b620000666000805160206200177983398151915233620001b0565b620000816000805160206200177983398151915280620001c0565b6200009c600080516020620017b983398151915233620001b0565b620000c6600080516020620017b983398151915260008051602062001779833981519152620001c0565b620000e16000805160206200175983398151915233620001b0565b6200010b6000805160206200175983398151915260008051602062001779833981519152620001c0565b620001266000805160206200179983398151915233620001b0565b620001506000805160206200179983398151915260008051602062001779833981519152620001c0565b7f1d7d8843f0c1e1a93c132cfc3744403b38e2dc280a9cbff83c6f1219b210cf0260005260016020527ff331d49c5e6cb772372abaf27eb6d409991e0df4db63db45024773165fa9c5c280546001600160a01b03191633179055620002ab565b620001bc82826200020b565b5050565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001bc576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002673390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61149e80620002bb6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806387ce05ae116100a2578063d547741f11610071578063d547741f14610255578063d54af94b14610268578063dd03d05a14610275578063e251f59514610288578063f3e0675e146102b357600080fd5b806387ce05ae146101fb57806391d148541461020e578063a217fddf14610221578063cce662bf1461022957600080fd5b806336568abe116100e957806336568abe1461019c5780634209fff1146101af5780634791fd54146101c25780634ab585e2146101d55780634c1c639f146101e857600080fd5b806301ffc9a71461011b578063248a9ca31461014357806328545c0d146101745780632f2ff15d14610189575b600080fd5b61012e6101293660046112ee565b6102c6565b60405190151581526020015b60405180910390f35b6101666101513660046112ab565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101876101823660046112c3565b6102fd565b005b6101876101973660046112c3565b61035c565b6101876101aa3660046112c3565b610387565b6101876101bd3660046111cb565b610401565b6101876101d03660046112ab565b610462565b6101876101e33660046112ab565b6104c1565b6101876101f63660046112ab565b6104ec565b6101876102093660046111e5565b610591565b61012e61021c3660046112c3565b610735565b610166600081565b61012e6102373660046111cb565b6001600160a01b031660009081526002602052604090205460ff1690565b6101876102633660046112c3565b61075e565b6101666214195d60ea1b81565b6101876102833660046112c3565b610784565b61029b6102963660046112ab565b6107de565b6040516001600160a01b03909116815260200161013a565b6101876102c13660046111e5565b610855565b60006001600160e01b03198216637965db0b60e01b14806102f757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6103078282610735565b6103585760405162461bcd60e51b815260206004820152601e60248201527f53433a20496e76616c6964207472616e73616374696f6e20736f75726365000060448201526064015b60405180910390fd5b5050565b60008281526020819052604090206001015461037881336109f0565b6103828383610a54565b505050565b6001600160a01b03811633146103f75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161034f565b6103588282610ad8565b6001600160a01b03811660009081526002602052604090205460ff16151560011461045f5760405162461bcd60e51b815260206004820152600e60248201526d29a19d102737ba1030903ab9b2b960911b604482015260640161034f565b50565b7f8b8c0776df2c2176edf6f82391c35ea4891146d7a976ee36fd07f1a6fb4ead4c61048d81336109f0565b6104978233610b3d565b610358827fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610b47565b7f8b8c0776df2c2176edf6f82391c35ea4891146d7a976ee36fd07f1a6fb4ead4c61049781336109f0565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561051781336109f0565b6000828152600160205260409020546001600160a01b03166105725760405162461bcd60e51b815260206004820152601460248201527314d0ce8812d95e48191bd95cdb9d08195e1a5cdd60621b604482015260640161034f565b50600090815260016020526040902080546001600160a01b0319169055565b7f6a64baf327d646d1bca72653e2a075d15fd6ac6d8cbd7f6ee03fc55875e0fa886105bc81336109f0565b6040516bffffffffffffffffffffffff19606086901b16602082015260348101849052600090605401604051602081830303815290604052805190602001209050610608818685610b92565b61064c5760405162461bcd60e51b815260206004820152601560248201527453433a20496e76616c6964207369676e617475726560581b604482015260640161034f565b6001600160a01b038516600090815260036020908152604080832087845290915290205460ff16156106b95760405162461bcd60e51b815260206004820152601660248201527514d0ce88139bdb98d948185b1c9958591e481d5cd95960521b604482015260640161034f565b6001600160a01b038516600081815260036020908152604080832088845282528083208054600160ff19918216179091558484526002835292819020805490931690925590519182527fbeb41f609d6df4ac68297caa2b92a77cabc866a0134ebb0e734f6ef01b47951891015b60405180910390a15050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008281526020819052604090206001015461077a81336109f0565b6103828383610ad8565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756107af81336109f0565b5060009182526001602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000818152600160205260408120546001600160a01b03166108395760405162461bcd60e51b815260206004820152601460248201527314d0ce8812d95e48191bd95cdb9d08195e1a5cdd60621b604482015260640161034f565b506000908152600160205260409020546001600160a01b031690565b7f6a64baf327d646d1bca72653e2a075d15fd6ac6d8cbd7f6ee03fc55875e0fa8861088081336109f0565b6040516bffffffffffffffffffffffff19606086901b166020820152603481018490526000906054016040516020818303038152906040528051906020012090506108cc818685610b92565b6109105760405162461bcd60e51b815260206004820152601560248201527453433a20496e76616c6964207369676e617475726560581b604482015260640161034f565b6001600160a01b038516600090815260036020908152604080832087845290915290205460ff161561097d5760405162461bcd60e51b815260206004820152601660248201527514d0ce88139bdb98d948185b1c9958591e481d5cd95960521b604482015260640161034f565b6001600160a01b038516600081815260036020908152604080832088845282528083208054600160ff199182168117909255858552600284529382902080549094161790925590519182527fe80db9f0d2e2c93164e35b0b79b80b840cf47a30f7a9d6c21c1a8516e83707f79101610726565b6109fa8282610735565b61035857610a12816001600160a01b03166014610c15565b610a1d836020610c15565b604051602001610a2e929190611316565b60408051601f198184030181529082905262461bcd60e51b825261034f9160040161138b565b610a5e8282610735565b610358576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a943390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610ae28282610735565b15610358576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6103588282610a54565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b600080610bec856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506001600160a01b038416610c028285610dfe565b6001600160a01b03161495945050505050565b60606000610c248360026113d6565b610c2f9060026113be565b67ffffffffffffffff811115610c5557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610c7f576020820181803683370190505b509050600360fc1b81600081518110610ca857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610ce557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000610d098460026113d6565b610d149060016113be565b90505b6001811115610da8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610d5657634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110610d7a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93610da181611425565b9050610d17565b508315610df75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034f565b9392505050565b6000806000610e0d8585610e22565b91509150610e1a81610e92565b509392505050565b600080825160411415610e595760208301516040840151606085015160001a610e4d87828585611093565b94509450505050610e8b565b825160401415610e835760208301516040840151610e78868383611180565b935093505050610e8b565b506000905060025b9250929050565b6000816004811115610eb457634e487b7160e01b600052602160045260246000fd5b1415610ebd5750565b6001816004811115610edf57634e487b7160e01b600052602160045260246000fd5b1415610f2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161034f565b6002816004811115610f4f57634e487b7160e01b600052602160045260246000fd5b1415610f9d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161034f565b6003816004811115610fbf57634e487b7160e01b600052602160045260246000fd5b14156110185760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161034f565b600481600481111561103a57634e487b7160e01b600052602160045260246000fd5b141561045f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161034f565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156110ca5750600090506003611177565b8460ff16601b141580156110e257508460ff16601c14155b156110f35750600090506004611177565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611147573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661117057600060019250925050611177565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016111a187828885611093565b935093505050935093915050565b80356001600160a01b03811681146111c657600080fd5b919050565b6000602082840312156111dc578081fd5b610df7826111af565b6000806000606084860312156111f9578182fd5b611202846111af565b925060208401359150604084013567ffffffffffffffff80821115611225578283fd5b818601915086601f830112611238578283fd5b81358181111561124a5761124a611452565b604051601f8201601f19908116603f0116810190838211818310171561127257611272611452565b8160405282815289602084870101111561128a578586fd5b82602086016020830137856020848301015280955050505050509250925092565b6000602082840312156112bc578081fd5b5035919050565b600080604083850312156112d5578182fd5b823591506112e5602084016111af565b90509250929050565b6000602082840312156112ff578081fd5b81356001600160e01b031981168114610df7578182fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161134e8160178501602088016113f5565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161137f8160288401602088016113f5565b01602801949350505050565b60208152600082518060208401526113aa8160408501602087016113f5565b601f01601f19169190910160400192915050565b600082198211156113d1576113d161143c565b500190565b60008160001904831182151516156113f0576113f061143c565b500290565b60005b838110156114105781810151838201526020016113f8565b8381111561141f576000848401525b50505050565b6000816114345761143461143c565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212208c985dc08718aff6cc94896b1b70e1a5a82c6b397ace10635125d83d44ea8b7764736f6c634300080400336a64baf327d646d1bca72653e2a075d15fd6ac6d8cbd7f6ee03fc55875e0fa88a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775e1dcbdb91df27212a29bc27177c840cf2f819ecf2187432e1fac86c2dd5dfca9364d3d7565c7a8300c96fd53e065d19b65848d7b23b3191adcd55621c744223c

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101165760003560e01c806387ce05ae116100a2578063d547741f11610071578063d547741f14610255578063d54af94b14610268578063dd03d05a14610275578063e251f59514610288578063f3e0675e146102b357600080fd5b806387ce05ae146101fb57806391d148541461020e578063a217fddf14610221578063cce662bf1461022957600080fd5b806336568abe116100e957806336568abe1461019c5780634209fff1146101af5780634791fd54146101c25780634ab585e2146101d55780634c1c639f146101e857600080fd5b806301ffc9a71461011b578063248a9ca31461014357806328545c0d146101745780632f2ff15d14610189575b600080fd5b61012e6101293660046112ee565b6102c6565b60405190151581526020015b60405180910390f35b6101666101513660046112ab565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101876101823660046112c3565b6102fd565b005b6101876101973660046112c3565b61035c565b6101876101aa3660046112c3565b610387565b6101876101bd3660046111cb565b610401565b6101876101d03660046112ab565b610462565b6101876101e33660046112ab565b6104c1565b6101876101f63660046112ab565b6104ec565b6101876102093660046111e5565b610591565b61012e61021c3660046112c3565b610735565b610166600081565b61012e6102373660046111cb565b6001600160a01b031660009081526002602052604090205460ff1690565b6101876102633660046112c3565b61075e565b6101666214195d60ea1b81565b6101876102833660046112c3565b610784565b61029b6102963660046112ab565b6107de565b6040516001600160a01b03909116815260200161013a565b6101876102c13660046111e5565b610855565b60006001600160e01b03198216637965db0b60e01b14806102f757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6103078282610735565b6103585760405162461bcd60e51b815260206004820152601e60248201527f53433a20496e76616c6964207472616e73616374696f6e20736f75726365000060448201526064015b60405180910390fd5b5050565b60008281526020819052604090206001015461037881336109f0565b6103828383610a54565b505050565b6001600160a01b03811633146103f75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161034f565b6103588282610ad8565b6001600160a01b03811660009081526002602052604090205460ff16151560011461045f5760405162461bcd60e51b815260206004820152600e60248201526d29a19d102737ba1030903ab9b2b960911b604482015260640161034f565b50565b7f8b8c0776df2c2176edf6f82391c35ea4891146d7a976ee36fd07f1a6fb4ead4c61048d81336109f0565b6104978233610b3d565b610358827fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610b47565b7f8b8c0776df2c2176edf6f82391c35ea4891146d7a976ee36fd07f1a6fb4ead4c61049781336109f0565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561051781336109f0565b6000828152600160205260409020546001600160a01b03166105725760405162461bcd60e51b815260206004820152601460248201527314d0ce8812d95e48191bd95cdb9d08195e1a5cdd60621b604482015260640161034f565b50600090815260016020526040902080546001600160a01b0319169055565b7f6a64baf327d646d1bca72653e2a075d15fd6ac6d8cbd7f6ee03fc55875e0fa886105bc81336109f0565b6040516bffffffffffffffffffffffff19606086901b16602082015260348101849052600090605401604051602081830303815290604052805190602001209050610608818685610b92565b61064c5760405162461bcd60e51b815260206004820152601560248201527453433a20496e76616c6964207369676e617475726560581b604482015260640161034f565b6001600160a01b038516600090815260036020908152604080832087845290915290205460ff16156106b95760405162461bcd60e51b815260206004820152601660248201527514d0ce88139bdb98d948185b1c9958591e481d5cd95960521b604482015260640161034f565b6001600160a01b038516600081815260036020908152604080832088845282528083208054600160ff19918216179091558484526002835292819020805490931690925590519182527fbeb41f609d6df4ac68297caa2b92a77cabc866a0134ebb0e734f6ef01b47951891015b60405180910390a15050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008281526020819052604090206001015461077a81336109f0565b6103828383610ad8565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756107af81336109f0565b5060009182526001602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000818152600160205260408120546001600160a01b03166108395760405162461bcd60e51b815260206004820152601460248201527314d0ce8812d95e48191bd95cdb9d08195e1a5cdd60621b604482015260640161034f565b506000908152600160205260409020546001600160a01b031690565b7f6a64baf327d646d1bca72653e2a075d15fd6ac6d8cbd7f6ee03fc55875e0fa8861088081336109f0565b6040516bffffffffffffffffffffffff19606086901b166020820152603481018490526000906054016040516020818303038152906040528051906020012090506108cc818685610b92565b6109105760405162461bcd60e51b815260206004820152601560248201527453433a20496e76616c6964207369676e617475726560581b604482015260640161034f565b6001600160a01b038516600090815260036020908152604080832087845290915290205460ff161561097d5760405162461bcd60e51b815260206004820152601660248201527514d0ce88139bdb98d948185b1c9958591e481d5cd95960521b604482015260640161034f565b6001600160a01b038516600081815260036020908152604080832088845282528083208054600160ff199182168117909255858552600284529382902080549094161790925590519182527fe80db9f0d2e2c93164e35b0b79b80b840cf47a30f7a9d6c21c1a8516e83707f79101610726565b6109fa8282610735565b61035857610a12816001600160a01b03166014610c15565b610a1d836020610c15565b604051602001610a2e929190611316565b60408051601f198184030181529082905262461bcd60e51b825261034f9160040161138b565b610a5e8282610735565b610358576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a943390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610ae28282610735565b15610358576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6103588282610a54565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b600080610bec856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506001600160a01b038416610c028285610dfe565b6001600160a01b03161495945050505050565b60606000610c248360026113d6565b610c2f9060026113be565b67ffffffffffffffff811115610c5557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610c7f576020820181803683370190505b509050600360fc1b81600081518110610ca857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610ce557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000610d098460026113d6565b610d149060016113be565b90505b6001811115610da8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610d5657634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110610d7a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93610da181611425565b9050610d17565b508315610df75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034f565b9392505050565b6000806000610e0d8585610e22565b91509150610e1a81610e92565b509392505050565b600080825160411415610e595760208301516040840151606085015160001a610e4d87828585611093565b94509450505050610e8b565b825160401415610e835760208301516040840151610e78868383611180565b935093505050610e8b565b506000905060025b9250929050565b6000816004811115610eb457634e487b7160e01b600052602160045260246000fd5b1415610ebd5750565b6001816004811115610edf57634e487b7160e01b600052602160045260246000fd5b1415610f2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161034f565b6002816004811115610f4f57634e487b7160e01b600052602160045260246000fd5b1415610f9d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161034f565b6003816004811115610fbf57634e487b7160e01b600052602160045260246000fd5b14156110185760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161034f565b600481600481111561103a57634e487b7160e01b600052602160045260246000fd5b141561045f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161034f565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156110ca5750600090506003611177565b8460ff16601b141580156110e257508460ff16601c14155b156110f35750600090506004611177565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611147573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661117057600060019250925050611177565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016111a187828885611093565b935093505050935093915050565b80356001600160a01b03811681146111c657600080fd5b919050565b6000602082840312156111dc578081fd5b610df7826111af565b6000806000606084860312156111f9578182fd5b611202846111af565b925060208401359150604084013567ffffffffffffffff80821115611225578283fd5b818601915086601f830112611238578283fd5b81358181111561124a5761124a611452565b604051601f8201601f19908116603f0116810190838211818310171561127257611272611452565b8160405282815289602084870101111561128a578586fd5b82602086016020830137856020848301015280955050505050509250925092565b6000602082840312156112bc578081fd5b5035919050565b600080604083850312156112d5578182fd5b823591506112e5602084016111af565b90509250929050565b6000602082840312156112ff578081fd5b81356001600160e01b031981168114610df7578182fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161134e8160178501602088016113f5565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161137f8160288401602088016113f5565b01602801949350505050565b60208152600082518060208401526113aa8160408501602087016113f5565b601f01601f19169190910160400192915050565b600082198211156113d1576113d161143c565b500190565b60008160001904831182151516156113f0576113f061143c565b500290565b60005b838110156114105781810151838201526020016113f8565b8381111561141f576000848401525b50505050565b6000816114345761143461143c565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212208c985dc08718aff6cc94896b1b70e1a5a82c6b397ace10635125d83d44ea8b7764736f6c63430008040033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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