GLMR Price: $0.019268 (-7.11%)

Contract

0xF488e31a81418ebD36573914dF7c9Bc57952Ff84

Overview

GLMR Balance

Moonbeam Chain LogoMoonbeam Chain LogoMoonbeam Chain Logo0 GLMR

GLMR Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Collect119449172025-07-30 4:04:00183 days ago1753848240IN
Damned Pirates Society: Staking V1
0 GLMR0.0055817531.25
Collect106754112025-04-30 7:51:54274 days ago1745999514IN
Damned Pirates Society: Staking V1
0 GLMR0.01124331.25
Collect103918382025-04-10 6:13:24294 days ago1744265604IN
Damned Pirates Society: Staking V1
0 GLMR0.01124331.25
Collect96156482025-02-14 10:13:24349 days ago1739528004IN
Damned Pirates Society: Staking V1
0 GLMR0.01122531.25
Collect95291542025-02-08 8:11:24355 days ago1739002284IN
Damned Pirates Society: Staking V1
0 GLMR0.01134131.25
Collect94927922025-02-05 18:50:12358 days ago1738781412IN
Damned Pirates Society: Staking V1
0 GLMR0.01122531.25
Collect93490712025-01-26 15:26:24368 days ago1737905184IN
Damned Pirates Society: Staking V1
0 GLMR0.044436125
Collect92959402025-01-22 21:38:12372 days ago1737581892IN
Damned Pirates Society: Staking V1
0 GLMR0.044436125
Collect92334172025-01-18 11:34:54376 days ago1737200094IN
Damned Pirates Society: Staking V1
0 GLMR0.044436125
Collect91613042025-01-13 8:57:06381 days ago1736758626IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect90953092025-01-08 16:48:12386 days ago1736354892IN
Damned Pirates Society: Staking V1
0 GLMR0.044436125
Collect90486492025-01-05 9:25:06389 days ago1736069106IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect90397052025-01-04 18:16:36390 days ago1736014596IN
Damned Pirates Society: Staking V1
0 GLMR0.044436125
Collect89487662024-12-29 8:16:42396 days ago1735460202IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect88404262024-12-21 16:52:30404 days ago1734799950IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect87726172024-12-16 19:40:48409 days ago1734378048IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect87014832024-12-11 9:24:54414 days ago1733909094IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect86492542024-12-07 13:50:36418 days ago1733579436IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect86233752024-12-05 16:53:06420 days ago1733417586IN
Damned Pirates Society: Staking V1
0 GLMR0.04954125
Collect86035772024-12-04 7:23:24421 days ago1733297004IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect85772762024-12-02 10:55:12423 days ago1733136912IN
Damned Pirates Society: Staking V1
0 GLMR0.045828125
Collect85493262024-11-30 11:39:18425 days ago1732966758IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect84626882024-11-24 9:08:24431 days ago1732439304IN
Damned Pirates Society: Staking V1
0 GLMR0.0449125
Collect84270142024-11-21 20:12:30434 days ago1732219950IN
Damned Pirates Society: Staking V1
0 GLMR0.04954125
Collect83900922024-11-19 5:07:36436 days ago1731992856IN
Damned Pirates Society: Staking V1
0 GLMR0.044436125
View all transactions

View more zero value Internal Transactions in Advanced View mode

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DPSStaking

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "./interfaces/IERC20Mintable.sol";

/**
 * @dev dpsStacking is a contract that gives rewards in terms of TMAP for NFT holders
 *
 */
