ETH Price: $2,917.42 (+4.04%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Rescue NFT204092262024-07-29 2:26:23102 days ago1722219983IN
0x217B53F8...2018d70f2
0 ETH0.000079371.96327706
Rescue NFT204092232024-07-29 2:25:47102 days ago1722219947IN
0x217B53F8...2018d70f2
0 ETH0.000097561.94156724
Rescue NFT204092232024-07-29 2:25:47102 days ago1722219947IN
0x217B53F8...2018d70f2
0 ETH0.000106881.94156724
Rescue NFT204092222024-07-29 2:25:35102 days ago1722219935IN
0x217B53F8...2018d70f2
0 ETH0.000105711.92032886
Rescue NFT204092222024-07-29 2:25:35102 days ago1722219935IN
0x217B53F8...2018d70f2
0 ETH0.000105711.92032886
Rescue NFT204092222024-07-29 2:25:35102 days ago1722219935IN
0x217B53F8...2018d70f2
0 ETH0.000077631.92032886
Rescue NFT204092062024-07-29 2:22:23102 days ago1722219743IN
0x217B53F8...2018d70f2
0 ETH0.000073061.80727286
Rescue NFT204092042024-07-29 2:21:47102 days ago1722219707IN
0x217B53F8...2018d70f2
0 ETH0.000094411.71504454
Rescue NFT204092042024-07-29 2:21:47102 days ago1722219707IN
0x217B53F8...2018d70f2
0 ETH0.000094411.71504454
Rescue NFT204092032024-07-29 2:21:35102 days ago1722219695IN
0x217B53F8...2018d70f2
0 ETH0.000085251.54852869
Rescue NFT204092022024-07-29 2:21:23102 days ago1722219683IN
0x217B53F8...2018d70f2
0 ETH0.000084411.53338079
Rescue NFT204091962024-07-29 2:20:11102 days ago1722219611IN
0x217B53F8...2018d70f2
0 ETH0.000084241.5301897
Rescue NFT204091952024-07-29 2:19:59102 days ago1722219599IN
0x217B53F8...2018d70f2
0 ETH0.000086021.56263009
Rescue NFT204091952024-07-29 2:19:59102 days ago1722219599IN
0x217B53F8...2018d70f2
0 ETH0.000086021.56263009
Rescue NFT204091942024-07-29 2:19:47102 days ago1722219587IN
0x217B53F8...2018d70f2
0 ETH0.00008571.5567974
Rescue NFT204091942024-07-29 2:19:47102 days ago1722219587IN
0x217B53F8...2018d70f2
0 ETH0.00008571.5567974
Rescue NFT204091932024-07-29 2:19:35102 days ago1722219575IN
0x217B53F8...2018d70f2
0 ETH0.000086181.56556028
Rescue NFT204091922024-07-29 2:19:23102 days ago1722219563IN
0x217B53F8...2018d70f2
0 ETH0.000087661.59231287
Rescue NFT204091912024-07-29 2:19:11102 days ago1722219551IN
0x217B53F8...2018d70f2
0 ETH0.000083011.50785832
Rescue NFT204091912024-07-29 2:19:11102 days ago1722219551IN
0x217B53F8...2018d70f2
0 ETH0.000083011.50785832
Rescue NFT204091902024-07-29 2:18:59102 days ago1722219539IN
0x217B53F8...2018d70f2
0 ETH0.000081251.47596494
Rescue NFT204091892024-07-29 2:18:47102 days ago1722219527IN
0x217B53F8...2018d70f2
0 ETH0.000079621.44630569
Rescue NFT204091892024-07-29 2:18:47102 days ago1722219527IN
0x217B53F8...2018d70f2
0 ETH0.000079621.44630569
Rescue NFT204091892024-07-29 2:18:47102 days ago1722219527IN
0x217B53F8...2018d70f2
0 ETH0.000079621.44630569
Rescue NFT204091892024-07-29 2:18:47102 days ago1722219527IN
0x217B53F8...2018d70f2
0 ETH0.000079041.43574912
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
204092262024-07-29 2:26:23102 days ago1722219983
0x217B53F8...2018d70f2
0 ETH
204092232024-07-29 2:25:47102 days ago1722219947
0x217B53F8...2018d70f2
0 ETH
204092232024-07-29 2:25:47102 days ago1722219947
0x217B53F8...2018d70f2
0 ETH
204092222024-07-29 2:25:35102 days ago1722219935
0x217B53F8...2018d70f2
0 ETH
204092222024-07-29 2:25:35102 days ago1722219935
0x217B53F8...2018d70f2
0 ETH
204092222024-07-29 2:25:35102 days ago1722219935
0x217B53F8...2018d70f2
0 ETH
204092062024-07-29 2:22:23102 days ago1722219743
0x217B53F8...2018d70f2
0 ETH
204092042024-07-29 2:21:47102 days ago1722219707
0x217B53F8...2018d70f2
0 ETH
204092042024-07-29 2:21:47102 days ago1722219707
0x217B53F8...2018d70f2
0 ETH
204092032024-07-29 2:21:35102 days ago1722219695
0x217B53F8...2018d70f2
0 ETH
204092022024-07-29 2:21:23102 days ago1722219683
0x217B53F8...2018d70f2
0 ETH
204091962024-07-29 2:20:11102 days ago1722219611
0x217B53F8...2018d70f2
0 ETH
204091952024-07-29 2:19:59102 days ago1722219599
0x217B53F8...2018d70f2
0 ETH
204091952024-07-29 2:19:59102 days ago1722219599
0x217B53F8...2018d70f2
0 ETH
204091942024-07-29 2:19:47102 days ago1722219587
0x217B53F8...2018d70f2
0 ETH
204091942024-07-29 2:19:47102 days ago1722219587
0x217B53F8...2018d70f2
0 ETH
204091932024-07-29 2:19:35102 days ago1722219575
0x217B53F8...2018d70f2
0 ETH
204091922024-07-29 2:19:23102 days ago1722219563
0x217B53F8...2018d70f2
0 ETH
204091912024-07-29 2:19:11102 days ago1722219551
0x217B53F8...2018d70f2
0 ETH
204091912024-07-29 2:19:11102 days ago1722219551
0x217B53F8...2018d70f2
0 ETH
204091902024-07-29 2:18:59102 days ago1722219539
0x217B53F8...2018d70f2
0 ETH
204091892024-07-29 2:18:47102 days ago1722219527
0x217B53F8...2018d70f2
0 ETH
204091892024-07-29 2:18:47102 days ago1722219527
0x217B53F8...2018d70f2
0 ETH
204091892024-07-29 2:18:47102 days ago1722219527
0x217B53F8...2018d70f2
0 ETH
204091892024-07-29 2:18:47102 days ago1722219527
0x217B53F8...2018d70f2
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PixelmonStaking

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 13 : PixelmonStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";

/// @notice Thrown when invalid destination address specified (address(0) or address(this))
error InvalidAddress();
/// @notice Thrown when provided token does not belongs to function caller
error NotAnOwner();
/// @notice Thrown when input array length limits exceeded or input array is empty
error InvalidInputArrayLength();
/// @notice Thrown when caller tries to stake token which has already been staked
error TokenWasStaked();
/// @notice Thrown when staking lock period not yet passed
error TokenLocked();
/// @notice Thrown when contract stake/unstake/claim functions is paused
error Paused();
/// @notice Thrown when emergencyUnstake function called in regular working mode
error NotAvailableInRegularMode();

/* solhint-disable not-rely-on-time */
contract PixelmonStaking is IERC721Receiver, Ownable, ReentrancyGuard, EIP712, AccessControl {
    /// @dev Use storage wisely
    /// structure will be packed in single storage word (32 bytes)
    /// sizeof(address) = 20 bytes
    /// sizeof(uint64) = 8 bytes
    /// sizeof(uint32) = 4 bytes
    struct StakeInfo {
        address owner;
        uint64 timestamp;
        uint32 rewardTokenId;
    }

    bytes32 public constant SIGNER_ROLE = keccak256("SIGNER_ROLE");
    string private constant SIGNING_DOMAIN = "Pixelmon-Staking";
    string private constant SIGNATURE_VERSION = "1";

    /// @notice Period of time during which the token cannot be unstaked
    uint256 public constant LOCK_PERIOD = 21 days;
    /// @notice Max amount of tokens to stake/unstake in single transaction
    uint256 public constant MAX_TOKENS_PER_STAKE = 25;
    
    /// @notice Pixelmon NFT contract address
    address public immutable pixelmonContract;
    /// @notice PixelmonTrainer NFT contract address
    address public immutable pixelmonTrainerContract;

    uint32 public rangeOneCurrentTokenId = 1;

    /// @notice Is contract main functions paused flag
    bool public paused;
    /// @notice Emergency mode flag, emergencyUnstake function available in this mode
    bool public emergencyMode;

    /// @notice Tokens stake info
    mapping(uint256 => StakeInfo) public stakes;
    

    event TokenRescue(address indexed token, address indexed to, uint256 indexed tokenId);
    event Pause(address indexed caller);
    event Unpause(address indexed caller);
    event ToggleEmergencyMode(bool _isEmergency);
    event Staked(address indexed _address, uint256 indexed pixelmonId, uint256 indexed trainerId);
    event Unstaked(address indexed _address, uint256 indexed _tokenId);
    
    modifier validInputLength(uint256[] calldata tokens) {
        if (tokens.length == 0 || tokens.length > MAX_TOKENS_PER_STAKE) {
            revert InvalidInputArrayLength();
        }
        _;
    }

    modifier validAddress(address _address) {
        if (_address == address(0) || _address == address(this)) {
            revert InvalidAddress();
        }
        _;
    }

    /// @dev Same as OpenZeppelin's pausable, just moved here to reduce gas
    modifier whenNotPaused() {
        if (paused) {
            revert Paused();
        }
        _;
    }

    constructor(
        address _pixelmonContract,
        address _pixelmonTrainerContract
    ) EIP712(SIGNING_DOMAIN, SIGNATURE_VERSION) {
        if (_pixelmonContract == address(0) || _pixelmonTrainerContract == address(0)) {
            revert InvalidAddress();
        }

        _grantRole(SIGNER_ROLE, msg.sender);

        pixelmonContract = _pixelmonContract;
        pixelmonTrainerContract = _pixelmonTrainerContract;
    }

    /// @notice Function to set new signature verifier address. Callable only by contract owner
    /// @param _signer new signer wallet address.
    function setSigner(address _signer) external onlyOwner {
        _grantRole(SIGNER_ROLE, _signer);
    }

    /// @notice Pause contract. Functions marked with whenNotPaused modifier will be paused. Callable only by contract owner
    function pause() public onlyOwner {
        paused = true;

        emit Pause(msg.sender);
    }

    /// @notice Unpause contract. Callable only by contract owner
    function unpause() external onlyOwner {
        paused = false;

        emit Unpause(msg.sender);
    }

    /// @notice Toggle emergency mode and enables emergencyUnstake function. Callable only by contract owner
    /// Contract will be paused, so stake/unstake/claim will not work until unpause
    /// @param _isEmergency bool flag
    function toggleEmergencyMode(bool _isEmergency) external onlyOwner {
        emergencyMode = _isEmergency;

        if (_isEmergency) {
            pause();
        }

        emit ToggleEmergencyMode(_isEmergency);
    }

    /// @notice Rescue stucked NFT tokens. Callable only by contract owner
    /// Cannot be used to transfer Pixelmon tokens
    /// @param token address of ERC721 contract
    /// @param to receiver address
    /// @param tokenId id of token to rescue
    function rescueNFT(
        address token,
        address to,
        uint256 tokenId
    ) external onlyOwner nonReentrant validAddress(token) validAddress(to) {
        // Contract owner shouldnt be able to transfer Pixelmons staker by user
        if (token == pixelmonContract) {
            revert InvalidAddress();
        }

        IERC721(token).safeTransferFrom(address(this), to, tokenId);

        emit TokenRescue(token, to, tokenId);
    }

    /// @dev To support safeTransfers of ERC721 if operator is this contract.
    /// Reverts on direct safeTransfers from anyone else
    function onERC721Received(
        address operator,
        address,
        uint256,
        bytes calldata
    ) external view override returns (bytes4) {
        if (operator == address(this)) {
            return this.onERC721Received.selector;
        } else {
            return bytes4(0);
        }
    }

    function hashTokenIds(uint256[] calldata _tokenIds) public pure returns (uint256) {
        return uint256(keccak256(abi.encodePacked(_tokenIds)));
    }

    /// @notice Verifies the signature for a given tokenIds hash and tokens owner, returning the address of the signer.
    /// @dev Will revert if the signature is invalid. Does not verify that the signer is authorized to stake NFTs.
    function verifyStakingSignature(
        uint256[] calldata _tokenIds,
        address _tokenOwner,
        bytes calldata _signature
    ) public view returns (address) {
        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    keccak256("PixelmonSignature(uint256 tokenIds,address tokenOwner)"),
                    hashTokenIds(_tokenIds),
                    _tokenOwner
                )
            )
        );
        return ECDSA.recover(digest, _signature);
    }

    /// @notice Returns the chain id of the current blockchain.
    /// @dev This is used to workaround an issue with getting actual chaingID returning different values from the on-chain chainid() function and
    ///  the eth_chainId RPC method. See https://github.com/protocol/nft-website/issues/121 for context.
    function getChainID() external view returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }
        return id;
    }

    /// @notice Stake Pixelmon NFT tokens to receive PixelmonTrainer NFT  Range #1 tokens
    /// Lock period is 21 days
    /// @dev PixelmonTrainer tokens should be preminted to this contract, otherwise function will revert
    /// @param _tokenIds valid array of Pixelmon token ids to stake
    /// @param _signature signature to check validity of staking
    function stake(uint256[] calldata _tokenIds, bytes calldata _signature)
        external
        nonReentrant
        whenNotPaused
        validInputLength(_tokenIds)
    {
        uint32 _rewardTokenId = rangeOneCurrentTokenId;
        uint256 inputLength = _tokenIds.length;

        /// @dev make sure signature is valid and get the address of the signer
        address signer = verifyStakingSignature(_tokenIds, msg.sender, _signature);

        /// @dev make sure that the signer is authorized to mint NFTs
        require(hasRole(SIGNER_ROLE, signer), "Signature invalid or unauthorized");

        for (uint256 i = 0; i < inputLength; i = _uncheckedInc(i)) {
            uint256 tokenId = _tokenIds[i];

            if (isTokenStaked(tokenId)) {
                revert TokenWasStaked();
            }

            if (IERC721(pixelmonContract).ownerOf(tokenId) != msg.sender) {
                revert NotAnOwner();
            }

            stakes[tokenId] = StakeInfo(msg.sender, uint64(block.timestamp), _rewardTokenId);

            IERC721(pixelmonContract).safeTransferFrom(msg.sender, address(this), tokenId);
            IERC721(pixelmonTrainerContract).safeTransferFrom(
                address(this),
                msg.sender,
                _rewardTokenId
            );

            emit Staked(msg.sender, tokenId, _rewardTokenId);

            unchecked {
                ++_rewardTokenId;
            }
        }

        rangeOneCurrentTokenId = _rewardTokenId;
    }

    /// @notice Unstake Pixelmon tokens
    /// @param _tokenIds array of token ids to unstake
    function unstake(uint256[] calldata _tokenIds)
        external
        nonReentrant
        whenNotPaused
        validInputLength(_tokenIds)
    {
        uint256 inputLength = _tokenIds.length;

        for (uint256 i = 0; i < inputLength; i = _uncheckedInc(i)) {
            StakeInfo storage stakeInfo = stakes[_tokenIds[i]];

            if (stakeInfo.owner != msg.sender) {
                revert NotAnOwner();
            }

            if (stakeInfo.timestamp + LOCK_PERIOD >= block.timestamp) {
                revert TokenLocked();
            }

            _unstake(_tokenIds[i]);
        }
    }

    /// @notice Unstake tokens in emergency situation. Does not perform lock period check
    /// @dev Transfer tokens to address, specified in stakes info mapping
    /// @param _tokenIds array of tokens to unstake
    function emergencyUnstake(uint256[] calldata _tokenIds) external nonReentrant {
        if (!emergencyMode) {
            revert NotAvailableInRegularMode();
        }

        for (uint256 i = 0; i < _tokenIds.length; i++) {
            _unstake(_tokenIds[i]);
        }
    }

    /// @notice Get token stake status
    /// @param _tokenId Pixelmon token id
    /// @return true if token was staked, otherwise false
    function isTokenStaked(uint256 _tokenId) public view returns (bool) {
        return stakes[_tokenId].owner != address(0);
    }

    /// @dev Helper functions for tokens unstake
    function _unstake(uint256 _tokenId) private {
        IERC721(pixelmonContract).safeTransferFrom(address(this), stakes[_tokenId].owner, _tokenId);

        emit Unstaked(msg.sender, _tokenId);
    }

    /// @dev Unchecked increment function, just to reduce gas usage
    /// @param val value to be incremented, should not overflow 2**256 - 1
    /// @return incremented value
    function _uncheckedInc(uint256 val) private pure returns (uint256) {
        unchecked {
            return val + 1;
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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);
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 6 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 8 of 13 : 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 9 of 13 : draft-EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // 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 _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @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) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, 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 ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

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

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

File 11 of 13 : 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 12 of 13 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_pixelmonContract","type":"address"},{"internalType":"address","name":"_pixelmonTrainerContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidInputArrayLength","type":"error"},{"inputs":[],"name":"NotAnOwner","type":"error"},{"inputs":[],"name":"NotAvailableInRegularMode","type":"error"},{"inputs":[],"name":"Paused","type":"error"},{"inputs":[],"name":"TokenLocked","type":"error"},{"inputs":[],"name":"TokenWasStaked","type":"error"},{"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":"caller","type":"address"}],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"},{"indexed":true,"internalType":"uint256","name":"pixelmonId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"trainerId","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_isEmergency","type":"bool"}],"name":"ToggleEmergencyMode","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenRescue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOKENS_PER_STAKE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"emergencyUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getChainID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"hashTokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isTokenStaked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixelmonContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixelmonTrainerContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rangeOneCurrentTokenId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"rescueNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakes","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"rewardTokenId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isEmergency","type":"bool"}],"name":"toggleEmergencyMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"address","name":"_tokenOwner","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verifyStakingSignature","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6101806040526003805463ffffffff191660011790553480156200002257600080fd5b5060405162002c1f38038062002c1f8339810160408190526200004591620002d0565b6040518060400160405280601081526020016f506978656c6d6f6e2d5374616b696e6760801b815250604051806040016040528060018152602001603160f81b815250620000a26200009c620001ba60201b60201c565b620001be565b60018055815160208084019190912082518383012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c00190528051940193909320919290916080523060c05261012052505050506001600160a01b03821615806200015557506001600160a01b038116155b15620001745760405163e6c4247b60e01b815260040160405180910390fd5b620001a07fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70336200020e565b6001600160a01b0391821661014052166101605262000308565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff16620002af5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200026e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b0381168114620002cb57600080fd5b919050565b60008060408385031215620002e457600080fd5b620002ef83620002b3565b9150620002ff60208401620002b3565b90509250929050565b60805160a05160c05160e0516101005161012051610140516101605161288e62000391600039600081816102940152610dda01526000818161039f01528181610b6401528181610d40015281816111920152611a3a01526000611c1701526000611c6601526000611c4101526000611b9a01526000611bc401526000611bee015261288e6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638456cb591161010f578063a217fddf116100a2578063e449f34111610071578063e449f34114610575578063f0a5242414610588578063f2fde38b146105c0578063f58b1ef8146105d357600080fd5b8063a217fddf14610485578063bf0e5b951461048d578063d547741f146104a0578063d5a44f86146104b357600080fd5b806394542c31116100de57806394542c311461042557806397213681146104385780639c13cd4d1461044b578063a1ebf35d1461045e57600080fd5b80638456cb5914610392578063876824771461039a5780638da5cb5b146103c157806391d14854146103df57600080fd5b80633a3328a4116101875780636c19e783116101565780636c19e78314610351578063715018a61461036457806376686eab1461036c5780637a54d7cd1461037f57600080fd5b80633a3328a4146103265780633f4ba83a1461032e578063564b81ef146103365780635c975abb1461033c57600080fd5b80631eb894e9116101c35780631eb894e91461028f578063248a9ca3146102db5780632f2ff15d146102fe57806336568abe1461031357600080fd5b806301ffc9a7146101f55780630905f5601461021d578063150b7a02146102335780631820cabb14610277575b600080fd5b61020861020336600461222d565b6105f8565b60405190151581526020015b60405180910390f35b6003546102089065010000000000900460ff1681565b6102466102413660046122d3565b610691565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610214565b610281621baf8081565b604051908152602001610214565b6102b67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610214565b6102816102e9366004612346565b60009081526002602052604090206001015490565b61031161030c36600461235f565b6106e4565b005b61031161032136600461235f565b61070e565b610281601981565b6103116107ac565b46610281565b60035461020890640100000000900460ff1681565b61031161035f36600461238f565b610809565b61031161083e565b61031161037a3660046123ac565b610852565b61031161038d366004612413565b6108d9565b610311610ed4565b6102b67f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff166102b6565b6102086103ed36600461235f565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61028161043336600461247f565b610f38565b6102b66104463660046124c1565b610f8a565b610311610459366004612535565b611051565b6102817fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f7081565b610281600081565b61031161049b36600461247f565b611309565b6103116104ae36600461235f565b6113ec565b6105346104c1366004612346565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810467ffffffffffffffff16907c0100000000000000000000000000000000000000000000000000000000900463ffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845267ffffffffffffffff909216602084015263ffffffff1690820152606001610214565b61031161058336600461247f565b611411565b610208610596366004612346565b60009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b6103116105ce36600461238f565b611618565b6003546105e39063ffffffff1681565b60405163ffffffff9091168152602001610214565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061068b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60003073ffffffffffffffffffffffffffffffffffffffff8716036106d757507f150b7a02000000000000000000000000000000000000000000000000000000006106db565b5060005b95945050505050565b6000828152600260205260409020600101546106ff816116b2565b61070983836116bc565b505050565b73ffffffffffffffffffffffffffffffffffffffff8116331461079e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107a882826117b0565b5050565b6107b461186b565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffff16905560405133907faeb196d352664784d1900b0e7414a8face7d29f4dae8c4b0cf68ed477423bbf490600090a2565b61081161186b565b61083b7fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70826116bc565b50565b61084661186b565b61085060006118d2565b565b61085a61186b565b600380548215801565010000000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffff909216919091179091556108a1576108a1610ed4565b60405181151581527fd44f343a5156f9d09d94fb698e6c3fef2bbcd177fe757f3d1152bca9a1f2418c9060200160405180910390a150565b60026001540361092b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b6002600155600354640100000000900460ff1615610975576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83838015806109845750601981115b156109bb576040517fa7b682d700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035463ffffffff168560006109d48983338a8a610f8a565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fe3167eb0b8b8daed6f6fbecd2dbeee0026806517df961d9728082a1bb4132fa3602052604090205490915060ff16610a915760405162461bcd60e51b815260206004820152602160248201527f5369676e617475726520696e76616c6964206f7220756e617574686f72697a6560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610795565b60005b82811015610e8f5760008a8a83818110610ab057610ab0612576565b905060200201359050610ae78160009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b15610b1e576040517f98d0401700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101829052339073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf91906125a5565b73ffffffffffffffffffffffffffffffffffffffff1614610c1c576040517feea91ff800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516060810182523380825267ffffffffffffffff428116602080850191825263ffffffff8b8116868801908152600089815260049384905288902096518754945191519092167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9190951674010000000000000000000000000000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090941673ffffffffffffffffffffffffffffffffffffffff9283161793909317929092169290921790935592517f42842e0e00000000000000000000000000000000000000000000000000000000815292830152306024830152604482018390527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b158015610d8457600080fd5b505af1158015610d98573d6000803e3d6000fd5b50506040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015233602482015263ffffffff881660448201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1692506342842e0e9150606401600060405180830381600087803b158015610e3557600080fd5b505af1158015610e49573d6000803e3d6000fd5b505060405163ffffffff8816925083915033907f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee9090600090a45060019384019301610a94565b5050600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff93909316929092179091555050600180555050505050565b610edc61186b565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffff1664010000000017905560405133907f5ee71a369c8672edded508e624ffc9257fa1ae6886ef32905c18e60196bca39990600090a2565b60008282604051602001610f4d9291906125c2565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b6000806110047f537889a05975314d600d78de2eed529d5ecef995cc09e5ee07763e722af683c0610fbb8989610f38565b60408051602081019390935282015273ffffffffffffffffffffffffffffffffffffffff8716606082015260800160405160208183030381529060405280519060200120611947565b90506110468185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506119b092505050565b979650505050505050565b61105961186b565b6002600154036110ab5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b60026001558273ffffffffffffffffffffffffffffffffffffffff811615806110e9575073ffffffffffffffffffffffffffffffffffffffff811630145b15611120576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff81161580611159575073ffffffffffffffffffffffffffffffffffffffff811630145b15611190576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611215576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8581166024830152604482018590528616906342842e0e90606401600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b50505050828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ffb41bf2d731a9899a9f0358e96ddc7789c1295a4e37de1b12c9c86c90bafdd2860405160405180910390a4505060018055505050565b60026001540361135b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b600260015560035465010000000000900460ff166113a5576040517fa9acbed800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156113e3576113d18383838181106113c5576113c5612576565b905060200201356119d4565b806113db81612636565b9150506113a8565b50506001805550565b600082815260026020526040902060010154611407816116b2565b61070983836117b0565b6002600154036114635760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b6002600155600354640100000000900460ff16156114ad576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81818015806114bc5750601981115b156114f3576040517fa7b682d700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260005b8181101561160c5760006004600088888581811061151757611517612576565b60209081029290920135835250810191909152604001600020805490915073ffffffffffffffffffffffffffffffffffffffff163314611583576040517feea91ff800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805442906115b790621baf809074010000000000000000000000000000000000000000900467ffffffffffffffff1661266e565b106115ee576040517f5a8181f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116038787848181106113c5576113c5612576565b506001016114f7565b50506001805550505050565b61162061186b565b73ffffffffffffffffffffffffffffffffffffffff81166116a95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610795565b61083b816118d2565b61083b8133611ac8565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107a857600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556117523390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156107a857600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610795565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061068b611954611b80565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006119bf8585611cb4565b915091506119cc81611cf9565b509392505050565b6000818152600460208190526040918290205491517f42842e0e000000000000000000000000000000000000000000000000000000008152309181019190915273ffffffffffffffffffffffffffffffffffffffff9182166024820152604481018390527f0000000000000000000000000000000000000000000000000000000000000000909116906342842e0e90606401600060405180830381600087803b158015611a8057600080fd5b505af1158015611a94573d6000803e3d6000fd5b50506040518392503391507f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f7590600090a350565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107a857611b208173ffffffffffffffffffffffffffffffffffffffff166014611ee5565b611b2b836020611ee5565b604051602001611b3c9291906126b6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905262461bcd60e51b825261079591600401612737565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148015611be657507f000000000000000000000000000000000000000000000000000000000000000046145b15611c1057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103611cea5760208301516040840151606085015160001a611cde87828585612115565b94509450505050611cf2565b506000905060025b9250929050565b6000816004811115611d0d57611d0d612788565b03611d155750565b6001816004811115611d2957611d29612788565b03611d765760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610795565b6002816004811115611d8a57611d8a612788565b03611dd75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610795565b6003816004811115611deb57611deb612788565b03611e5e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610795565b6004816004811115611e7257611e72612788565b0361083b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610795565b60606000611ef48360026127b7565b611eff90600261266e565b67ffffffffffffffff811115611f1757611f176127f4565b6040519080825280601f01601f191660200182016040528015611f41576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611f7857611f78612576565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611fdb57611fdb612576565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006120178460026127b7565b61202290600161266e565b90505b60018111156120bf577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061206357612063612576565b1a60f81b82828151811061207957612079612576565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936120b881612823565b9050612025565b50831561210e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610795565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561214c5750600090506003612224565b8460ff16601b1415801561216457508460ff16601c14155b156121755750600090506004612224565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156121c9573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661221d57600060019250925050612224565b9150600090505b94509492505050565b60006020828403121561223f57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461210e57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461083b57600080fd5b60008083601f8401126122a357600080fd5b50813567ffffffffffffffff8111156122bb57600080fd5b602083019150836020828501011115611cf257600080fd5b6000806000806000608086880312156122eb57600080fd5b85356122f68161226f565b945060208601356123068161226f565b935060408601359250606086013567ffffffffffffffff81111561232957600080fd5b61233588828901612291565b969995985093965092949392505050565b60006020828403121561235857600080fd5b5035919050565b6000806040838503121561237257600080fd5b8235915060208301356123848161226f565b809150509250929050565b6000602082840312156123a157600080fd5b813561210e8161226f565b6000602082840312156123be57600080fd5b8135801515811461210e57600080fd5b60008083601f8401126123e057600080fd5b50813567ffffffffffffffff8111156123f857600080fd5b6020830191508360208260051b8501011115611cf257600080fd5b6000806000806040858703121561242957600080fd5b843567ffffffffffffffff8082111561244157600080fd5b61244d888389016123ce565b9096509450602087013591508082111561246657600080fd5b5061247387828801612291565b95989497509550505050565b6000806020838503121561249257600080fd5b823567ffffffffffffffff8111156124a957600080fd5b6124b5858286016123ce565b90969095509350505050565b6000806000806000606086880312156124d957600080fd5b853567ffffffffffffffff808211156124f157600080fd5b6124fd89838a016123ce565b9097509550602088013591506125128261226f565b9093506040870135908082111561252857600080fd5b5061233588828901612291565b60008060006060848603121561254a57600080fd5b83356125558161226f565b925060208401356125658161226f565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156125b757600080fd5b815161210e8161226f565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156125f157600080fd5b8260051b80858437600092019182525092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361266757612667612607565b5060010190565b6000821982111561268157612681612607565b500190565b60005b838110156126a1578181015183820152602001612689565b838111156126b0576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516126ee816017850160208801612686565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161272b816028840160208801612686565b01602801949350505050565b6020815260008251806020840152612756816040850160208701612686565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127ef576127ef612607565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008161283257612832612607565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220bf738c06d2cacb9d8774d534bff8be292c55b684e5752fb66e01897fef155de764736f6c634300080f003300000000000000000000000032973908faee0bf825a343000fe412ebe56f802a0000000000000000000000008a3749936e723325c6b645a0901470cd9e790b94

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80638456cb591161010f578063a217fddf116100a2578063e449f34111610071578063e449f34114610575578063f0a5242414610588578063f2fde38b146105c0578063f58b1ef8146105d357600080fd5b8063a217fddf14610485578063bf0e5b951461048d578063d547741f146104a0578063d5a44f86146104b357600080fd5b806394542c31116100de57806394542c311461042557806397213681146104385780639c13cd4d1461044b578063a1ebf35d1461045e57600080fd5b80638456cb5914610392578063876824771461039a5780638da5cb5b146103c157806391d14854146103df57600080fd5b80633a3328a4116101875780636c19e783116101565780636c19e78314610351578063715018a61461036457806376686eab1461036c5780637a54d7cd1461037f57600080fd5b80633a3328a4146103265780633f4ba83a1461032e578063564b81ef146103365780635c975abb1461033c57600080fd5b80631eb894e9116101c35780631eb894e91461028f578063248a9ca3146102db5780632f2ff15d146102fe57806336568abe1461031357600080fd5b806301ffc9a7146101f55780630905f5601461021d578063150b7a02146102335780631820cabb14610277575b600080fd5b61020861020336600461222d565b6105f8565b60405190151581526020015b60405180910390f35b6003546102089065010000000000900460ff1681565b6102466102413660046122d3565b610691565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610214565b610281621baf8081565b604051908152602001610214565b6102b67f0000000000000000000000008a3749936e723325c6b645a0901470cd9e790b9481565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610214565b6102816102e9366004612346565b60009081526002602052604090206001015490565b61031161030c36600461235f565b6106e4565b005b61031161032136600461235f565b61070e565b610281601981565b6103116107ac565b46610281565b60035461020890640100000000900460ff1681565b61031161035f36600461238f565b610809565b61031161083e565b61031161037a3660046123ac565b610852565b61031161038d366004612413565b6108d9565b610311610ed4565b6102b67f00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a81565b60005473ffffffffffffffffffffffffffffffffffffffff166102b6565b6102086103ed36600461235f565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61028161043336600461247f565b610f38565b6102b66104463660046124c1565b610f8a565b610311610459366004612535565b611051565b6102817fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f7081565b610281600081565b61031161049b36600461247f565b611309565b6103116104ae36600461235f565b6113ec565b6105346104c1366004612346565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810467ffffffffffffffff16907c0100000000000000000000000000000000000000000000000000000000900463ffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845267ffffffffffffffff909216602084015263ffffffff1690820152606001610214565b61031161058336600461247f565b611411565b610208610596366004612346565b60009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b6103116105ce36600461238f565b611618565b6003546105e39063ffffffff1681565b60405163ffffffff9091168152602001610214565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061068b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60003073ffffffffffffffffffffffffffffffffffffffff8716036106d757507f150b7a02000000000000000000000000000000000000000000000000000000006106db565b5060005b95945050505050565b6000828152600260205260409020600101546106ff816116b2565b61070983836116bc565b505050565b73ffffffffffffffffffffffffffffffffffffffff8116331461079e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107a882826117b0565b5050565b6107b461186b565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffff16905560405133907faeb196d352664784d1900b0e7414a8face7d29f4dae8c4b0cf68ed477423bbf490600090a2565b61081161186b565b61083b7fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70826116bc565b50565b61084661186b565b61085060006118d2565b565b61085a61186b565b600380548215801565010000000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffff909216919091179091556108a1576108a1610ed4565b60405181151581527fd44f343a5156f9d09d94fb698e6c3fef2bbcd177fe757f3d1152bca9a1f2418c9060200160405180910390a150565b60026001540361092b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b6002600155600354640100000000900460ff1615610975576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83838015806109845750601981115b156109bb576040517fa7b682d700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035463ffffffff168560006109d48983338a8a610f8a565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fe3167eb0b8b8daed6f6fbecd2dbeee0026806517df961d9728082a1bb4132fa3602052604090205490915060ff16610a915760405162461bcd60e51b815260206004820152602160248201527f5369676e617475726520696e76616c6964206f7220756e617574686f72697a6560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610795565b60005b82811015610e8f5760008a8a83818110610ab057610ab0612576565b905060200201359050610ae78160009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b15610b1e576040517f98d0401700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101829052339073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a1690636352211e90602401602060405180830381865afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf91906125a5565b73ffffffffffffffffffffffffffffffffffffffff1614610c1c576040517feea91ff800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516060810182523380825267ffffffffffffffff428116602080850191825263ffffffff8b8116868801908152600089815260049384905288902096518754945191519092167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9190951674010000000000000000000000000000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090941673ffffffffffffffffffffffffffffffffffffffff9283161793909317929092169290921790935592517f42842e0e00000000000000000000000000000000000000000000000000000000815292830152306024830152604482018390527f00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a16906342842e0e90606401600060405180830381600087803b158015610d8457600080fd5b505af1158015610d98573d6000803e3d6000fd5b50506040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015233602482015263ffffffff881660448201527f0000000000000000000000008a3749936e723325c6b645a0901470cd9e790b9473ffffffffffffffffffffffffffffffffffffffff1692506342842e0e9150606401600060405180830381600087803b158015610e3557600080fd5b505af1158015610e49573d6000803e3d6000fd5b505060405163ffffffff8816925083915033907f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee9090600090a45060019384019301610a94565b5050600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff93909316929092179091555050600180555050505050565b610edc61186b565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffff1664010000000017905560405133907f5ee71a369c8672edded508e624ffc9257fa1ae6886ef32905c18e60196bca39990600090a2565b60008282604051602001610f4d9291906125c2565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b6000806110047f537889a05975314d600d78de2eed529d5ecef995cc09e5ee07763e722af683c0610fbb8989610f38565b60408051602081019390935282015273ffffffffffffffffffffffffffffffffffffffff8716606082015260800160405160208183030381529060405280519060200120611947565b90506110468185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506119b092505050565b979650505050505050565b61105961186b565b6002600154036110ab5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b60026001558273ffffffffffffffffffffffffffffffffffffffff811615806110e9575073ffffffffffffffffffffffffffffffffffffffff811630145b15611120576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff81161580611159575073ffffffffffffffffffffffffffffffffffffffff811630145b15611190576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611215576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8581166024830152604482018590528616906342842e0e90606401600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b50505050828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ffb41bf2d731a9899a9f0358e96ddc7789c1295a4e37de1b12c9c86c90bafdd2860405160405180910390a4505060018055505050565b60026001540361135b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b600260015560035465010000000000900460ff166113a5576040517fa9acbed800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156113e3576113d18383838181106113c5576113c5612576565b905060200201356119d4565b806113db81612636565b9150506113a8565b50506001805550565b600082815260026020526040902060010154611407816116b2565b61070983836117b0565b6002600154036114635760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610795565b6002600155600354640100000000900460ff16156114ad576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81818015806114bc5750601981115b156114f3576040517fa7b682d700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260005b8181101561160c5760006004600088888581811061151757611517612576565b60209081029290920135835250810191909152604001600020805490915073ffffffffffffffffffffffffffffffffffffffff163314611583576040517feea91ff800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805442906115b790621baf809074010000000000000000000000000000000000000000900467ffffffffffffffff1661266e565b106115ee576040517f5a8181f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116038787848181106113c5576113c5612576565b506001016114f7565b50506001805550505050565b61162061186b565b73ffffffffffffffffffffffffffffffffffffffff81166116a95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610795565b61083b816118d2565b61083b8133611ac8565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107a857600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556117523390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156107a857600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610795565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061068b611954611b80565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006119bf8585611cb4565b915091506119cc81611cf9565b509392505050565b6000818152600460208190526040918290205491517f42842e0e000000000000000000000000000000000000000000000000000000008152309181019190915273ffffffffffffffffffffffffffffffffffffffff9182166024820152604481018390527f00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a909116906342842e0e90606401600060405180830381600087803b158015611a8057600080fd5b505af1158015611a94573d6000803e3d6000fd5b50506040518392503391507f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f7590600090a350565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107a857611b208173ffffffffffffffffffffffffffffffffffffffff166014611ee5565b611b2b836020611ee5565b604051602001611b3c9291906126b6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905262461bcd60e51b825261079591600401612737565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000217b53f8a059a5768aef26034b4a4ed2018d70f216148015611be657507f000000000000000000000000000000000000000000000000000000000000000146145b15611c1057507f9e1be3ca9129847436b6fb29f3e5ff5f6ac96f245137a6cfe9353430af7ca94190565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f95a5f151ededef202da343da6270df12ee725b17216b5408f486984598990ba1828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103611cea5760208301516040840151606085015160001a611cde87828585612115565b94509450505050611cf2565b506000905060025b9250929050565b6000816004811115611d0d57611d0d612788565b03611d155750565b6001816004811115611d2957611d29612788565b03611d765760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610795565b6002816004811115611d8a57611d8a612788565b03611dd75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610795565b6003816004811115611deb57611deb612788565b03611e5e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610795565b6004816004811115611e7257611e72612788565b0361083b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610795565b60606000611ef48360026127b7565b611eff90600261266e565b67ffffffffffffffff811115611f1757611f176127f4565b6040519080825280601f01601f191660200182016040528015611f41576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611f7857611f78612576565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611fdb57611fdb612576565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006120178460026127b7565b61202290600161266e565b90505b60018111156120bf577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061206357612063612576565b1a60f81b82828151811061207957612079612576565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936120b881612823565b9050612025565b50831561210e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610795565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561214c5750600090506003612224565b8460ff16601b1415801561216457508460ff16601c14155b156121755750600090506004612224565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156121c9573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661221d57600060019250925050612224565b9150600090505b94509492505050565b60006020828403121561223f57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461210e57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461083b57600080fd5b60008083601f8401126122a357600080fd5b50813567ffffffffffffffff8111156122bb57600080fd5b602083019150836020828501011115611cf257600080fd5b6000806000806000608086880312156122eb57600080fd5b85356122f68161226f565b945060208601356123068161226f565b935060408601359250606086013567ffffffffffffffff81111561232957600080fd5b61233588828901612291565b969995985093965092949392505050565b60006020828403121561235857600080fd5b5035919050565b6000806040838503121561237257600080fd5b8235915060208301356123848161226f565b809150509250929050565b6000602082840312156123a157600080fd5b813561210e8161226f565b6000602082840312156123be57600080fd5b8135801515811461210e57600080fd5b60008083601f8401126123e057600080fd5b50813567ffffffffffffffff8111156123f857600080fd5b6020830191508360208260051b8501011115611cf257600080fd5b6000806000806040858703121561242957600080fd5b843567ffffffffffffffff8082111561244157600080fd5b61244d888389016123ce565b9096509450602087013591508082111561246657600080fd5b5061247387828801612291565b95989497509550505050565b6000806020838503121561249257600080fd5b823567ffffffffffffffff8111156124a957600080fd5b6124b5858286016123ce565b90969095509350505050565b6000806000806000606086880312156124d957600080fd5b853567ffffffffffffffff808211156124f157600080fd5b6124fd89838a016123ce565b9097509550602088013591506125128261226f565b9093506040870135908082111561252857600080fd5b5061233588828901612291565b60008060006060848603121561254a57600080fd5b83356125558161226f565b925060208401356125658161226f565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156125b757600080fd5b815161210e8161226f565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156125f157600080fd5b8260051b80858437600092019182525092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361266757612667612607565b5060010190565b6000821982111561268157612681612607565b500190565b60005b838110156126a1578181015183820152602001612689565b838111156126b0576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516126ee816017850160208801612686565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161272b816028840160208801612686565b01602801949350505050565b6020815260008251806020840152612756816040850160208701612686565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127ef576127ef612607565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008161283257612832612607565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220bf738c06d2cacb9d8774d534bff8be292c55b684e5752fb66e01897fef155de764736f6c634300080f0033

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

00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a0000000000000000000000008a3749936e723325c6b645a0901470cd9e790b94

-----Decoded View---------------
Arg [0] : _pixelmonContract (address): 0x32973908FaeE0Bf825A343000fE412ebE56F802A
Arg [1] : _pixelmonTrainerContract (address): 0x8A3749936E723325C6b645a0901470cD9E790B94

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000032973908faee0bf825a343000fe412ebe56f802a
Arg [1] : 0000000000000000000000008a3749936e723325c6b645a0901470cd9e790b94


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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