BNB Price: $612.38 (+2.46%)
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Claim Reward924312082026-04-14 5:33:0057 secs ago1776144780IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924310502026-04-14 5:31:492 mins ago1776144709IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000001550.05
Claim Reward924310472026-04-14 5:31:482 mins ago1776144708IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924308802026-04-14 5:30:333 mins ago1776144633IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
Claim Reward924308762026-04-14 5:30:313 mins ago1776144631IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
Claim Reward924308732026-04-14 5:30:303 mins ago1776144630IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000007680.065
Claim Reward924308532026-04-14 5:30:213 mins ago1776144621IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924308042026-04-14 5:29:593 mins ago1776144599IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924307282026-04-14 5:29:244 mins ago1776144564IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924306312026-04-14 5:28:415 mins ago1776144521IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000101091
Claim Reward924306282026-04-14 5:28:395 mins ago1776144519IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
Claim Reward924306072026-04-14 5:28:305 mins ago1776144510IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000006630.06565
Claim Reward924306032026-04-14 5:28:285 mins ago1776144508IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
Claim Reward924306002026-04-14 5:28:275 mins ago1776144507IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000007680.065
Claim Reward924305922026-04-14 5:28:235 mins ago1776144503IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924305552026-04-14 5:28:065 mins ago1776144486IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000118191
Claim Reward924304962026-04-14 5:27:406 mins ago1776144460IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000007750.06565
Claim Reward924304532026-04-14 5:27:206 mins ago1776144440IN
0xc1c44b2F...ffa23E4ab
0 BNB0.00011821
Claim Reward924304292026-04-14 5:27:106 mins ago1776144430IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
Claim Reward924304212026-04-14 5:27:066 mins ago1776144426IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000007680.065
Claim Reward924303802026-04-14 5:26:487 mins ago1776144408IN
0xc1c44b2F...ffa23E4ab
0 BNB0.00011821
Claim Reward924303552026-04-14 5:26:367 mins ago1776144396IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000005050.05
Claim Reward924303072026-04-14 5:26:157 mins ago1776144375IN
0xc1c44b2F...ffa23E4ab
0 BNB0.00011821
Claim Reward924302402026-04-14 5:25:448 mins ago1776144344IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
Claim Reward924302352026-04-14 5:25:428 mins ago1776144342IN
0xc1c44b2F...ffa23E4ab
0 BNB0.000002020.065
View all transactions

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

Contract Source Code Verified (Exact Match)

Contract Name:
NapoleonReward

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/**
 * @title NapoleonReward
 * @dev 抽奖NPL奖励领取合约
 * 使用签名验证机制,后端生成签名,合约验证后转账NPL给用户
 */