contract DPSStaking is ReentrancyGuard, AccessControlEnumerable {
    bytes32 public constant CLAIMABLE_ROLE = keccak256("CLAIMABLE_ROLE");

    /**
     * @dev can pause rewards
     */
    bool public rewardPaused = false;

    /**
     * @dev mapping that stores last time a holder claimed the rewards per nft as a collector
     * can have more than 1 nft
     */
    mapping(uint256 => uint256) lastRewarded;

    /**
     * @dev variable that stores the last time claim all fucntion was called
     */
    uint256 public lastRewardedRoundForAll;

    /**
     * @dev how many governance tokens (TMAP) can be rewarded per round
     */
    uint256 public tmapPerRound = 1 ether;

    /**
     * @dev nft contract that the collector needs to hold to be able to collect rewards
     */
    DPSI public immutable dps;

    /**
     * @dev used to set the cool off for the rewards, someone can not collect if lastRewarded + epoch > block.timestamp
     */
    uint256 public epoch = 6 * 60 * 60; // 6h in seconds

    /**
     * @dev TMAP address, the governance token than is given as rewards
     */
    IERC20Mintable public immutable TMAP;

    /**
     * @dev used to set the starting point of rewards generation of TMAP
     */
    uint256 public startingPoint;

    /**
     * @dev used to set the max number of rounds that generate rewards
     */
    uint256 public maxEpochsForReward = type(uint256).max;

    event Collected(address indexed collector, uint256 amount);
    event ClaimingReset(uint256 rewards);
    event TriggeredClaiming(address owner, uint256 rewards);
    event Set(uint256 target, uint256 value);

    error InvalidParam(uint256 param);
    error UpdateLastRewardRoundForAll();

    constructor(IERC20Mintable _TMAP, DPSI _DPS) {
        startingPoint = block.timestamp;
        lastRewardedRoundForAll = block.timestamp;
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(CLAIMABLE_ROLE, msg.sender);
        TMAP = _TMAP;
        dps = _DPS;
    }

    /**
     * @dev used to for the UI to retrieve pending rewards for a certain collector (dps holder)
     */
    function pending(
        address _collector,
        uint256 _startIndex,
        uint256 _stopIndex
    ) external view returns (uint256) {
        unchecked {
            uint256 roundsToReward = 0;
            uint256[] memory tokensOwned = dps.tokensOfOwner(_collector);
            uint256 i = _startIndex;

            _stopIndex = _stopIndex > tokensOwned.length ? tokensOwned.length : _stopIndex;

            if (_startIndex > _stopIndex) {
                revert InvalidParam(1);
            }

            for (; i < _stopIndex; i++) {
                uint256 tokenId = tokensOwned[i];
                uint256 lastTimeRewarded = lastRewarded[tokenId];

                // means this tokenId it never collected
                if (lastTimeRewarded == 0) lastTimeRewarded = startingPoint;

                roundsToReward += (block.timestamp - lastTimeRewarded) / epoch;
            }

            uint256 maxRewardRounds;

            if (maxEpochsForReward == type(uint256).max) {
                maxRewardRounds = maxEpochsForReward;
            } else {
                maxRewardRounds = (_stopIndex - _startIndex) * maxEpochsForReward;
            }

            return roundsToReward > maxRewardRounds ? maxRewardRounds * tmapPerRound : roundsToReward * tmapPerRound;
        }
    }

    /**
     * @dev used to for the UI to retrieve pending rewards for all collectors (dps Holders)
     */
    function allPending(uint256 _startId, uint256 _stopId) external view returns (uint256) {
        unchecked {
            _startId = _startId == 0 ? 1 : _startId;
            _stopId = _stopId > 3000 ? 3000 : _stopId;

            if (_startId > _stopId) {
                revert InvalidParam(1);
            }

            uint256 roundsToReward = 0;
            uint256 i = _startId;
            for (; i <= _stopId; ++i) {
                uint256 lastTimeRewarded = lastRewarded[i];

                // means this tokenId it never collected
                if (lastTimeRewarded == 0) lastTimeRewarded = startingPoint;

                roundsToReward += (block.timestamp - lastTimeRewarded) / epoch;
            }

            uint256 maxRewardRounds;

            if (maxEpochsForReward == type(uint256).max) {
                maxRewardRounds = maxEpochsForReward;
            } else {
                maxRewardRounds = (_stopId - _startId + 1) * maxEpochsForReward;
            }
            return roundsToReward > maxRewardRounds ? maxRewardRounds * tmapPerRound : roundsToReward * tmapPerRound;
        }
    }

    /**
     * @dev collect function used to collect rewards by an nft holder.
     * the rewards are kept by sender and by token id to assure a reward based on time of ownership.
     */
    function collect(uint256 _startIndex, uint256 _stopIndex) external nonReentrant {
        require(!rewardPaused, "Rewards are paused");

        uint256 amount = 0;

        uint256[] memory tokensOwned = dps.tokensOfOwner(msg.sender);

        _stopIndex = _stopIndex > tokensOwned.length ? tokensOwned.length : _stopIndex;

        if (_startIndex > _stopIndex) {
            revert InvalidParam(1);
        }

        uint256 i = _startIndex;
        for (; i < _stopIndex; ++i) {
            uint256 tokenId = tokensOwned[i];

            if (tokenId == 0) continue;
            uint256 lastTimeRewarded = lastRewarded[tokenId];

            // means this tokenId it never collected
            if (lastTimeRewarded == 0) lastTimeRewarded = startingPoint;

            //rewarded for this token did not pass the rewards cool off
            if (block.timestamp - lastTimeRewarded < epoch) continue;

            uint256 roundsToReward = (block.timestamp - lastTimeRewarded) / epoch;

            //last rewards per collector per token is set as lastTimeRewarded + roundsToReward * epoch in case someone
            // collects between 2 rounds, this means no one can lose rewards.
            lastRewarded[tokenId] = lastTimeRewarded + roundsToReward * epoch;

            roundsToReward = roundsToReward > maxEpochsForReward ? maxEpochsForReward : roundsToReward;

            amount += tmapPerRound * roundsToReward;
        }

        require(amount > 0, "Nothing to collect");
        TMAP.mint(msg.sender, amount);

        emit Collected(msg.sender, amount);
    }

    /**
     * @dev pause rewards claiming, do not pause generation
     */
    function setRewardPause(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
        rewardPaused = _paused;
    }

    function getLastRewarded(uint256 _tokenId) external view returns (uint256) {
        return lastRewarded[_tokenId];
    }

    function resetClaiming(uint256 _tokenId) external onlyRole(DEFAULT_ADMIN_ROLE) {
        lastRewarded[_tokenId] = block.timestamp;
        emit ClaimingReset(_tokenId);
    }

    function set(uint256 _target, uint256 _value) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_target == 0) {
            startingPoint = _value;
        } else if (_target == 1) {
            maxEpochsForReward = _value;
        } else if (_target == 2) {
            uint256 roundsToReward = (block.timestamp - lastRewardedRoundForAll) / epoch;
            if (roundsToReward != 0) {
                revert UpdateLastRewardRoundForAll();
            }
            tmapPerRound = _value;
        } else if (_target == 3) {
            uint256 roundsToReward = (block.timestamp - lastRewardedRoundForAll) / epoch;
            if (roundsToReward != 0) {
                revert UpdateLastRewardRoundForAll();
            }
            /// @dev cooloff period in seconds
            epoch = _value;
        } else {
            revert InvalidParam(0);
        }
        emit Set(_target, _value);
    }

    /**
     * @dev start is the start token id, stop is the stop token id
     */
    function triggerClaiming(uint256 _startIndex, uint256 _stopIndex) external onlyRole(CLAIMABLE_ROLE) {
        _startIndex = _startIndex == 0 ? 1 : _startIndex;
        _stopIndex = _stopIndex > 3000 ? 3000 : _stopIndex;

        if (_startIndex > _stopIndex) {
            revert InvalidParam(1);
        }

        uint256 roundsToReward;

        roundsToReward = (block.timestamp - lastRewardedRoundForAll) / epoch;
        lastRewardedRoundForAll = lastRewardedRoundForAll + roundsToReward * epoch;

        //iterate through the batch
        for (uint256 i = _startIndex; i <= _stopIndex; i++) {
            uint256 lastTimeRewarded = lastRewarded[i];

            // means this tokenId it never collected
            if (lastTimeRewarded == 0) lastTimeRewarded = startingPoint;

            roundsToReward = 0;

            //rewarded for this token did not pass the rewards cool off
            if (block.timestamp - lastTimeRewarded < epoch) continue;

            roundsToReward = (block.timestamp - lastTimeRewarded) / epoch;

            //last rewards per collector per token is set as lastTimeRewarded + roundsToReward * epoch in case someone
            // collects between 2 rounds, this means no one can lose rewards.
            lastRewarded[i] = lastTimeRewarded + roundsToReward * epoch;

            //we collect for each owner the no of TMAP that needs to be distributed
            //if it is already in the batchDistributor then add to current amount
            address owner = dps.ownerOf(i);

            roundsToReward = roundsToReward > maxEpochsForReward ? maxEpochsForReward : roundsToReward;
            uint256 amount = tmapPerRound * roundsToReward;
            TMAP.mint(owner, amount);
            emit TriggeredClaiming(owner, amount);
        }
    }
}

interface DPSI {
    function tokensOfOwner(address _owner) external view returns (uint256[] memory);

    function getMintedTokens() external view returns (uint256[] memory);

    function totalSupply() external view returns (uint256);

    function ownerOf(uint256 tokenId) external view returns (address);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 expanded to include mint functionality
 * @dev
 */
interface IERC20Mintable {
    /**
     * @dev mints `amount` to `receiver`
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits an {Minted} event.
     */
    function mint(address receiver, uint256 amount) external;
}

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

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

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

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

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

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

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

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC20Mintable","name":"_TMAP","type":"address"},{"internalType":"contract DPSI","name":"_DPS","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"param","type":"uint256"}],"name":"InvalidParam","type":"error"},{"inputs":[],"name":"UpdateLastRewardRoundForAll","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"ClaimingReset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collector","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Collected","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":false,"internalType":"uint256","name":"target","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Set","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"TriggeredClaiming","type":"event"},{"inputs":[],"name":"CLAIMABLE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TMAP","outputs":[{"internalType":"contract IERC20Mintable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startId","type":"uint256"},{"internalType":"uint256","name":"_stopId","type":"uint256"}],"name":"allPending","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_stopIndex","type":"uint256"}],"name":"collect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dps","outputs":[{"internalType":"contract DPSI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getLastRewarded","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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"lastRewardedRoundForAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxEpochsForReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collector","type":"address"},{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_stopIndex","type":"uint256"}],"name":"pending","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"resetClaiming","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":[],"name":"rewardPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_target","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setRewardPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startingPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tmapPerRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_stopIndex","type":"uint256"}],"name":"triggerClaiming","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040526003805460ff19169055670de0b6b3a76400006006556154606007556000196009553480156200003357600080fd5b5060405162001aa338038062001aa383398101604081905262000056916200020d565b60016000908155426008819055600555620000729033620000b6565b6200009e7fbb773b98284e9eff718f1826f7f2ba72af321ca82bdb814f67424a2c0da8834433620000b6565b6001600160a01b0391821660a052166080526200024c565b620000cd8282620000f960201b62000f641760201c565b6000828152600260209081526040909120620000f491839062000fcf62000182821b17901c565b505050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200017e5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b600062000199836001600160a01b038416620001a2565b90505b92915050565b6000818152600183016020526040812054620001eb575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200019c565b5060006200019c565b6001600160a01b03811681146200020a57600080fd5b50565b600080604083850312156200022157600080fd5b82516200022e81620001f4565b60208401519092506200024181620001f4565b809150509250929050565b60805160a05161180e62000295600039600081816103a0015281816107ea0152610dc10152600081816102e801528181610727015281816109910152610bc6015261180e6000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80639010d07c116100de578063b0b8d15f11610097578063cfa6f82711610071578063cfa6f82714610375578063d547741f14610388578063db3d321d1461039b578063eff76d1d146103c257600080fd5b8063b0b8d15f14610332578063ba3dc67c14610359578063ca15c8731461036257600080fd5b80639010d07c146102a557806391d14854146102d0578063a09620fb146102e3578063a217fddf1461030a578063a716151514610312578063ad3c64fd1461031f57600080fd5b80635a1ef0621161014b5780636ca43aac116101255780636ca43aac146102775780637a1636cd1461028a5780637d2f336e14610293578063900cf0cf1461029c57600080fd5b80635a1ef062146102315780635c8d026e146102445780635d00564a1461025757600080fd5b806301ffc9a7146101935780631ab06ee5146101bb578063248a9ca3146101d05780632f2ff15d1461020257806336568abe14610215578063458922a914610228575b600080fd5b6101a66101a1366004611468565b6103d5565b60405190151581526020015b60405180910390f35b6101ce6101c9366004611492565b610400565b005b6101f46101de3660046114b4565b6000908152600160208190526040909120015490565b6040519081526020016101b2565b6101ce6102103660046114e2565b610530565b6101ce6102233660046114e2565b61055b565b6101f460055481565b6101ce61023f366004611492565b6105d9565b6101ce610252366004611512565b6108a8565b6101f46102653660046114b4565b60009081526004602052604090205490565b6101ce6102853660046114b4565b6108c7565b6101f460095481565b6101f460065481565b6101f460075481565b6102b86102b3366004611492565b610921565b6040516001600160a01b0390911681526020016101b2565b6101a66102de3660046114e2565b610940565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6101f4600081565b6003546101a69060ff1681565b6101f461032d366004611534565b61096b565b6101f47fbb773b98284e9eff718f1826f7f2ba72af321ca82bdb814f67424a2c0da8834481565b6101f460085481565b6101f46103703660046114b4565b610aee565b6101ce610383366004611492565b610b05565b6101ce6103963660046114e2565b610e66565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6101f46103d0366004611492565b610e8c565b60006001600160e01b03198216635a05180f60e01b14806103fa57506103fa82610fe4565b92915050565b600061040b81611019565b8260000361041d5760088290556104f2565b8260010361042f5760098290556104f2565b826002036104805760006007546005544261044a919061157f565b61045491906115a8565b90508015610475576040516334c243ab60e11b815260040160405180910390fd5b5060068290556104f2565b826003036104d15760006007546005544261049b919061157f565b6104a591906115a8565b905080156104c6576040516334c243ab60e11b815260040160405180910390fd5b5060078290556104f2565b6040516321333b6960e21b8152600060048201526024015b60405180910390fd5b60408051848152602081018490527f545b620a3000f6303b158b321f06b4e95e28a27d70aecac8c6bdac4f48a9f6b3910160405180910390a1505050565b6000828152600160208190526040909120015461054c81611019565b6105568383611026565b505050565b6001600160a01b03811633146105cb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016104e9565b6105d58282611048565b5050565b7fbb773b98284e9eff718f1826f7f2ba72af321ca82bdb814f67424a2c0da8834461060381611019565b821561060f5782610612565b60015b9250610bb882116106235781610627565b610bb85b91508183111561064d576040516321333b6960e21b8152600160048201526024016104e9565b600060075460055442610660919061157f565b61066a91906115a8565b90506007548161067a91906115ca565b60055461068791906115e1565b600555835b8381116108a157600081815260046020526040812054908190036106af57506008545b600754600093506106c0824261157f565b10156106cc575061088f565b6007546106d9824261157f565b6106e391906115a8565b9250600754836106f391906115ca565b6106fd90826115e1565b60008381526004602081905260408083209390935591516331a9108f60e11b8152918201849052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906115f4565b905060095484116107ab57836107af565b6009545b93506000846006546107c191906115ca565b6040516340c10f1960e01b81526001600160a01b038481166004830152602482018390529192507f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b5050604080516001600160a01b0386168152602081018590527fb032870e4ee7c1e05480332e624a066ab123bef5940c42093ba180df5c4e006c935001905060405180910390a15050505b8061089981611611565b91505061068c565b5050505050565b60006108b381611019565b506003805460ff1916911515919091179055565b60006108d281611019565b60008281526004602052604090819020429055517f9f7ca25d47c4b5b2d499aa8d44be0c304198ad81f3285b30bea2aeb176a046f3906109159084815260200190565b60405180910390a15050565b6000828152600260205260408120610939908361106a565b9392505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b604051632118854760e21b81526001600160a01b038481166004830152600091829182917f000000000000000000000000000000000000000000000000000000000000000090911690638462151c90602401600060405180830381865afa1580156109da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a029190810190611640565b805190915085908511610a155784610a18565b81515b945084861115610a3e576040516321333b6960e21b8152600160048201526024016104e9565b84811015610aac576000828281518110610a5a57610a5a6116f2565b6020026020010151905060006004600083815260200190815260200160002054905080600003610a8957506008545b60075481420381610a9c57610a9c611592565b0494909401935050600101610a3e565b600060001960095403610ac25750600954610acb565b50600954868603025b808411610adc576006548402610ae2565b60065481025b98975050505050505050565b60008181526002602052604081206103fa90611076565b600260005403610b575760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104e9565b600260005560035460ff1615610ba45760405162461bcd60e51b815260206004820152601260248201527114995dd85c991cc8185c99481c185d5cd95960721b60448201526064016104e9565b604051632118854760e21b815233600482015260009081906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638462151c90602401600060405180830381865afa158015610c0d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c359190810190611640565b905080518311610c455782610c48565b80515b925082841115610c6e576040516321333b6960e21b8152600160048201526024016104e9565b835b83811015610d60576000828281518110610c8c57610c8c6116f2565b6020026020010151905080600003610ca45750610d50565b60008181526004602052604081205490819003610cc057506008545b600754610ccd824261157f565b1015610cda575050610d50565b600754600090610cea834261157f565b610cf491906115a8565b905060075481610d0491906115ca565b610d0e90836115e1565b6000848152600460205260409020556009548111610d2c5780610d30565b6009545b905080600654610d4091906115ca565b610d4a90876115e1565b95505050505b610d5981611611565b9050610c70565b60008311610da55760405162461bcd60e51b8152602060048201526012602482015271139bdd1a1a5b99c81d1bc818dbdb1b1958dd60721b60448201526064016104e9565b6040516340c10f1960e01b8152336004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906340c10f1990604401600060405180830381600087803b158015610e0d57600080fd5b505af1158015610e21573d6000803e3d6000fd5b50506040518581523392507f8c22f554c81b54107cd95e734e4ef45767214974a540f34ea4a4f8c3fc7b13c3915060200160405180910390a250506001600055505050565b60008281526001602081905260409091200154610e8281611019565b6105568383611048565b60008215610e9a5782610e9d565b60015b9250610bb88211610eae5781610eb2565b610bb85b915081831115610ed8576040516321333b6960e21b8152600160048201526024016104e9565b6000835b838111610f215760008181526004602052604081205490819003610eff57506008545b60075481420381610f1257610f12611592565b04929092019150600101610edc565b600060001960095403610f375750600954610f43565b50600954600186860301025b808311610f54576006548302610f5a565b60065481025b9695505050505050565b610f6e8282610940565b6105d55760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000610939836001600160a01b038416611080565b60006001600160e01b03198216637965db0b60e01b14806103fa57506301ffc9a760e01b6001600160e01b03198316146103fa565b61102381336110cf565b50565b6110308282610f64565b60008281526002602052604090206105569082610fcf565b6110528282611133565b6000828152600260205260409020610556908261119a565b600061093983836111af565b60006103fa825490565b60008181526001830160205260408120546110c7575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103fa565b5060006103fa565b6110d98282610940565b6105d5576110f1816001600160a01b031660146111d9565b6110fc8360206111d9565b60405160200161110d92919061172c565b60408051601f198184030181529082905262461bcd60e51b82526104e9916004016117a1565b61113d8282610940565b156105d55760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610939836001600160a01b038416611375565b60008260000182815481106111c6576111c66116f2565b9060005260206000200154905092915050565b606060006111e88360026115ca565b6111f39060026115e1565b67ffffffffffffffff81111561120b5761120b61162a565b6040519080825280601f01601f191660200182016040528015611235576020820181803683370190505b509050600360fc1b81600081518110611250576112506116f2565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061127f5761127f6116f2565b60200101906001600160f81b031916908160001a90535060006112a38460026115ca565b6112ae9060016115e1565b90505b6001811115611326576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106112e2576112e26116f2565b1a60f81b8282815181106112f8576112f86116f2565b60200101906001600160f81b031916908160001a90535060049490941c9361131f816117d4565b90506112b1565b5083156109395760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104e9565b6000818152600183016020526040812054801561145e57600061139960018361157f565b85549091506000906113ad9060019061157f565b90508181146114125760008660000182815481106113cd576113cd6116f2565b90600052602060002001549050808760000184815481106113f0576113f06116f2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611423576114236117eb565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103fa565b60009150506103fa565b60006020828403121561147a57600080fd5b81356001600160e01b03198116811461093957600080fd5b600080604083850312156114a557600080fd5b50508035926020909101359150565b6000602082840312156114c657600080fd5b5035919050565b6001600160a01b038116811461102357600080fd5b600080604083850312156114f557600080fd5b823591506020830135611507816114cd565b809150509250929050565b60006020828403121561152457600080fd5b8135801515811461093957600080fd5b60008060006060848603121561154957600080fd5b8335611554816114cd565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156103fa576103fa611569565b634e487b7160e01b600052601260045260246000fd5b6000826115c557634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103fa576103fa611569565b808201808211156103fa576103fa611569565b60006020828403121561160657600080fd5b8151610939816114cd565b60006001820161162357611623611569565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561165357600080fd5b825167ffffffffffffffff8082111561166b57600080fd5b818501915085601f83011261167f57600080fd5b8151818111156116915761169161162a565b8060051b604051601f19603f830116810181811085821117156116b6576116b661162a565b6040529182528482019250838101850191888311156116d457600080fd5b938501935b82851015610ae2578451845293850193928501926116d9565b634e487b7160e01b600052603260045260246000fd5b60005b8381101561172357818101518382015260200161170b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611764816017850160208801611708565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611795816028840160208801611708565b01602801949350505050565b60208152600082518060208401526117c0816040850160208701611708565b601f01601f19169190910160400192915050565b6000816117e3576117e3611569565b506000190190565b634e487b7160e01b600052603160045260246000fdfea164736f6c6343000811000a0000000000000000000000000e67601818237834ff8a280312a6f4f4934e6283000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80639010d07c116100de578063b0b8d15f11610097578063cfa6f82711610071578063cfa6f82714610375578063d547741f14610388578063db3d321d1461039b578063eff76d1d146103c257600080fd5b8063b0b8d15f14610332578063ba3dc67c14610359578063ca15c8731461036257600080fd5b80639010d07c146102a557806391d14854146102d0578063a09620fb146102e3578063a217fddf1461030a578063a716151514610312578063ad3c64fd1461031f57600080fd5b80635a1ef0621161014b5780636ca43aac116101255780636ca43aac146102775780637a1636cd1461028a5780637d2f336e14610293578063900cf0cf1461029c57600080fd5b80635a1ef062146102315780635c8d026e146102445780635d00564a1461025757600080fd5b806301ffc9a7146101935780631ab06ee5146101bb578063248a9ca3146101d05780632f2ff15d1461020257806336568abe14610215578063458922a914610228575b600080fd5b6101a66101a1366004611468565b6103d5565b60405190151581526020015b60405180910390f35b6101ce6101c9366004611492565b610400565b005b6101f46101de3660046114b4565b6000908152600160208190526040909120015490565b6040519081526020016101b2565b6101ce6102103660046114e2565b610530565b6101ce6102233660046114e2565b61055b565b6101f460055481565b6101ce61023f366004611492565b6105d9565b6101ce610252366004611512565b6108a8565b6101f46102653660046114b4565b60009081526004602052604090205490565b6101ce6102853660046114b4565b6108c7565b6101f460095481565b6101f460065481565b6101f460075481565b6102b86102b3366004611492565b610921565b6040516001600160a01b0390911681526020016101b2565b6101a66102de3660046114e2565b610940565b6102b87f000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae81565b6101f4600081565b6003546101a69060ff1681565b6101f461032d366004611534565b61096b565b6101f47fbb773b98284e9eff718f1826f7f2ba72af321ca82bdb814f67424a2c0da8834481565b6101f460085481565b6101f46103703660046114b4565b610aee565b6101ce610383366004611492565b610b05565b6101ce6103963660046114e2565b610e66565b6102b87f0000000000000000000000000e67601818237834ff8a280312a6f4f4934e628381565b6101f46103d0366004611492565b610e8c565b60006001600160e01b03198216635a05180f60e01b14806103fa57506103fa82610fe4565b92915050565b600061040b81611019565b8260000361041d5760088290556104f2565b8260010361042f5760098290556104f2565b826002036104805760006007546005544261044a919061157f565b61045491906115a8565b90508015610475576040516334c243ab60e11b815260040160405180910390fd5b5060068290556104f2565b826003036104d15760006007546005544261049b919061157f565b6104a591906115a8565b905080156104c6576040516334c243ab60e11b815260040160405180910390fd5b5060078290556104f2565b6040516321333b6960e21b8152600060048201526024015b60405180910390fd5b60408051848152602081018490527f545b620a3000f6303b158b321f06b4e95e28a27d70aecac8c6bdac4f48a9f6b3910160405180910390a1505050565b6000828152600160208190526040909120015461054c81611019565b6105568383611026565b505050565b6001600160a01b03811633146105cb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016104e9565b6105d58282611048565b5050565b7fbb773b98284e9eff718f1826f7f2ba72af321ca82bdb814f67424a2c0da8834461060381611019565b821561060f5782610612565b60015b9250610bb882116106235781610627565b610bb85b91508183111561064d576040516321333b6960e21b8152600160048201526024016104e9565b600060075460055442610660919061157f565b61066a91906115a8565b90506007548161067a91906115ca565b60055461068791906115e1565b600555835b8381116108a157600081815260046020526040812054908190036106af57506008545b600754600093506106c0824261157f565b10156106cc575061088f565b6007546106d9824261157f565b6106e391906115a8565b9250600754836106f391906115ca565b6106fd90826115e1565b60008381526004602081905260408083209390935591516331a9108f60e11b8152918201849052907f000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae6001600160a01b031690636352211e90602401602060405180830381865afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906115f4565b905060095484116107ab57836107af565b6009545b93506000846006546107c191906115ca565b6040516340c10f1960e01b81526001600160a01b038481166004830152602482018390529192507f0000000000000000000000000e67601818237834ff8a280312a6f4f4934e6283909116906340c10f1990604401600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b5050604080516001600160a01b0386168152602081018590527fb032870e4ee7c1e05480332e624a066ab123bef5940c42093ba180df5c4e006c935001905060405180910390a15050505b8061089981611611565b91505061068c565b5050505050565b60006108b381611019565b506003805460ff1916911515919091179055565b60006108d281611019565b60008281526004602052604090819020429055517f9f7ca25d47c4b5b2d499aa8d44be0c304198ad81f3285b30bea2aeb176a046f3906109159084815260200190565b60405180910390a15050565b6000828152600260205260408120610939908361106a565b9392505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b604051632118854760e21b81526001600160a01b038481166004830152600091829182917f000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae90911690638462151c90602401600060405180830381865afa1580156109da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a029190810190611640565b805190915085908511610a155784610a18565b81515b945084861115610a3e576040516321333b6960e21b8152600160048201526024016104e9565b84811015610aac576000828281518110610a5a57610a5a6116f2565b6020026020010151905060006004600083815260200190815260200160002054905080600003610a8957506008545b60075481420381610a9c57610a9c611592565b0494909401935050600101610a3e565b600060001960095403610ac25750600954610acb565b50600954868603025b808411610adc576006548402610ae2565b60065481025b98975050505050505050565b60008181526002602052604081206103fa90611076565b600260005403610b575760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104e9565b600260005560035460ff1615610ba45760405162461bcd60e51b815260206004820152601260248201527114995dd85c991cc8185c99481c185d5cd95960721b60448201526064016104e9565b604051632118854760e21b815233600482015260009081906001600160a01b037f000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae1690638462151c90602401600060405180830381865afa158015610c0d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c359190810190611640565b905080518311610c455782610c48565b80515b925082841115610c6e576040516321333b6960e21b8152600160048201526024016104e9565b835b83811015610d60576000828281518110610c8c57610c8c6116f2565b6020026020010151905080600003610ca45750610d50565b60008181526004602052604081205490819003610cc057506008545b600754610ccd824261157f565b1015610cda575050610d50565b600754600090610cea834261157f565b610cf491906115a8565b905060075481610d0491906115ca565b610d0e90836115e1565b6000848152600460205260409020556009548111610d2c5780610d30565b6009545b905080600654610d4091906115ca565b610d4a90876115e1565b95505050505b610d5981611611565b9050610c70565b60008311610da55760405162461bcd60e51b8152602060048201526012602482015271139bdd1a1a5b99c81d1bc818dbdb1b1958dd60721b60448201526064016104e9565b6040516340c10f1960e01b8152336004820152602481018490527f0000000000000000000000000e67601818237834ff8a280312a6f4f4934e62836001600160a01b0316906340c10f1990604401600060405180830381600087803b158015610e0d57600080fd5b505af1158015610e21573d6000803e3d6000fd5b50506040518581523392507f8c22f554c81b54107cd95e734e4ef45767214974a540f34ea4a4f8c3fc7b13c3915060200160405180910390a250506001600055505050565b60008281526001602081905260409091200154610e8281611019565b6105568383611048565b60008215610e9a5782610e9d565b60015b9250610bb88211610eae5781610eb2565b610bb85b915081831115610ed8576040516321333b6960e21b8152600160048201526024016104e9565b6000835b838111610f215760008181526004602052604081205490819003610eff57506008545b60075481420381610f1257610f12611592565b04929092019150600101610edc565b600060001960095403610f375750600954610f43565b50600954600186860301025b808311610f54576006548302610f5a565b60065481025b9695505050505050565b610f6e8282610940565b6105d55760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000610939836001600160a01b038416611080565b60006001600160e01b03198216637965db0b60e01b14806103fa57506301ffc9a760e01b6001600160e01b03198316146103fa565b61102381336110cf565b50565b6110308282610f64565b60008281526002602052604090206105569082610fcf565b6110528282611133565b6000828152600260205260409020610556908261119a565b600061093983836111af565b60006103fa825490565b60008181526001830160205260408120546110c7575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103fa565b5060006103fa565b6110d98282610940565b6105d5576110f1816001600160a01b031660146111d9565b6110fc8360206111d9565b60405160200161110d92919061172c565b60408051601f198184030181529082905262461bcd60e51b82526104e9916004016117a1565b61113d8282610940565b156105d55760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610939836001600160a01b038416611375565b60008260000182815481106111c6576111c66116f2565b9060005260206000200154905092915050565b606060006111e88360026115ca565b6111f39060026115e1565b67ffffffffffffffff81111561120b5761120b61162a565b6040519080825280601f01601f191660200182016040528015611235576020820181803683370190505b509050600360fc1b81600081518110611250576112506116f2565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061127f5761127f6116f2565b60200101906001600160f81b031916908160001a90535060006112a38460026115ca565b6112ae9060016115e1565b90505b6001811115611326576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106112e2576112e26116f2565b1a60f81b8282815181106112f8576112f86116f2565b60200101906001600160f81b031916908160001a90535060049490941c9361131f816117d4565b90506112b1565b5083156109395760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104e9565b6000818152600183016020526040812054801561145e57600061139960018361157f565b85549091506000906113ad9060019061157f565b90508181146114125760008660000182815481106113cd576113cd6116f2565b90600052602060002001549050808760000184815481106113f0576113f06116f2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611423576114236117eb565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103fa565b60009150506103fa565b60006020828403121561147a57600080fd5b81356001600160e01b03198116811461093957600080fd5b600080604083850312156114a557600080fd5b50508035926020909101359150565b6000602082840312156114c657600080fd5b5035919050565b6001600160a01b038116811461102357600080fd5b600080604083850312156114f557600080fd5b823591506020830135611507816114cd565b809150509250929050565b60006020828403121561152457600080fd5b8135801515811461093957600080fd5b60008060006060848603121561154957600080fd5b8335611554816114cd565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156103fa576103fa611569565b634e487b7160e01b600052601260045260246000fd5b6000826115c557634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103fa576103fa611569565b808201808211156103fa576103fa611569565b60006020828403121561160657600080fd5b8151610939816114cd565b60006001820161162357611623611569565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561165357600080fd5b825167ffffffffffffffff8082111561166b57600080fd5b818501915085601f83011261167f57600080fd5b8151818111156116915761169161162a565b8060051b604051601f19603f830116810181811085821117156116b6576116b661162a565b6040529182528482019250838101850191888311156116d457600080fd5b938501935b82851015610ae2578451845293850193928501926116d9565b634e487b7160e01b600052603260045260246000fd5b60005b8381101561172357818101518382015260200161170b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611764816017850160208801611708565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611795816028840160208801611708565b01602801949350505050565b60208152600082518060208401526117c0816040850160208701611708565b601f01601f19169190910160400192915050565b6000816117e3576117e3611569565b506000190190565b634e487b7160e01b600052603160045260246000fdfea164736f6c6343000811000a

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

0000000000000000000000000e67601818237834ff8a280312a6f4f4934e6283000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae

-----Decoded View---------------
Arg [0] : _TMAP (address): 0x0e67601818237834fF8A280312a6F4F4934e6283
Arg [1] : _DPS (address): 0x224AcB257f1E95Fe310E1ab9BB402C579bC5eeAE

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000e67601818237834ff8a280312a6f4f4934e6283
Arg [1] : 000000000000000000000000224acb257f1e95fe310e1ab9bb402c579bc5eeae


Block Transaction Gas Used Reward
view all blocks collator

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

OVERVIEW

Lazy Staking for pirates.

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.