contract NapoleonReward is AccessControl, ReentrancyGuard {
    using ECDSA for bytes32;
    using SafeERC20 for IERC20;

    bytes32 public constant SIGNER_ROLE = keccak256("SIGNER_ROLE");
    
    IERC20 public nplToken;
    address public signerAddress; // 签名者地址(后端私钥对应的地址)
    
    // 记录已使用的nonce(防止重放攻击,nonce通常是reward_id)
    mapping(uint256 => bool) public usedNonces;
    
    // 自定义错误(节省gas)
    error InvalidAmount();
    error InvalidSignatureLength();
    error InvalidRewardType();
    error NonceAlreadyUsed();
    error InvalidSignature();
    error ArrayLengthMismatch();
    error EmptyArrays();
    error InvalidAddress();
    
    // 事件(优化:减少非indexed参数)
    event RewardClaimed(
        address indexed user,
        uint256 indexed amount,
        uint256 indexed nonce,
        uint256 rewardType
    );
    
    event SignerAddressUpdated(address indexed oldSigner, address indexed newSigner);
    event NplTokenAddressUpdated(address indexed oldToken, address indexed newToken);

    /**
     * @dev 构造函数
     * @param _nplToken NPL代币合约地址
     * @param _signerAddress 签名者地址(后端私钥对应的地址)
     * @param _admin 管理员地址
     */
    constructor(
        address _nplToken,
        address _signerAddress,
        address _admin
    ) {
        if (_nplToken == address(0)) revert InvalidAddress();
        if (_signerAddress == address(0)) revert InvalidAddress();
        if (_admin == address(0)) revert InvalidAddress();
        
        nplToken = IERC20(_nplToken);
        signerAddress = _signerAddress;
        
        _grantRole(DEFAULT_ADMIN_ROLE, _admin);
        _grantRole(SIGNER_ROLE, _signerAddress);
    }

    /**
     * @dev 设置签名者地址(仅管理员)
     */
    function setSignerAddress(address _newSigner) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_newSigner == address(0)) revert InvalidAddress();
        address oldSigner = signerAddress;
        signerAddress = _newSigner;
        
        // 更新角色
        _revokeRole(SIGNER_ROLE, oldSigner);
        _grantRole(SIGNER_ROLE, _newSigner);
        
        emit SignerAddressUpdated(oldSigner, _newSigner);
    }

    /**
     * @dev 设置NPL代币地址(仅管理员)
     */
    function setNplTokenAddress(address _newToken) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_newToken == address(0)) revert InvalidAddress();
        address oldToken = address(nplToken);
        nplToken = IERC20(_newToken);
        emit NplTokenAddressUpdated(oldToken, _newToken);
    }

    /**
     * @dev 领取NPL奖励
     * @param amount 领取的NPL数量
     * @param nonce 随机数(用于防止重放攻击,通常是记录ID或时间戳)
     * @param rewardType 奖励类型(1=抽奖,2=每日算力,3=其他)
     * @param signature 后端生成的签名
     */
    function claimReward(
        uint256 amount,
        uint256 nonce,
        uint256 rewardType,
        bytes memory signature
    ) external nonReentrant {
        if (amount == 0) revert InvalidAmount();
        if (signature.length != 65) revert InvalidSignatureLength();
        if (rewardType == 0) revert InvalidRewardType();
        
        // 验证nonce是否已使用(防止重放攻击)
        if (usedNonces[nonce]) revert NonceAlreadyUsed();
        
        // 构建消息哈希(简化版本:只包含user, amount, nonce)
        bytes32 messageHash = keccak256(
            abi.encodePacked(
                "\x19Ethereum Signed Message:\n32",
                keccak256(abi.encodePacked(
                    msg.sender,
                    amount,
                    nonce
                ))
            )
        );
        
        // 验证签名
        address recoveredSigner = messageHash.recover(signature);
        if (recoveredSigner != signerAddress) revert InvalidSignature();
        
        // 标记nonce已使用
        usedNonces[nonce] = true;
        
        // 转账NPL给用户
        nplToken.safeTransfer(msg.sender, amount);
        
        emit RewardClaimed(msg.sender, amount, nonce, rewardType);
    }

    /**
     * @dev 批量领取NPL奖励(优化gas)
     * @param amounts 领取的NPL数量数组
     * @param nonces 随机数数组
     * @param rewardTypes 奖励类型数组(1=抽奖,2=每日算力,3=其他)
     * @param signatures 签名数组
     */
    function claimRewardBatch(
        uint256[] memory amounts,
        uint256[] memory nonces,
        uint256[] memory rewardTypes,
        bytes[] memory signatures
    ) external nonReentrant {
        uint256 length = amounts.length;
        if (length != nonces.length || length != rewardTypes.length || length != signatures.length) {
            revert ArrayLengthMismatch();
        }
        if (length == 0) revert EmptyArrays();
        
        uint256 totalAmount = 0;
        
        for (uint256 i = 0; i < length; ) {
            if (amounts[i] == 0) revert InvalidAmount();
            if (signatures[i].length != 65) revert InvalidSignatureLength();
            if (rewardTypes[i] == 0) revert InvalidRewardType();
            
            // 验证nonce是否已使用(防止重放攻击)
            if (usedNonces[nonces[i]]) revert NonceAlreadyUsed();
            
            // 构建消息哈希(简化版本:只包含user, amount, nonce)
            bytes32 messageHash = keccak256(
                abi.encodePacked(
                    "\x19Ethereum Signed Message:\n32",
                    keccak256(abi.encodePacked(
                        msg.sender,
                        amounts[i],
                        nonces[i]
                    ))
                )
            );
            
            // 验证签名
            address recoveredSigner = messageHash.recover(signatures[i]);
            if (recoveredSigner != signerAddress) revert InvalidSignature();
            
            // 标记nonce已使用
            usedNonces[nonces[i]] = true;
            
            totalAmount += amounts[i];
            
            emit RewardClaimed(msg.sender, amounts[i], nonces[i], rewardTypes[i]);
            
            unchecked {
                ++i;
            }
        }
        
        // 一次性转账总金额
        nplToken.safeTransfer(msg.sender, totalAmount);
    }

    /**
     * @dev 检查nonce是否已使用
     */
    function isNonceUsed(uint256 nonce) external view returns (bool) {
        return usedNonces[nonce];
    }

    /**
     * @dev 紧急提取NPL(仅管理员,用于紧急情况)
     * @param amount 提取的NPL数量(0表示提取全部余额)
     * @param to 接收地址(address(0)表示提取到管理员地址)
     */
    function emergencyWithdraw(uint256 amount, address to) external onlyRole(DEFAULT_ADMIN_ROLE) {
        address recipient = (to == address(0)) ? msg.sender : to;
        if (recipient == address(0)) revert InvalidAddress();
        
        uint256 balance = nplToken.balanceOf(address(this));
        uint256 withdrawAmount = (amount == 0) ? balance : amount;
        
        if (withdrawAmount == 0) revert InvalidAmount();
        if (withdrawAmount > balance) revert InvalidAmount();
        
        nplToken.safeTransfer(recipient, withdrawAmount);
    }

    /**
     * @dev 提取全部NPL余额到指定地址(仅管理员)
     * @param to 接收地址(address(0)表示提取到管理员地址)
     */
    function withdrawAll(address to) external onlyRole(DEFAULT_ADMIN_ROLE) {
        address recipient = (to == address(0)) ? msg.sender : to;
        if (recipient == address(0)) revert InvalidAddress();
        
        uint256 balance = nplToken.balanceOf(address(this));
        if (balance == 0) revert InvalidAmount();
        
        nplToken.safeTransfer(recipient, balance);
    }

    /**
     * @dev 获取合约中的NPL余额
     */
    function getContractBalance() external view returns (uint256) {
        return nplToken.balanceOf(address(this));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {IERC165, ERC165} from "../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:
 *
 * ```solidity
 * 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}:
 *
 * ```solidity
 * 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. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /// @inheritdoc IERC165
    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 returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @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 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 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 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 `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/IAccessControl.sol)

pragma solidity >=0.8.4;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @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 to signal this.
     */
    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. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    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 `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)

pragma solidity >=0.6.2;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 5 of 13 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)

pragma solidity >=0.4.16;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 6 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)

pragma solidity >=0.4.16;

import {IERC20} from "../token/ERC20/IERC20.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
     */
    function tryRecover(
        bytes32 hash,
        bytes memory signature
    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly ("memory-safe") {
                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, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        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[ERC-2098 short signatures]
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            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.
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
        // 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, s);
        }

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

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /// @inheritdoc IERC165
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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 (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * 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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_nplToken","type":"address"},{"internalType":"address","name":"_signerAddress","type":"address"},{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"EmptyArrays","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidRewardType","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSignatureLength","type":"error"},{"inputs":[],"name":"NonceAlreadyUsed","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldToken","type":"address"},{"indexed":true,"internalType":"address","name":"newToken","type":"address"}],"name":"NplTokenAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardType","type":"uint256"}],"name":"RewardClaimed","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":"oldSigner","type":"address"},{"indexed":true,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerAddressUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"rewardType","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"nonces","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardTypes","type":"uint256[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"claimRewardBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getContractBalance","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":"nonce","type":"uint256"}],"name":"isNonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nplToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newToken","type":"address"}],"name":"setNplTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newSigner","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"uint256","name":"","type":"uint256"}],"name":"usedNonces","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080346100e957601f61152338819003918201601f19168301916001600160401b038311848410176100ee578084926060946040528339810103126100e95761004781610104565b90610060604061005960208401610104565b9201610104565b60018055916001600160a01b031680156100d8576001600160a01b0382169283156100d8576001600160a01b038116156100d857600280546001600160a01b031990811690931790556003805490921690931790556100c8916100c290610118565b50610194565b50604051611296908161022d8239f35b63e6c4247b60e01b60005260046000fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036100e957565b6001600160a01b0381166000908152600080516020611503833981519152602052604090205460ff1661018e576001600160a01b0316600081815260008051602061150383398151915260205260408120805460ff191660011790553391906000805160206114c38339815191528180a4600190565b50600090565b6001600160a01b03811660009081526000805160206114e3833981519152602052604090205460ff1661018e576001600160a01b031660008181526000805160206114e383398151915260205260408120805460ff191660011790553391907fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70906000805160206114c38339815191529080a460019056fe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714610ba057508063046dc16614610b155780630ef79f54146107bb57806321a2238214610792578063248a9ca31461075d5780632f2ff15d1461071d5780632f940c701461063e57806336568abe146105f85780633f7acac5146105845780635b7633d01461055b5780635d00bb121461035e5780636209deb41461038f5780636717e41c1461035e5780636f9fb98a146102d557806391d1485414610288578063a1ebf35d1461024d578063a217fddf14610231578063d547741f146101ec5763fa09e630146100f057600080fd5b346101e75760203660031901126101e757610109610bf3565b610111610d4d565b6001600160a01b0381166101e25750335b6001600160a01b038116156101d1576002546040516370a0823160e01b81523060048201526001600160a01b0390911691602082602481865afa9182156101c55760009261018e575b50811561017d5761017b92611062565b005b63162908e360e11b60005260046000fd5b90916020823d6020116101bd575b816101a960209383610c1f565b810103126101ba575051903861016b565b80fd5b3d915061019c565b6040513d6000823e3d90fd5b63e6c4247b60e01b60005260046000fd5b610122565b600080fd5b346101e75760403660031901126101e75761017b60043561020b610c09565b9061022c61022782600052600060205260016040600020015490565b610da0565b610e89565b346101e75760003660031901126101e757602060405160008152f35b346101e75760003660031901126101e75760206040517fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f708152f35b346101e75760403660031901126101e7576102a1610c09565b600435600052600060205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346101e75760003660031901126101e7576002546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa80156101c55760009061032b575b602090604051908152f35b506020813d602011610356575b8161034560209383610c1f565b810103126101e75760209051610320565b3d9150610338565b346101e75760203660031901126101e7576004356000526004602052602060ff604060002054166040519015158152f35b346101e75760803660031901126101e75760243560043560443560643567ffffffffffffffff81116101e7576103c9903690600401610ccc565b6103d1611040565b821561017d57604181510361054a5781156105395783600052600460205260ff604060002054166105295761049661049f91604051602081019061044c8161043e8a8a338791605493916bffffffffffffffffffffffff199060601b168352601483015260348201520190565b03601f198101835282610c1f565b51902060405160208101917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c820152603c815261048e605c82610c1f565b5190206110f3565b9092919261112f565b6003546001600160a01b03908116911603610518576000838152600460205260409020805460ff191660011790556002546104e690839033906001600160a01b0316611062565b6040519081527f812be816db82c66cd18ca8457005cd84689642d8ac4d38599cc6af444a2dc72a60203392a460018055005b638baa579f60e01b60005260046000fd5b623f613760e71b60005260046000fd5b6359ea758160e11b60005260046000fd5b634be6321b60e01b60005260046000fd5b346101e75760003660031901126101e7576003546040516001600160a01b039091168152602090f35b346101e75760203660031901126101e75761059d610bf3565b6105a5610d4d565b6001600160a01b031680156101d157600280546001600160a01b0319811683179091556001600160a01b03167f86646a0661381d5cce3c89a20830408f0809062e6bda52aa3b4e6cbb8cfc780d600080a3005b346101e75760403660031901126101e757610611610c09565b336001600160a01b0382160361062d5761017b90600435610e89565b63334bd91960e11b60005260046000fd5b346101e75760403660031901126101e75760043561065a610c09565b610662610d4d565b6001600160a01b038116610717575033905b6001600160a01b038216156101d1576002546040516370a0823160e01b81523060048201526001600160a01b03909116929091602083602481875afa9283156101c5576000936106e3575b50806106dd5750815b821561017d57821161017d5761017b92611062565b916106c8565b90926020823d60201161070f575b816106fe60209383610c1f565b810103126101ba57505191846106bf565b3d91506106f1565b90610674565b346101e75760403660031901126101e75761017b60043561073c610c09565b9061075861022782600052600060205260016040600020015490565b610fbc565b346101e75760203660031901126101e757602061078a600435600052600060205260016040600020015490565b604051908152f35b346101e75760003660031901126101e7576002546040516001600160a01b039091168152602090f35b346101e75760803660031901126101e75760043567ffffffffffffffff81116101e7576107ec903690600401610c6f565b60243567ffffffffffffffff81116101e75761080c903690600401610c6f565b9060443567ffffffffffffffff81116101e75761082d903690600401610c6f565b6064359267ffffffffffffffff84116101e757366023850112156101e757836004013561085981610c57565b946108676040519687610c1f565b8186526024602087019260051b820101903682116101e75760248101925b828410610ae55750505050610898611040565b82519281518414801590610ada575b8015610acf575b610abe578315610aad579291906000936000955b8487106108e8576002546108e290879033906001600160a01b0316611062565b60018055005b90919293946108f78784610d23565b511561017d5760416109098884610d23565b51510361054a5761091a8786610d23565b51156105395761092a8785610d23565b51600052600460205260ff60406000205416610529576109ed6104966109508986610d23565b5161043e6109976109618c8a610d23565b516040519283916020830195338791605493916bffffffffffffffffffffffff199060601b168352601483015260348201520190565b51902060405160208101917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c820152603c81526109d9605c82610c1f565b5190206109e68a86610d23565b51906110f3565b6003546001600160a01b0390811691160361051857610a0c8785610d23565b5160005260046020526040600020600160ff19825416179055610a2f8784610d23565b518101809111610a975760019096610a478185610d23565b51610a528287610d23565b5190610a5e8389610d23565b516040519081527f812be816db82c66cd18ca8457005cd84689642d8ac4d38599cc6af444a2dc72a60203392a4019594939291906108c2565b634e487b7160e01b600052601160045260246000fd5b63a600c81d60e01b60005260046000fd5b63512509d360e11b60005260046000fd5b5084518414156108ae565b5082518414156108a7565b833567ffffffffffffffff81116101e757602091610b0a839260243691870101610ccc565b815201930192610885565b346101e75760203660031901126101e757610b2e610bf3565b610b36610d4d565b6001600160a01b0381169081156101d157600380546001600160a01b0319811684179091556001600160a01b031690610b7890610b7283610ddb565b50610f12565b507f161a11d78e4c8a98c15b73ea9fd62ecc47a26992a28ca57d3307f1568dd637de600080a3005b346101e75760203660031901126101e7576004359063ffffffff60e01b82168092036101e757602091637965db0b60e01b8114908115610be2575b5015158152f35b6301ffc9a760e01b14905083610bdb565b600435906001600160a01b03821682036101e757565b602435906001600160a01b03821682036101e757565b90601f8019910116810190811067ffffffffffffffff821117610c4157604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff8111610c415760051b60200190565b9080601f830112156101e7578135610c8681610c57565b92610c946040519485610c1f565b81845260208085019260051b8201019283116101e757602001905b828210610cbc5750505090565b8135815260209182019101610caf565b81601f820112156101e75780359067ffffffffffffffff8211610c415760405192610d01601f8401601f191660200185610c1f565b828452602083830101116101e757816000926020809301838601378301015290565b8051821015610d375760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b3360009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff1615610d8657565b63e2517d3f60e01b60005233600452600060245260446000fd5b60008181526020818152604080832033845290915290205460ff1615610dc35750565b63e2517d3f60e01b6000523360045260245260446000fd5b6001600160a01b0381166000908152600080516020611241833981519152602052604090205460ff1615610e83576001600160a01b0316600081815260008051602061124183398151915260205260408120805460ff191690553391907fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b50600090565b6000818152602081815260408083206001600160a01b038616845290915290205460ff1615610f0b576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b5050600090565b6001600160a01b0381166000908152600080516020611241833981519152602052604090205460ff16610e83576001600160a01b0316600081815260008051602061124183398151915260205260408120805460ff191660011790553391907fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6000818152602081815260408083206001600160a01b038616845290915290205460ff16610f0b576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b600260015414611051576002600155565b633ee5aeb560e01b60005260046000fd5b60405163a9059cbb60e01b60208281019182526001600160a01b03909416602483015260448083019590955293815290926000916110a1606482610c1f565b519082855af1156101c5576000513d6110ea57506001600160a01b0381163b155b6110c95750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156110c2565b81519190604183036111245761111d92506020820151906060604084015193015160001a906111b7565b9192909190565b505060009160029190565b91909160048110156111a1578061114557509050565b6000600182036111605763f645eedf60e01b60005260046000fd5b506002810361117e578263fce698f760e01b60005260045260246000fd5b909160036000921461118e575050565b6335e2f38360e21b825260045260249150fd5b634e487b7160e01b600052602160045260246000fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611234579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa156101c5576000516001600160a01b038116156112285790600090600090565b50600090600190600090565b5050506000916003919056fe059f08e7d7ba1c82eddc57afae67f80df851baf38a099607a779825038c3ce5ba264697066735822122035d059d666d9dd4d1329ccae640abc0c2ec379aab0e8ac8aa538144e4928b3e064736f6c634300081c00332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d059f08e7d7ba1c82eddc57afae67f80df851baf38a099607a779825038c3ce5bad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb50000000000000000000000004e8277ab31e4956b2cd48449793a57656dfc03d200000000000000000000000007e0387284ac8142573954307ed394e086b4d94a0000000000000000000000006c9d807361740d4519ce857dc051b333930be5c1

Deployed Bytecode

0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714610ba057508063046dc16614610b155780630ef79f54146107bb57806321a2238214610792578063248a9ca31461075d5780632f2ff15d1461071d5780632f940c701461063e57806336568abe146105f85780633f7acac5146105845780635b7633d01461055b5780635d00bb121461035e5780636209deb41461038f5780636717e41c1461035e5780636f9fb98a146102d557806391d1485414610288578063a1ebf35d1461024d578063a217fddf14610231578063d547741f146101ec5763fa09e630146100f057600080fd5b346101e75760203660031901126101e757610109610bf3565b610111610d4d565b6001600160a01b0381166101e25750335b6001600160a01b038116156101d1576002546040516370a0823160e01b81523060048201526001600160a01b0390911691602082602481865afa9182156101c55760009261018e575b50811561017d5761017b92611062565b005b63162908e360e11b60005260046000fd5b90916020823d6020116101bd575b816101a960209383610c1f565b810103126101ba575051903861016b565b80fd5b3d915061019c565b6040513d6000823e3d90fd5b63e6c4247b60e01b60005260046000fd5b610122565b600080fd5b346101e75760403660031901126101e75761017b60043561020b610c09565b9061022c61022782600052600060205260016040600020015490565b610da0565b610e89565b346101e75760003660031901126101e757602060405160008152f35b346101e75760003660031901126101e75760206040517fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f708152f35b346101e75760403660031901126101e7576102a1610c09565b600435600052600060205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346101e75760003660031901126101e7576002546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa80156101c55760009061032b575b602090604051908152f35b506020813d602011610356575b8161034560209383610c1f565b810103126101e75760209051610320565b3d9150610338565b346101e75760203660031901126101e7576004356000526004602052602060ff604060002054166040519015158152f35b346101e75760803660031901126101e75760243560043560443560643567ffffffffffffffff81116101e7576103c9903690600401610ccc565b6103d1611040565b821561017d57604181510361054a5781156105395783600052600460205260ff604060002054166105295761049661049f91604051602081019061044c8161043e8a8a338791605493916bffffffffffffffffffffffff199060601b168352601483015260348201520190565b03601f198101835282610c1f565b51902060405160208101917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c820152603c815261048e605c82610c1f565b5190206110f3565b9092919261112f565b6003546001600160a01b03908116911603610518576000838152600460205260409020805460ff191660011790556002546104e690839033906001600160a01b0316611062565b6040519081527f812be816db82c66cd18ca8457005cd84689642d8ac4d38599cc6af444a2dc72a60203392a460018055005b638baa579f60e01b60005260046000fd5b623f613760e71b60005260046000fd5b6359ea758160e11b60005260046000fd5b634be6321b60e01b60005260046000fd5b346101e75760003660031901126101e7576003546040516001600160a01b039091168152602090f35b346101e75760203660031901126101e75761059d610bf3565b6105a5610d4d565b6001600160a01b031680156101d157600280546001600160a01b0319811683179091556001600160a01b03167f86646a0661381d5cce3c89a20830408f0809062e6bda52aa3b4e6cbb8cfc780d600080a3005b346101e75760403660031901126101e757610611610c09565b336001600160a01b0382160361062d5761017b90600435610e89565b63334bd91960e11b60005260046000fd5b346101e75760403660031901126101e75760043561065a610c09565b610662610d4d565b6001600160a01b038116610717575033905b6001600160a01b038216156101d1576002546040516370a0823160e01b81523060048201526001600160a01b03909116929091602083602481875afa9283156101c5576000936106e3575b50806106dd5750815b821561017d57821161017d5761017b92611062565b916106c8565b90926020823d60201161070f575b816106fe60209383610c1f565b810103126101ba57505191846106bf565b3d91506106f1565b90610674565b346101e75760403660031901126101e75761017b60043561073c610c09565b9061075861022782600052600060205260016040600020015490565b610fbc565b346101e75760203660031901126101e757602061078a600435600052600060205260016040600020015490565b604051908152f35b346101e75760003660031901126101e7576002546040516001600160a01b039091168152602090f35b346101e75760803660031901126101e75760043567ffffffffffffffff81116101e7576107ec903690600401610c6f565b60243567ffffffffffffffff81116101e75761080c903690600401610c6f565b9060443567ffffffffffffffff81116101e75761082d903690600401610c6f565b6064359267ffffffffffffffff84116101e757366023850112156101e757836004013561085981610c57565b946108676040519687610c1f565b8186526024602087019260051b820101903682116101e75760248101925b828410610ae55750505050610898611040565b82519281518414801590610ada575b8015610acf575b610abe578315610aad579291906000936000955b8487106108e8576002546108e290879033906001600160a01b0316611062565b60018055005b90919293946108f78784610d23565b511561017d5760416109098884610d23565b51510361054a5761091a8786610d23565b51156105395761092a8785610d23565b51600052600460205260ff60406000205416610529576109ed6104966109508986610d23565b5161043e6109976109618c8a610d23565b516040519283916020830195338791605493916bffffffffffffffffffffffff199060601b168352601483015260348201520190565b51902060405160208101917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c820152603c81526109d9605c82610c1f565b5190206109e68a86610d23565b51906110f3565b6003546001600160a01b0390811691160361051857610a0c8785610d23565b5160005260046020526040600020600160ff19825416179055610a2f8784610d23565b518101809111610a975760019096610a478185610d23565b51610a528287610d23565b5190610a5e8389610d23565b516040519081527f812be816db82c66cd18ca8457005cd84689642d8ac4d38599cc6af444a2dc72a60203392a4019594939291906108c2565b634e487b7160e01b600052601160045260246000fd5b63a600c81d60e01b60005260046000fd5b63512509d360e11b60005260046000fd5b5084518414156108ae565b5082518414156108a7565b833567ffffffffffffffff81116101e757602091610b0a839260243691870101610ccc565b815201930192610885565b346101e75760203660031901126101e757610b2e610bf3565b610b36610d4d565b6001600160a01b0381169081156101d157600380546001600160a01b0319811684179091556001600160a01b031690610b7890610b7283610ddb565b50610f12565b507f161a11d78e4c8a98c15b73ea9fd62ecc47a26992a28ca57d3307f1568dd637de600080a3005b346101e75760203660031901126101e7576004359063ffffffff60e01b82168092036101e757602091637965db0b60e01b8114908115610be2575b5015158152f35b6301ffc9a760e01b14905083610bdb565b600435906001600160a01b03821682036101e757565b602435906001600160a01b03821682036101e757565b90601f8019910116810190811067ffffffffffffffff821117610c4157604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff8111610c415760051b60200190565b9080601f830112156101e7578135610c8681610c57565b92610c946040519485610c1f565b81845260208085019260051b8201019283116101e757602001905b828210610cbc5750505090565b8135815260209182019101610caf565b81601f820112156101e75780359067ffffffffffffffff8211610c415760405192610d01601f8401601f191660200185610c1f565b828452602083830101116101e757816000926020809301838601378301015290565b8051821015610d375760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b3360009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff1615610d8657565b63e2517d3f60e01b60005233600452600060245260446000fd5b60008181526020818152604080832033845290915290205460ff1615610dc35750565b63e2517d3f60e01b6000523360045260245260446000fd5b6001600160a01b0381166000908152600080516020611241833981519152602052604090205460ff1615610e83576001600160a01b0316600081815260008051602061124183398151915260205260408120805460ff191690553391907fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b50600090565b6000818152602081815260408083206001600160a01b038616845290915290205460ff1615610f0b576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b5050600090565b6001600160a01b0381166000908152600080516020611241833981519152602052604090205460ff16610e83576001600160a01b0316600081815260008051602061124183398151915260205260408120805460ff191660011790553391907fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6000818152602081815260408083206001600160a01b038616845290915290205460ff16610f0b576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b600260015414611051576002600155565b633ee5aeb560e01b60005260046000fd5b60405163a9059cbb60e01b60208281019182526001600160a01b03909416602483015260448083019590955293815290926000916110a1606482610c1f565b519082855af1156101c5576000513d6110ea57506001600160a01b0381163b155b6110c95750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156110c2565b81519190604183036111245761111d92506020820151906060604084015193015160001a906111b7565b9192909190565b505060009160029190565b91909160048110156111a1578061114557509050565b6000600182036111605763f645eedf60e01b60005260046000fd5b506002810361117e578263fce698f760e01b60005260045260246000fd5b909160036000921461118e575050565b6335e2f38360e21b825260045260249150fd5b634e487b7160e01b600052602160045260246000fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611234579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa156101c5576000516001600160a01b038116156112285790600090600090565b50600090600190600090565b5050506000916003919056fe059f08e7d7ba1c82eddc57afae67f80df851baf38a099607a779825038c3ce5ba264697066735822122035d059d666d9dd4d1329ccae640abc0c2ec379aab0e8ac8aa538144e4928b3e064736f6c634300081c0033

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

0000000000000000000000004e8277ab31e4956b2cd48449793a57656dfc03d200000000000000000000000007e0387284ac8142573954307ed394e086b4d94a0000000000000000000000006c9d807361740d4519ce857dc051b333930be5c1

-----Decoded View---------------
Arg [0] : _nplToken (address): 0x4E8277AB31e4956b2CD48449793a57656DfC03D2
Arg [1] : _signerAddress (address): 0x07e0387284Ac8142573954307ED394e086B4d94a
Arg [2] : _admin (address): 0x6c9d807361740d4519Ce857dC051B333930bE5C1

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004e8277ab31e4956b2cd48449793a57656dfc03d2
Arg [1] : 00000000000000000000000007e0387284ac8142573954307ed394e086b4d94a
Arg [2] : 0000000000000000000000006c9d807361740d4519ce857dc051b333930be5c1


Block Transaction Gas Used Reward
view all blocks produced
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
View All Validatorset

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.