ETH Price: $3,432.92 (-2.36%)

Contract

0x0000000088E218FBA179D848062A9B95B4D3d632
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
192611202024-02-19 10:14:47305 days ago1708337687  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ParabolSoulBoundToken

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 99999 runs

Other Settings:
shanghai EvmVersion
File 1 of 27 : ParabolSoulBoundToken.sol
//SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import {SoulBoundERC20BaseUpgradeable} from "./base/SoulBoundERC20BaseUpgradeable.sol";
import {SoulBoundPermitUpgradeable} from "./base/SoulBoundPermitUpgradeable.sol";
import {SoulBoundMintPermitUpgradeable} from "./base/SoulBoundMintPermitUpgradeable.sol";
import {IParabolSoulBoundToken} from "./interfaces/IParabolSoulBoundToken.sol";
import {IParabolSoulBoundTokenErrors} from "./interfaces/errors/IParabolSoulBoundTokenErrors.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

/**
 * @title Parabol SoulBound Token
 * @notice Implements a non-transferable SoulBound token for the Parabol platform, following the EIP-20 standard with
 * extensions for upgradeability, access control, and pausability.
 * @dev This contract extends OpenZeppelin's upgradeable contracts for role-based access control, pausability, and
 * UUPS upgrades. It incorporates SoulBound token functionality, disallowing transfers after minting, to represent
 * non-transferable assets on the blockchain.
 */
contract ParabolSoulBoundToken is
    UUPSUpgradeable,
    AccessControlUpgradeable,
    PausableUpgradeable,
    SoulBoundPermitUpgradeable,
    SoulBoundMintPermitUpgradeable,
    IParabolSoulBoundToken,
    IParabolSoulBoundTokenErrors
{
    /**
     * @dev Roles for burning tokens and pausing the contract, represented by their respective bytes32 identifiers.
     */
    bytes32 public constant BURNER_ROLE =
        0x3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848;
    bytes32 public constant PAUSER_ROLE =
        0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a;

    struct ParabolSoulBoundTokenStorage {
        Counter _orderCounter;
        Counter _stageCounter;
        mapping(address account => mapping(uint256 orderId => uint256 balance)) _orderBalances;
        mapping(address account => mapping(uint256 stageId => uint256 balance)) _stageBalances;
        mapping(uint256 stageId => StageInfo) _stageInfo;
    }

    // keccak256(abi.encode(uint256(keccak256("parabol.storage.ParabolSoulBoundToken")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant ParabolSoulBoundTokenStorageLocation =
        0x9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f00;

    /**
     * @dev Internal function to access the contract's custom storage structure. Uses EVM assembly for direct
     * storage interaction, optimizing for efficient data storage and retrieval. The unique storage location
     * is calculated to avoid collisions with other contracts.
     * @return $ A reference to the contract's custom storage structure.
     */
    function _getParabolSoulBoundTokenStorage()
        private
        pure
        returns (ParabolSoulBoundTokenStorage storage $)
    {
        assembly {
            $.slot := ParabolSoulBoundTokenStorageLocation
        }
    }

    /**
     * @dev Returns the current order counter value.
     * @return The current value of the order counter.
     */
    function orderCounter() external view returns (uint256) {
        return _getParabolSoulBoundTokenStorage()._orderCounter._value;
    }

    /**
     * @dev Returns the current stage counter value.
     * @return The current value of the stage counter.
     */
    function stageCounter() external view returns (uint256) {
        return _getParabolSoulBoundTokenStorage()._stageCounter._value;
    }

    /**
     * @dev Returns the balance of a given stage for a specific account.
     * @param account The address of the account.
     * @param stageId The identifier of the stage.
     * @return The balance of the specified stage for the given account.
     */
    function stageBalances(
        address account,
        uint256 stageId
    ) external view returns (uint256) {
        return
            _getParabolSoulBoundTokenStorage()._stageBalances[account][stageId];
    }

    /**
     * @dev Returns the balance of a given order for a specific account.
     * @param account The address of the account.
     * @param order The identifier of the order.
     * @return The balance of the specified order for the given account.
     */
    function orderBalances(
        address account,
        uint256 order
    ) external view returns (uint256) {
        return
            _getParabolSoulBoundTokenStorage()._orderBalances[account][order];
    }

    /**
     * @dev Returns information about a specific stage.
     * @param stage The identifier of the stage.
     * @return A StageInfo struct containing details about the stage.
     */
    function stageInfo(uint256 stage) external view returns (StageInfo memory) {
        return _getParabolSoulBoundTokenStorage()._stageInfo[stage];
    }

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    /**
     * @notice Initializes the contract with given parameters, setting up roles and initializing base contracts.
     * @dev Sets initial values for token metadata and roles, initializing inherited contracts. Reverts if critical
     * addresses are zero.
     * @param name_ Token name.
     * @param symbol_ Token symbol.
     * @param version_ Contract version.
     * @param pauser_ Address with the pauser role.
     * @param signer_ Address for mint permit signatures.
     * @param admin_ Address with the default admin role.
     */
    function initialize(
        string memory name_,
        string memory symbol_,
        string memory version_,
        address pauser_,
        address signer_,
        address admin_
    ) external initializer {
        if (
            pauser_ == address(0) ||
            signer_ == address(0) ||
            admin_ == address(0)
        ) revert ParabolSoulBoundToken__ZeroAddress();
        __SoulBoundERC20Base_init_unchained(name_, symbol_, version_);
        __SoulBoundMintPermit_init_unchained(signer_);
        __Pausable_init_unchained();

        _grantRole(DEFAULT_ADMIN_ROLE, admin_);
        _grantRole(PAUSER_ROLE, pauser_);
        _setRoleAdmin(BURNER_ROLE, DEFAULT_ADMIN_ROLE);
        _setRoleAdmin(PAUSER_ROLE, DEFAULT_ADMIN_ROLE);
    }

    /**
     * @notice Starts a new stage for minting with specific caps and limits.
     * @dev Only callable by the default admin role. Validates input parameters and updates stage storage.
     * @param cap Maximum number of tokens that can be minted in this stage.
     * @param accountMintLimit Maximum number of tokens an account can mint in this stage.
     * @param endTimestamp Timestamp when the stage ends.
     */
    function startStage(
        uint256 cap,
        uint256 accountMintLimit,
        uint256 endTimestamp
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (cap == 0) revert ParabolSoulBoundToken__ZeroCap();
        if (accountMintLimit == 0)
            revert ParabolSoulBoundToken__ZeroAccountMintLimit();
        if (endTimestamp <= block.timestamp)
            revert ParabolSoulBoundToken__InvalidStageEndTimestamp(
                endTimestamp,
                block.timestamp
            );

        uint256 stageId = _incrementAndGetStageId();
        _getParabolSoulBoundTokenStorage()._stageInfo[stageId] = StageInfo({
            cap: cap,
            minted: 0,
            accountMintLimit: accountMintLimit,
            endTimestamp: endTimestamp
        });

        emit StartStage(stageId, cap, accountMintLimit, endTimestamp);
    }

    /**
     * @notice Pauses all actions affecting token balances. Can only be called by the account with the pauser role.
     * @dev This function pauses the contract, preventing execution of actions that alter token balances,
     * such as minting or burning. It's a security feature to halt operations in case of an emergency.
     */
    function pause() external onlyRole(PAUSER_ROLE) {
        _pause();
    }

    /**
     * @notice Unpauses all actions affecting token balances. Can only be called by the account with the pauser role.
     * @dev This function unpauses the contract, allowing execution of actions that alter token balances,
     * such as minting or burning. It should be used with caution, ensuring that the reasons for initially
     * pausing the contract have been resolved.
     */
    function unpause() external onlyRole(PAUSER_ROLE) {
        _unpause();
    }

    /**
     * @notice Mints tokens to the specified account based on the provided mint permit. Can only be executed
     * when the contract is not paused.
     * @dev Validates the mint permit and stage conditions before minting tokens. It updates the internal storage
     * to reflect the minted tokens. Reverts if mint conditions are not met or the mint permit is invalid.
     * @param mintPermit The mint permit containing authorization details for minting.
     * @param signature The signature of the mint permit, proving authorization.
     * @param mintAmount The amount of tokens to mint.
     */
    function mint(
        MintPermit calldata mintPermit,
        Signature calldata signature,
        uint256 mintAmount
    ) external whenNotPaused {
        if (mintPermit.owner == address(0))
            revert ParabolSoulBoundToken__ZeroAddress();
        if (mintPermit.amount == 0) revert ParabolSoulBoundToken__ZeroAmount();

        _validateMintPermitSignature(mintPermit, signature);
        _validateStageAndUpdateMinted(mintAmount, mintPermit.stageId);
        _validateAndUpdateStageBalance(
            mintPermit.owner,
            mintPermit.stageId,
            mintPermit.amount,
            mintAmount
        );

        uint256 orderId = _incrementAndGetOrderId();
        _getParabolSoulBoundTokenStorage()._orderBalances[mintPermit.owner][
                orderId
            ] = mintAmount;

        _mint(mintPermit.owner, mintAmount);
        emit Mint(mintPermit.owner, mintAmount, mintPermit.stageId, orderId);
    }

    /**
     * @notice Burns the specified amount of tokens from an order. Can only be executed by the account with
     * the burner role and when the contract is not paused.
     * @dev Validates the order and amount before burning tokens. It updates the internal storage to reflect
     * the burned tokens. Reverts if burn conditions are not met.
     * @param account The account from which tokens will be burned.
     * @param amount The amount of tokens to burn.
     * @param orderId The identifier of the order from which tokens are burned.
     */
    function burn(
        address account,
        uint256 amount,
        uint256 orderId
    ) external whenNotPaused onlyRole(BURNER_ROLE) {
        if (account == address(0)) revert ParabolSoulBoundToken__ZeroAddress();
        if (amount == 0) revert ParabolSoulBoundToken__ZeroAmount();
        if (orderId > _getParabolSoulBoundTokenStorage()._orderCounter._value)
            revert ParabolSoulBoundToken__OrderNotExists(orderId);
        if (allowance(account, msg.sender) < amount)
            revert ParabolSoulBoundToken__InsufficientAllowance(
                msg.sender,
                allowance(account, msg.sender),
                amount
            );
        _validateAndDecreaseOrderBalance(account, orderId, amount);
        _spendAllowance(account, msg.sender, amount);
        _burn(account, amount);
        emit Burn(account, amount, orderId);
    }

    /**
     * @dev Returns the domain separator used in the EIP-712 domain structure.
     * @return The domain separator.
     */
    function DOMAIN_SEPARATOR()
        public
        view
        override(SoulBoundERC20BaseUpgradeable, SoulBoundPermitUpgradeable)
        returns (bytes32)
    {
        return SoulBoundERC20BaseUpgradeable.DOMAIN_SEPARATOR();
    }

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {burn}. This is
     * zero by default.
     * @param owner address The address which owns the funds.
     * @param spender address The address which will spend the funds.
     * @return The remaining amount of tokens `spender` is allowed to spend.
     */
    function allowance(
        address owner,
        address spender
    )
        public
        view
        override(SoulBoundERC20BaseUpgradeable, IParabolSoulBoundToken)
        returns (uint256)
    {
        return SoulBoundERC20BaseUpgradeable.allowance(owner, spender);
    }

    /**
     * @dev Reverts as transfers are disabled in this SoulBound token implementation.
     */
    function transfer(address, uint256) public pure returns (bool) {
        revert ParabolSoulBoundToken__TransferDisabled();
    }

    /**
     * @dev Reverts as transferFrom operations are disabled in this SoulBound token implementation.
     */
    function transferFrom(
        address,
        address,
        uint256
    ) public pure returns (bool) {
        revert ParabolSoulBoundToken__TransferDisabled();
    }

    /**
     * @dev Internal function to increment and return the next stage ID.
     * @return The next stage ID.
     */
    function _incrementAndGetStageId() internal returns (uint256) {
        ParabolSoulBoundTokenStorage
            storage $ = _getParabolSoulBoundTokenStorage();

        unchecked {
            return ++$._stageCounter._value;
        }
    }

    /**
     * @dev Internal function to validate the current stage and update the amount minted.
     * @param amount The amount to mint.
     * @param stageId The stage ID to validate against.
     */
    function _validateStageAndUpdateMinted(
        uint256 amount,
        uint256 stageId
    ) internal {
        ParabolSoulBoundTokenStorage
            storage $ = _getParabolSoulBoundTokenStorage();
        StageInfo storage _stageInfo = $._stageInfo[stageId];

        if ($._stageCounter._value < stageId)
            revert ParabolSoulBoundToken__StageNotExists(stageId);

        if (_stageInfo.endTimestamp < block.timestamp)
            revert ParabolSoulBoundToken__StageEnded(
                stageId,
                _stageInfo.endTimestamp,
                block.timestamp
            );

        uint256 totalMinted = _stageInfo.minted + amount;
        if (totalMinted > _stageInfo.cap)
            revert ParabolSoulBoundToken__StageCapReached(
                stageId,
                _stageInfo.cap,
                _stageInfo.minted,
                amount
            );

        _stageInfo.minted = totalMinted;
    }

    /**
     * @dev Internal function to validate and update the stage balance for minting operations.
     * @param owner The owner of the tokens.
     * @param stageId The stage ID to validate against.
     * @param allowedAmount The amount allowed to mint.
     * @param mintAmount The amount to mint.
     */
    function _validateAndUpdateStageBalance(
        address owner,
        uint256 stageId,
        uint256 allowedAmount,
        uint256 mintAmount
    ) internal {
        ParabolSoulBoundTokenStorage
            storage $ = _getParabolSoulBoundTokenStorage();

        StageInfo storage _stageInfo = $._stageInfo[stageId];

        uint256 totalAmount = $._stageBalances[owner][stageId] + mintAmount;

        if (totalAmount > allowedAmount)
            revert ParabolSoulBoundToken__StageBalanceLimitExceeded(
                stageId,
                allowedAmount,
                totalAmount
            );
        if (totalAmount > _stageInfo.accountMintLimit)
            revert ParabolSoulBoundToken__StageAccountMintLimitExceeded(
                stageId,
                _stageInfo.accountMintLimit,
                totalAmount
            );

        $._stageBalances[owner][stageId] = totalAmount;
    }

    /**
     * @dev Internal function to increment and return the next order ID.
     * @return The next order ID.
     */
    function _incrementAndGetOrderId() internal returns (uint256) {
        ParabolSoulBoundTokenStorage
            storage $ = _getParabolSoulBoundTokenStorage();

        unchecked {
            return ++$._orderCounter._value;
        }
    }

    /**
     * @dev Internal function to validate and decrease the order balance for burn operations.
     * @param account The account from which tokens are burned.
     * @param orderId The order ID to validate against.
     * @param burnAmount The amount of tokens to burn.
     */
    function _validateAndDecreaseOrderBalance(
        address account,
        uint256 orderId,
        uint256 burnAmount
    ) internal {
        ParabolSoulBoundTokenStorage
            storage $ = _getParabolSoulBoundTokenStorage();
        uint256 orderAmount = $._orderBalances[account][orderId];

        if (orderAmount < burnAmount)
            revert ParabolSoulBoundToken__InsufficientOrderAmount(
                orderAmount,
                burnAmount
            );

        if (orderAmount == burnAmount) {
            delete $._orderBalances[account][orderId];
        } else {
            unchecked {
                $._orderBalances[account][orderId] -= burnAmount;
            }
        }
    }

    /**
     * @notice Sets a new signer for mint permits.
     * @dev Only callable by the default admin role. Updates the signer for mint permits.
     * @param signer The new signer address.
     */
    function setMintPermitSigner(
        address signer
    ) external override onlyRole(DEFAULT_ADMIN_ROLE) {
        _setMintPermitSigner(signer);
    }

    /**
     * @dev Internal function to authorize contract upgrades. Only callable by the default admin role.
     * @param newImplementation The address of the new contract implementation.
     */
    function _authorizeUpgrade(
        address newImplementation
    ) internal override onlyRole(DEFAULT_ADMIN_ROLE) {}
}

File 2 of 27 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;


    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl
    struct AccessControlStorage {
        mapping(bytes32 role => RoleData) _roles;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;

    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {
        assembly {
            $.slot := AccessControlStorageLocation
        }
    }

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

    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    /**
     * @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 returns (bool) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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 {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (!hasRole(role, account)) {
            $._roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (hasRole(role, account)) {
            $._roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 3 of 27 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

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

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

File 4 of 27 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.20;

import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable __self = address(this);

    /**
     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
     * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
     * during an upgrade.
     */
    string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

    /**
     * @dev The call is from an unauthorized context.
     */
    error UUPSUnauthorizedCallContext();

    /**
     * @dev The storage `slot` is unsupported as a UUID.
     */
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        _checkProxy();
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        _checkNotDelegated();
        _;
    }

    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual notDelegated returns (bytes32) {
        return ERC1967Utils.IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data);
    }

    /**
     * @dev Reverts if the execution is not performed via delegatecall or the execution
     * context is not of a proxy with an ERC1967-compliant implementation pointing to self.
     * See {_onlyProxy}.
     */
    function _checkProxy() internal view virtual {
        if (
            address(this) == __self || // Must be called through delegatecall
            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
        ) {
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Reverts if the execution is performed via delegatecall.
     * See {notDelegated}.
     */
    function _checkNotDelegated() internal view virtual {
        if (address(this) != __self) {
            // Must not be called through delegatecall
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
     *
     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
     * is expected to be the implementation slot in ERC1967.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
                revert UUPSUnsupportedProxiableUUID(slot);
            }
            ERC1967Utils.upgradeToAndCall(newImplementation, data);
        } catch {
            // The implementation is not UUPS
            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
        }
    }
}

File 5 of 27 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    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;
    }
}

File 6 of 27 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../proxy/utils/Initializable.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);
 * }
 * ```
 */
abstract contract ERC165Upgradeable is Initializable, IERC165 {
    function __ERC165_init() internal onlyInitializing {
    }

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

File 7 of 27 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable
    struct PausableStorage {
        bool _paused;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;

    function _getPausableStorage() private pure returns (PausableStorage storage $) {
        assembly {
            $.slot := PausableStorageLocation
        }
    }

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        PausableStorage storage $ = _getPausableStorage();
        $._paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        PausableStorage storage $ = _getPausableStorage();
        return $._paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        PausableStorage storage $ = _getPausableStorage();
        $._paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        PausableStorage storage $ = _getPausableStorage();
        $._paused = false;
        emit Unpaused(_msgSender());
    }
}

File 8 of 27 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 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 signaling 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, 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 `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 9 of 27 : draft-IERC1822.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 10 of 27 : IERC1271.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

File 11 of 27 : IBeacon.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 12 of 27 : ERC1967Utils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.20;

import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 */
library ERC1967Utils {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @dev Returns the current implementation address.
     */
    function getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);

        if (data.length > 0) {
            Address.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-AdminChanged} event.
     */
    function changeAdmin(address newAdmin) internal {
        emit AdminChanged(getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeacon(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

File 13 of 27 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

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

File 14 of 27 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

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

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

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

File 15 of 27 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

File 16 of 27 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

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

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

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

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

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

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

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

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

File 17 of 27 : SoulBoundERC20BaseUpgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

import {ISoulBoundERC20Base} from "../interfaces/ISoulBoundERC20Base.sol";
import {ISoulBoundERC20BaseErrors} from "../interfaces/errors/ISoulBoundERC20BaseErrors.sol";
import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";

/**
 * @title SoulBound ERC20 Base Upgradeable
 * @notice Provides a foundational ERC20 structure for SoulBound tokens, introducing basic functionalities
 * such as balance tracking and token metadata, adapted to the SoulBound concept where tokens cannot be transferred.
 * @dev This contract extends OpenZeppelin's ContextUpgradeable for operating in an upgradeable contract context.
 * It implements the ISoulBoundERC20Base interface while adhering to the non-transferability nature of SoulBound tokens.
 * Token balances are tracked, but transfer functions are intentionally omitted or modified to prevent token movement.
 */
abstract contract SoulBoundERC20BaseUpgradeable is
    Initializable,
    ContextUpgradeable,
    ISoulBoundERC20Base,
    ISoulBoundERC20BaseErrors
{
    struct SoulBoundERC20BaseStorage {
        mapping(address account => uint256) _balances;
        mapping(address account => mapping(address spender => uint256)) _allowances;
        uint256 _totalSupply;
        string _name;
        string _symbol;
        //@notice The keccak256 hash of the token's name used in the permit signature verification
        bytes32 _nameHash;
        //@notice The keccak256 hash of the token's version used in the permit signature verification
        bytes32 _versionHash;
    }

    // keccak256(abi.encode(uint256(keccak256("parabol.storage.SoulBoundERC20Base")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant SoulBoundERC20BaseStorageLocation =
        0xc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600;

    function _getSoulBoundERC20BaseStorage()
        private
        pure
        returns (SoulBoundERC20BaseStorage storage $)
    {
        assembly {
            $.slot := SoulBoundERC20BaseStorageLocation
        }
    }

    /**
     * @dev Initializes the SoulBound token with a name, symbol, and version. These are immutable after initial setup.
     * @param name_ The name of the token.
     * @param symbol_ The symbol of the token.
     * @param version_ The version of the contract, used in permit signature verification.
     */
    function __SoulBoundERC20Base_init(
        string memory name_,
        string memory symbol_,
        string memory version_
    ) internal onlyInitializing {
        __SoulBoundERC20Base_init_unchained(name_, symbol_, version_);
    }

    function __SoulBoundERC20Base_init_unchained(
        string memory name_,
        string memory symbol_,
        string memory version_
    ) internal onlyInitializing {
        SoulBoundERC20BaseStorage storage $ = _getSoulBoundERC20BaseStorage();
        $._name = name_;
        $._symbol = symbol_;
        $._nameHash = keccak256(bytes(name_));
        $._versionHash = keccak256(bytes(version_));
    }

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

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

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

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        SoulBoundERC20BaseStorage storage $ = _getSoulBoundERC20BaseStorage();
        return $._totalSupply;
    }

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

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

    /**
     * @dev Returns the domain separator used in the encoding of the signature for permits.
     * @return The EIP-712 domain separator.
     */
    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        SoulBoundERC20BaseStorage storage $ = _getSoulBoundERC20BaseStorage();
        return
            keccak256(
                abi.encode(
                    // keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')
                    0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f,
                    $._nameHash,
                    $._versionHash,
                    block.chainid,
                    address(this)
                )
            );
    }

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

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        SoulBoundERC20BaseStorage storage $ = _getSoulBoundERC20BaseStorage();
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            $._totalSupply += value;
        } else {
            uint256 fromBalance = $._balances[from];
            if (fromBalance < value) {
                revert SoulBoundERC20Base__InsufficientBalance(
                    from,
                    fromBalance,
                    value
                );
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                $._balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                $._totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                $._balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert SoulBoundERC20Base__InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert SoulBoundERC20Base__InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     * ```
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(
        address owner,
        address spender,
        uint256 value,
        bool emitEvent
    ) internal virtual {
        SoulBoundERC20BaseStorage storage $ = _getSoulBoundERC20BaseStorage();
        if (owner == address(0)) {
            revert SoulBoundERC20Base__InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert SoulBoundERC20Base__InvalidSpender(address(0));
        }
        $._allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

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

    /**
     * @dev Validates a given signature as per EIP-1271, if the signer is a contract, or EIP-712, if the signer is an EOA.
     * @param owner The presumed owner of the signature.
     * @param dataHash The hash of the data signed.
     * @param v The recovery byte of the signature.
     * @param r The first 32 bytes of the signature.
     * @param s The second 32 bytes of the signature.
     * @param isMintPermit A boolean indicating if the validation is for a mint permit.
     */
    function _requireValidSignature(
        address owner,
        bytes32 dataHash,
        uint8 v,
        bytes32 r,
        bytes32 s,
        bool isMintPermit
    ) internal view {
        bytes32 domainSeparator = DOMAIN_SEPARATOR();

        bytes32 digest;
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), dataHash)
            digest := keccak256(ptr, 0x42)
        }

        if (isMintPermit) {
            address recoveredAddress = ecrecover(digest, v, r, s);
            if (recoveredAddress == address(0))
                revert SoulBoundERC20Base__InvalidSignature();
            if (recoveredAddress != owner)
                revert SoulBoundERC20Base__InvalidSigner(
                    recoveredAddress,
                    owner
                );
        } else {
            uint256 size;
            // solhint-disable-next-line no-inline-assembly
            assembly {
                size := extcodesize(owner)
            }

            if (size > 0) {
                if (
                    IERC1271(owner).isValidSignature(
                        digest,
                        abi.encodePacked(r, s, v)
                    ) != 0x1626ba7e // isValidSignature.selector
                ) {
                    revert SoulBoundERC20Base__InvalidSignature();
                }
            } else {
                address recoveredAddress = ecrecover(digest, v, r, s);
                if (recoveredAddress == address(0))
                    revert SoulBoundERC20Base__InvalidSignature();
                if (recoveredAddress != owner)
                    revert SoulBoundERC20Base__InvalidSigner(
                        recoveredAddress,
                        owner
                    );
            }
        }
    }
}

File 18 of 27 : SoulBoundMintPermitUpgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ISoulBoundMintPermit} from "../interfaces/ISoulBoundMintPermit.sol";
import {ISoulBoundMintPermitErrors} from "../interfaces/errors/ISoulBoundMintPermitErrors.sol";
import {SoulBoundERC20BaseUpgradeable} from "./SoulBoundERC20BaseUpgradeable.sol";

/**
 * @title SoulBound Mint Permit Upgradeable
 * @notice Adds minting functionality with permit to the SoulBound token, allowing token minting based
 * on signed permissions.
 * @dev This contract extends the SoulBound ERC-20 base functionality to include minting based on permits,
 * facilitating a more flexible minting process that doesn't require direct blockchain transactions by the minter.
 * It introduces a permit mechanism for minting, where a signed message can authorize an address to mint tokens.
 */
abstract contract SoulBoundMintPermitUpgradeable is
    Initializable,
    SoulBoundERC20BaseUpgradeable,
    ISoulBoundMintPermitErrors,
    ISoulBoundMintPermit
{
    // keccak256("MintPermit(address owner,uint256 amount,uint256 stageId)")
    bytes32 private constant MINT_PERMIT_TYPEHASH =
        0xe6595996b7bed1637680b4cd86058d60a6e7466a44f2f733b49ef571d6cd1b81;

    struct SoulBoundMintPermitStorage {
        address _signer;
    }

    // keccak256(abi.encode(uint256(keccak256("parabol.storage.SoulBoundMintPermit")) - 1)) & ~bytes32(uint256(0xff));
    bytes32 private constant SoulBoundMintPermitStorageLocation =
        0x8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab080000;

    function _getSoulBoundMintPermitStorage()
        private
        pure
        returns (SoulBoundMintPermitStorage storage $)
    {
        assembly {
            $.slot := SoulBoundMintPermitStorageLocation
        }
    }

    /**
     * @dev Initializes the mint permit mechanism with a designated signer.
     * @param signer_ The address authorized to sign mint permits.
     */
    function __SoulBoundMintPermit_init(
        address signer_
    ) internal onlyInitializing {
        __SoulBoundMintPermit_init_unchained(signer_);
    }

    function __SoulBoundMintPermit_init_unchained(
        address signer_
    ) internal onlyInitializing {
        SoulBoundMintPermitStorage storage $ = _getSoulBoundMintPermitStorage();
        $._signer = signer_;
    }

    /**
     * @dev Internal function to validate a mint permit's signature before minting tokens.
     * Checks that the signature is valid and corresponds to the specified parameters.
     * @param mintPermit The mint permit details including the owner, amount, and stageId.
     * @param signature The signature details including v, r, and s.
     */
    function _validateMintPermitSignature(
        MintPermit calldata mintPermit,
        Signature calldata signature
    ) internal view {
        if (msg.sender != mintPermit.owner)
            revert SoulBoundMintPermit__InvalidCaller(
                msg.sender,
                mintPermit.owner
            );

        _requireValidSignature(
            _getSoulBoundMintPermitStorage()._signer,
            keccak256(
                abi.encode(
                    MINT_PERMIT_TYPEHASH,
                    mintPermit.owner,
                    mintPermit.amount,
                    mintPermit.stageId
                )
            ),
            signature.v,
            signature.r,
            signature.s,
            true
        );
    }

    /**
     * @notice Sets a new signer for the mint permits, allowing dynamic updates to the signing authority.
     * This function must be overridden in the implementing contract to include access control mechanisms.
     * @param newSigner The address of the new signer.
     */
    function setMintPermitSigner(address newSigner) external virtual;

    /**
     * @dev Updates the signer address used for mint permits. Intended to be called by the contract owner.
     * @param newSigner The new signer address.
     */
    function _setMintPermitSigner(address newSigner) internal {
        SoulBoundMintPermitStorage storage $ = _getSoulBoundMintPermitStorage();

        if (newSigner == address(0)) revert SoulBoundMintPermit__ZeroAddress();

        if (newSigner == $._signer) revert SoulBoundMintPermit__SameSigner();

        $._signer = newSigner;
        emit SoulBoundMintPermit__SetMintPermitSigner(newSigner);
    }
}

File 19 of 27 : SoulBoundPermitUpgradeable.sol
//SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

import {SoulBoundERC20BaseUpgradeable} from "./SoulBoundERC20BaseUpgradeable.sol";
import {NoncesUpgradeable} from "../utils/NoncesUpgradeable.sol";
import {SoulBoundPermitErrors} from "../interfaces/errors/SoulBoundPermitErrors.sol";
import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";

/**
 * @title SoulBound Permit Upgradeable
 * @notice Enables ERC-20 permit functionality in a SoulBound token context, allowing token allowances
 * to be managed via signatures, conforming to the EIP-2612 standard.
 * @dev Extends the SoulBound ERC-20 base contract to include permit functionality, integrating EIP-2612's
 * permit approach to manage allowances without sending transactions. This contract includes functions to support
 * permit-based allowance management. It is abstract and intended
 * to be extended by other contracts requiring permit functionality.
 */
abstract contract SoulBoundPermitUpgradeable is
    SoulBoundERC20BaseUpgradeable,
    NoncesUpgradeable,
    SoulBoundPermitErrors,
    IERC20Permit
{
    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 private constant PERMIT_TYPEHASH =
        0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        if (block.timestamp > deadline)
            revert SoulBoundPermit__ExpiredSignature(deadline);

        _requireValidSignature(
            owner,
            keccak256(
                abi.encode(
                    PERMIT_TYPEHASH,
                    owner,
                    spender,
                    value,
                    _useNonce(owner),
                    deadline
                )
            ),
            v,
            r,
            s,
            false
        );
        _approve(owner, spender, value);
    }

    /**
     * @dev Retrieves the current nonce for `owner`. This value must be included in the permit
     * signature and is incremented after each successful permit call, preventing replay attacks.
     * @param owner The address whose nonce is being queried.
     * @return The current nonce for `owner`.
     */
    function nonces(
        address owner
    )
        public
        view
        virtual
        override(NoncesUpgradeable, IERC20Permit)
        returns (uint256)
    {
        return NoncesUpgradeable.nonces(owner);
    }

    /**
     * @dev Returns the domain separator used in the encoding of the signature for permits,
     * as defined by EIP-712.
     * @return The domain separator for the contract.
     */
    function DOMAIN_SEPARATOR()
        public
        view
        virtual
        override(SoulBoundERC20BaseUpgradeable, IERC20Permit)
        returns (bytes32)
    {
        return SoulBoundERC20BaseUpgradeable.DOMAIN_SEPARATOR();
    }
}

File 20 of 27 : IParabolSoulBoundTokenErrors.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

/**
 * @title Interface for Parabol SoulBound Token Errors
 * @notice Provides a standardized way to handle errors specific to Parabol SoulBound Token.
 * @dev This interface lists custom errors for the Parabol SoulBound Token contract, enhancing clarity and
 * specificity in error reporting. These errors are intended to be used across minting, burning, and token
 * management functionalities within the contract.
 */
interface IParabolSoulBoundTokenErrors {
    /**
     * @dev Error indicating a zero address where a valid address is required.
     */
    error ParabolSoulBoundToken__ZeroAddress();

    /**
     * @dev Error indicating an operation attempted with a zero amount, where a non-zero amount is required.
     */
    error ParabolSoulBoundToken__ZeroAmount();

    /**
     * @dev Error for when an operation fails due to the spender having insufficient allowance.
     * @param spender The address attempting to spend tokens.
     * @param allowance The current allowance for the spender.
     * @param needed The required allowance to complete the operation.
     */
    error ParabolSoulBoundToken__InsufficientAllowance(
        address spender,
        uint256 allowance,
        uint256 needed
    );

    /**
     * @dev Error indicating an attempt to operate with an amount exceeding the balance or limit.
     * @param balance The current balance or limit being checked.
     * @param needed The amount required for the operation.
     */
    error ParabolSoulBoundToken__InsufficientOrderAmount(
        uint256 balance,
        uint256 needed
    );

    /**
     * @dev Error indicating an operation referencing a stage ID that does not exist.
     * @param stageId The non-existent stage ID.
     */
    error ParabolSoulBoundToken__StageNotExists(uint256 stageId);

    /**
     * @dev Error indicating an operation referencing an order ID that does not exist.
     * @param orderId The non-existent order ID.
     */
    error ParabolSoulBoundToken__OrderNotExists(uint256 orderId);

    /**
     * @dev Error indicating an attempt to interact with a stage that has already ended.
     * @param stageId The ID of the stage attempted to be interacted with.
     * @param endTimestamp The end timestamp of the stage.
     * @param currentTimestamp The current timestamp at the moment of the operation.
     */
    error ParabolSoulBoundToken__StageEnded(
        uint256 stageId,
        uint256 endTimestamp,
        uint256 currentTimestamp
    );

    /**
     * @dev Error indicating an attempt to mint tokens exceeding the cap for a given stage.
     * @param stageId The stage ID being interacted with.
     * @param cap The cap for the stage.
     * @param minted The amount already minted in the stage.
     * @param amount The amount attempted to be minted.
     */
    error ParabolSoulBoundToken__StageCapReached(
        uint256 stageId,
        uint256 cap,
        uint256 minted,
        uint256 amount
    );

    /**
     * @dev Error indicating an attempt to mint tokens exceeding the balance limit for a specific stage.
     * @param stageId The stage ID being interacted with.
     * @param limit The balance limit for the stage.
     * @param amount The amount attempted to be minted.
     */
    error ParabolSoulBoundToken__StageBalanceLimitExceeded(
        uint256 stageId,
        uint256 limit,
        uint256 amount
    );

    /**
     * @dev Error indicating an attempt to mint tokens exceeding the account mint limit for a specific stage.
     * @param stageId The stage ID being interacted with.
     * @param limit The account mint limit for the stage.
     * @param amount The amount attempted to be minted.
     */
    error ParabolSoulBoundToken__StageAccountMintLimitExceeded(
        uint256 stageId,
        uint256 limit,
        uint256 amount
    );

    /**
     * @dev Error indicating a zero cap where a non-zero cap is required for stage creation.
     */
    error ParabolSoulBoundToken__ZeroCap();

    /**
     * @dev Error indicating a zero account mint limit where a non-zero limit is required for stage creation.
     */
    error ParabolSoulBoundToken__ZeroAccountMintLimit();

    /**
     * @dev Error indicating an invalid stage end timestamp, typically when it's set in the past.
     * @param endTimestamp The end timestamp provided for the stage.
     * @param currentTimestamp The current timestamp at the moment of stage creation or interaction.
     */
    error ParabolSoulBoundToken__InvalidStageEndTimestamp(
        uint256 endTimestamp,
        uint256 currentTimestamp
    );

    /**
     * @dev Error indicating an attempt to transfer tokens, which is disabled in SoulBound tokens.
     */
    error ParabolSoulBoundToken__TransferDisabled();
}

File 21 of 27 : ISoulBoundERC20BaseErrors.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

/**
 * @title Interface for SoulBound ERC20 Base Errors
 * @notice Provides a standardized way to handle errors specific to SoulBound ERC20 Base.
 * @dev Error types include balance insufficiencies, invalid operation participants, and invalid signature
 * verifications, among others, specific to the functionalities of a SoulBound ERC20 token.
 */
interface ISoulBoundERC20BaseErrors {
    /**
     * @dev Error for when a transfer, mint, or burn operation fails due to insufficient balance.
     * @param sender The address attempting the operation.
     * @param balance The current balance of the sender.
     * @param needed The balance required to complete the operation.
     */
    error SoulBoundERC20Base__InsufficientBalance(
        address sender,
        uint256 balance,
        uint256 needed
    );

    /**
     * @dev Error indicating an operation attempted with an invalid sender address.
     * @param sender The invalid sender address.
     */
    error SoulBoundERC20Base__InvalidSender(address sender);

    /**
     * @dev Error indicating an operation attempted with an invalid receiver address.
     * @param receiver The invalid receiver address.
     */
    error SoulBoundERC20Base__InvalidReceiver(address receiver);

    /**
     * @dev Error indicating an attempt to approve tokens from an invalid approver address.
     * @param approver The invalid approver address.
     */
    error SoulBoundERC20Base__InvalidApprover(address approver);

    /**
     * @dev Error indicating an attempt to spend tokens with an invalid spender address.
     * @param spender The invalid spender address.
     */
    error SoulBoundERC20Base__InvalidSpender(address spender);

    /**
     * @dev Error for when a transfer operation fails due to insufficient allowance.
     * @param spender The address attempting to spend the tokens.
     * @param allowance The current allowance for the spender.
     * @param needed The allowance required to complete the operation.
     */
    error SoulBoundERC20Base__InsufficientAllowance(
        address spender,
        uint256 allowance,
        uint256 needed
    );

    /**
     * @dev Error indicating an invalid signature was provided for a permit and mint permit operations.
     */
    error SoulBoundERC20Base__InvalidSignature();

    /**
     * @dev Error indicating the recovered signer from a signature does not match the expected signer.
     * @param signer The address recovered from the signature.
     * @param expectedSigner The expected signer address.
     */
    error SoulBoundERC20Base__InvalidSigner(
        address signer,
        address expectedSigner
    );
}

File 22 of 27 : ISoulBoundMintPermitErrors.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

/**
 * @title Interface for SoulBound Mint Permit Errors
 * @notice Provides a standardized way to handle errors specific to mint permit functionality.
 * @dev Specifies the errors that can occur during the minting process with a mint permit.
 */
interface ISoulBoundMintPermitErrors {
    /**
     * @dev Error indicating that a zero address was provided where it is not allowed.
     */
    error SoulBoundMintPermit__ZeroAddress();

    /**
     * @dev Error indicating that the same signer address is being set again.
     */
    error SoulBoundMintPermit__SameSigner();

    /**
     * @dev Error indicating that the caller is not the owner or authorized party for minting.
     * @param caller The address of the caller attempting to mint.
     * @param owner The expected owner or authorized party.
     */
    error SoulBoundMintPermit__InvalidCaller(address caller, address owner);
}

File 23 of 27 : SoulBoundPermitErrors.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

/**
 * @title Interface for SoulBound Permit Errors
 * @notice Provides a standardized way to handle errors specific to SoulBound permit functionality.
 * @dev Defines error types related to the permit feature in SoulBound tokens.
 */
interface SoulBoundPermitErrors {
    /**
     * @dev Error indicating that the signature for a permit has expired.
     * @param deadline The timestamp of when the signature expired.
     */
    error SoulBoundPermit__ExpiredSignature(uint256 deadline);
}

File 24 of 27 : IParabolSoulBoundToken.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

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

/**
 * @title Interface for Parabol SoulBound Token
 * @notice Extends the SoulBound Mint Permit interface with additional functionalities specific to the Parabol
 * SoulBound Token, including minting, burning, and stage management.
 * @dev Introduces counters for orders and stages, structures for stage information, and events for minting,
 * burning, and starting new stages. It represents a more specific implementation of SoulBound tokens, with
 * added complexity to support various stages of minting.
 */
interface IParabolSoulBoundToken is ISoulBoundMintPermit {
    /**
     * @dev Structure to keep track of counters, commonly used for order IDs and stage IDs.
     */
    struct Counter {
        uint256 _value;
    }

    /**
     * @dev Structure containing information about a minting stage, including caps, limit, minted amount and timestamps.
     */
    struct StageInfo {
        uint256 cap;
        uint256 accountMintLimit;
        uint256 minted;
        uint256 endTimestamp;
    }

    /**
     * @notice Emitted when new tokens are minted.
     * @param to The address receiving the minted tokens.
     * @param mintAmount The amount of tokens minted.
     * @param stageId The ID of the minting stage.
     * @param orderId The order ID associated with the minting.
     */
    event Mint(
        address indexed to,
        uint256 mintAmount,
        uint256 stageId,
        uint256 orderId
    );

    /**
     * @notice Emitted when tokens are burned.
     * @param from The address from which tokens are burned.
     * @param amount The amount of tokens burned.
     * @param orderId The order ID associated with the burning.
     */
    event Burn(address indexed from, uint256 amount, uint256 orderId);

    /**
     * @notice Emitted when a new minting stage starts.
     * @param stageId The ID of the new stage.
     * @param cap The cap on the number of tokens that can be minted in this stage.
     * @param accountMintLimit The limit on the number of tokens a single account can mint in this stage.
     * @param endTimestamp The timestamp when the stage ends.
     */
    event StartStage(
        uint256 stageId,
        uint256 cap,
        uint256 accountMintLimit,
        uint256 endTimestamp
    );

    /**
     * @dev Function signature for minting tokens.
     */
    function mint(
        MintPermit calldata mintPermit,
        Signature calldata signature,
        uint256 mintAmount
    ) external;

    /**
     * @dev Function signature for burning tokens.
     */
    function burn(address from, uint256 amount, uint256 orderId) external;

    /**
     * @dev Function signature for checking allowance.
     */
    function allowance(
        address owner,
        address spender
    ) external view returns (uint256);
}

File 25 of 27 : ISoulBoundERC20Base.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

/**
 * @title Interface for SoulBound ERC20 Base
 * @notice Defines the basic interface for a SoulBound ERC20 Base, including events for transfers and approvals.
 * @dev Provides an interface for the fundamental operations of a SoulBound ERC20 token, ensuring compatibility
 * with the ERC20 standard while adapting it to the non-transferable nature of SoulBound tokens.
 */
interface ISoulBoundERC20Base {
    /**
     * @notice Emitted when tokens are minted or burned.
     * @param from The address of the sender.
     * @param to The address of the receiver.
     * @param value The amount of tokens transferred.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 26 of 27 : ISoulBoundMintPermit.sol
// SPDX-License-Identifier: AGPL-3.0-only

pragma solidity 0.8.24;

/**
 * @title Interface for SoulBound Mint Permit
 * @notice Defines the structure for mint permits in SoulBound tokens, enabling minting based on off-chain
 * permissions.
 * @dev Specifies the MintPermit structure, Signature structure, and an event for setting a new signer for
 * mint permits. This interface is intended to be implemented by contracts that support minting SoulBound
 * tokens through signed permissions.
 */
interface ISoulBoundMintPermit {
    /**
     * @notice Emitted when a new mint permit signer is set.
     * @param signer The address of the new signer.
     */
    event SoulBoundMintPermit__SetMintPermitSigner(address indexed signer);

    /**
     * @dev Structure defining a mint permit, containing the owner's address, the amount to mint, and the stage ID.
     */
    struct MintPermit {
        address owner;
        uint256 amount;
        uint256 stageId;
    }

    /**
     * @dev Structure defining a signature, containing the components of an ECDSA signature.
     */
    struct Signature {
        uint8 v;
        bytes32 r;
        bytes32 s;
    }
}

File 27 of 27 : NoncesUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

/**
 * @dev Provides tracking nonces for addresses. Nonces will only increment.
 */
abstract contract NoncesUpgradeable is Initializable {
    /**
     * @dev The nonce used for an `account` is not the expected current nonce.
     */
    /// @custom:storage-location erc7201:parabol.storage.Nonces
    struct NoncesStorage {
        mapping(address account => uint256) _nonces;
    }

    // keccak256(abi.encode(uint256(keccak256("parabol.storage.Nonces")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant NoncesStorageLocation =
        0x4844f4ef9e791d535f02b34904c9f8ee969c9ffb8c000af70ea4a0636fb56700;

    function _getNoncesStorage()
        private
        pure
        returns (NoncesStorage storage $)
    {
        assembly {
            $.slot := NoncesStorageLocation
        }
    }

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"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":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ParabolSoulBoundToken__InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ParabolSoulBoundToken__InsufficientOrderAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"}],"name":"ParabolSoulBoundToken__InvalidStageEndTimestamp","type":"error"},{"inputs":[{"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"ParabolSoulBoundToken__OrderNotExists","type":"error"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ParabolSoulBoundToken__StageAccountMintLimitExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ParabolSoulBoundToken__StageBalanceLimitExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ParabolSoulBoundToken__StageCapReached","type":"error"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"}],"name":"ParabolSoulBoundToken__StageEnded","type":"error"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"ParabolSoulBoundToken__StageNotExists","type":"error"},{"inputs":[],"name":"ParabolSoulBoundToken__TransferDisabled","type":"error"},{"inputs":[],"name":"ParabolSoulBoundToken__ZeroAccountMintLimit","type":"error"},{"inputs":[],"name":"ParabolSoulBoundToken__ZeroAddress","type":"error"},{"inputs":[],"name":"ParabolSoulBoundToken__ZeroAmount","type":"error"},{"inputs":[],"name":"ParabolSoulBoundToken__ZeroCap","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"SoulBoundERC20Base__InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"SoulBoundERC20Base__InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"SoulBoundERC20Base__InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"SoulBoundERC20Base__InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"SoulBoundERC20Base__InvalidSender","type":"error"},{"inputs":[],"name":"SoulBoundERC20Base__InvalidSignature","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"expectedSigner","type":"address"}],"name":"SoulBoundERC20Base__InvalidSigner","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"SoulBoundERC20Base__InvalidSpender","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"SoulBoundMintPermit__InvalidCaller","type":"error"},{"inputs":[],"name":"SoulBoundMintPermit__SameSigner","type":"error"},{"inputs":[],"name":"SoulBoundMintPermit__ZeroAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"SoulBoundPermit__ExpiredSignature","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stageId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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":"signer","type":"address"}],"name":"SoulBoundMintPermit__SetMintPermitSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stageId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountMintLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"StartStage","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"BURNER_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":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"version_","type":"string"},{"internalType":"address","name":"pauser_","type":"address"},{"internalType":"address","name":"signer_","type":"address"},{"internalType":"address","name":"admin_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"stageId","type":"uint256"}],"internalType":"struct ISoulBoundMintPermit.MintPermit","name":"mintPermit","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ISoulBoundMintPermit.Signature","name":"signature","type":"tuple"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"order","type":"uint256"}],"name":"orderBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"orderCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"signer","type":"address"}],"name":"setMintPermitSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"stageBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stageCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stage","type":"uint256"}],"name":"stageInfo","outputs":[{"components":[{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"accountMintLimit","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"internalType":"struct IParabolSoulBoundToken.StageInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"accountMintLimit","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"startStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

60a06040523060805234801562000014575f80fd5b506200001f62000025565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000765760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051613b7a620001005f395f8181611abf01528181611ae80152611d080152613b7a5ff3fe60806040526004361061025d575f3560e01c806370a082311161014b578063ad3cb1cc116100c6578063dd62ed3e1161007c578063e63ab1e911610062578063e63ab1e91461081b578063f5298aca1461084e578063fa405eae1461086d575f80fd5b8063dd62ed3e1461078f578063e1d25fe8146107ae575f80fd5b8063d1958f12116100ac578063d1958f1214610732578063d505accf14610751578063d547741f14610770575f80fd5b8063ad3cb1cc146106b7578063b789bf52146106ff575f80fd5b806395d89b411161011b578063a217fddf11610101578063a217fddf1461066b578063a578002a1461067e578063a9059cbb1461069d575f80fd5b806395d89b41146106385780639630c8ac1461064c575f80fd5b806370a08231146105355780637ecebe00146105955780638456cb59146105b457806391d14854146105c8575f80fd5b8063313ce567116101db5780634f1ef286116101ab5780635c975abb116101915780635c975abb146104ad5780635f20ac31146104e35780636cdacfc414610516575f80fd5b80634f1ef2861461048657806352d1902d14610499575f80fd5b8063313ce567146104245780633644e5151461043f57806336568abe146104535780633f4ba83a14610472575f80fd5b806323b872dd11610230578063248a9ca311610216578063248a9ca314610383578063282c51f3146103d05780632f2ff15d14610403575f80fd5b806323b872dd14610312578063243af19314610331575f80fd5b806301ffc9a71461026157806306fdde0314610295578063095ea7b3146102b657806318160ddd146102d5575b5f80fd5b34801561026c575f80fd5b5061028061027b36600461342d565b6108da565b60405190151581526020015b60405180910390f35b3480156102a0575f80fd5b506102a9610972565b60405161028c91906134b3565b3480156102c1575f80fd5b506102806102d03660046134ed565b610a45565b3480156102e0575f80fd5b507fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854602545b60405190815260200161028c565b34801561031d575f80fd5b5061028061032c366004613515565b610a5c565b34801561033c575f80fd5b5061035061034b36600461354e565b610a8f565b60405161028c91908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561038e575f80fd5b5061030461039d36600461354e565b5f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b3480156103db575f80fd5b506103047f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b34801561040e575f80fd5b5061042261041d366004613565565b610b19565b005b34801561042f575f80fd5b506040516012815260200161028c565b34801561044a575f80fd5b50610304610b62565b34801561045e575f80fd5b5061042261046d366004613565565b610c15565b34801561047d575f80fd5b50610422610c73565b61042261049436600461364d565b610ca8565b3480156104a4575f80fd5b50610304610cc7565b3480156104b8575f80fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16610280565b3480156104ee575f80fd5b507f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0154610304565b348015610521575f80fd5b506104226105303660046136ab565b610cf5565b348015610540575f80fd5b5061030461054f3660046136d4565b73ffffffffffffffffffffffffffffffffffffffff165f9081527fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600602052604090205490565b3480156105a0575f80fd5b506103046105af3660046136d4565b610eb3565b3480156105bf575f80fd5b50610422610efc565b3480156105d3575f80fd5b506102806105e2366004613565565b5f9182527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b348015610643575f80fd5b506102a9610f2e565b348015610657575f80fd5b5061042261066636600461370b565b610f7f565b348015610676575f80fd5b506103045f81565b348015610689575f80fd5b506104226106983660046137d3565b61122c565b3480156106a8575f80fd5b5061028061032c3660046134ed565b3480156106c2575f80fd5b506102a96040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b34801561070a575f80fd5b507f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0054610304565b34801561073d575f80fd5b5061042261074c3660046136d4565b611422565b34801561075c575f80fd5b5061042261076b36600461381e565b611435565b34801561077b575f80fd5b5061042261078a366004613565565b611564565b34801561079a575f80fd5b506103046107a9366004613883565b6115a7565b3480156107b9575f80fd5b506103046107c83660046134ed565b73ffffffffffffffffffffffffffffffffffffffff919091165f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0260209081526040808320938352929052205490565b348015610826575f80fd5b506103047f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610859575f80fd5b506104226108683660046138ab565b611602565b348015610878575f80fd5b506103046108873660046134ed565b73ffffffffffffffffffffffffffffffffffffffff919091165f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0360209081526040808320938352929052205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061096c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460380546060917fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600916109c3906138db565b80601f01602080910402602001604051908101604052809291908181526020018280546109ef906138db565b8015610a3a5780601f10610a1157610100808354040283529160200191610a3a565b820191905f5260205f20905b815481529060010190602001808311610a1d57829003601f168201915b505050505091505090565b5f33610a528185856117f9565b5060019392505050565b5f6040517f234af53300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ab660405180608001604052805f81526020015f81526020015f81526020015f81525090565b505f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f046020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526040902060010154610b5281611806565b610b5c8383611810565b50505050565b5f610c107fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854605547fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460654604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091528183019490945260608101929092524660808301523060a0808401919091528151808403909101815260c09092019052805191012090565b905090565b73ffffffffffffffffffffffffffffffffffffffff81163314610c64576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6e828261192e565b505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c9d81611806565b610ca5611a0a565b50565b610cb0611aa7565b610cb982611bad565b610cc38282611bb7565b5050565b5f610cd0611cf0565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f610cff81611806565b835f03610d38576040517f2d3fb22600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f03610d71576040517f42419b6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428211610db8576040517fb156bced000000000000000000000000000000000000000000000000000000008152600481018390524260248201526044015b60405180910390fd5b5f610de97f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0180546001019081905590565b905060405180608001604052808681526020018581526020015f815260200184815250610e337f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0090565b5f8381526004919091016020908152604091829020835181558382015160018201558383015160028201556060938401516003909101558151848152908101889052808201879052918201859052517f7672e74381e97f142ab4077e21da7a43097f98f775ab34671c40026171e869969181900360800190a15050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f9081527f4844f4ef9e791d535f02b34904c9f8ee969c9ffb8c000af70ea4a0636fb56700602052604081205461096c565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610f2681611806565b610ca5611d5f565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460480546060917fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600916109c3906138db565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f81158015610fc95750825b90505f8267ffffffffffffffff166001148015610fe55750303b155b905081158015610ff3575080155b1561102a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001178555831561108b5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b73ffffffffffffffffffffffffffffffffffffffff881615806110c2575073ffffffffffffffffffffffffffffffffffffffff8716155b806110e1575073ffffffffffffffffffffffffffffffffffffffff8616155b15611118576040517fbae9330e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111238b8b8b611dd8565b61112c87611e5c565b611134611eca565b61113e5f87611810565b506111697f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a89611810565b506111947f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8485f611f1b565b6111be7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a5f611f1b565b831561121f5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b611234611fbc565b5f61124260208501856136d4565b73ffffffffffffffffffffffffffffffffffffffff160361128f576040517fbae9330e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82602001355f036112cc576040517fc4b6591d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112d68383612018565b6112e48184604001356121b2565b6113046112f460208501856136d4565b846040013585602001358461232b565b5f6113357f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0080546001019081905590565b9050817f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f025f61136760208801886136d4565b73ffffffffffffffffffffffffffffffffffffffff16815260208082019290925260409081015f908120858252835220919091556113b1906113ab908601866136d4565b836124b0565b6113be60208501856136d4565b6040805184815281870135602082015290810183905273ffffffffffffffffffffffffffffffffffffffff91909116907fb4c03061fb5b7fed76389d5af8f2e0ddb09f8c70d1333abbb62582835e10accb906060015b60405180910390a250505050565b5f61142c81611806565b610cc38261250a565b83421115611472576040517f47a6455000000000000000000000000000000000000000000000000000000000815260048101859052602401610daf565b611550877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98189896114ec8373ffffffffffffffffffffffffffffffffffffffff165f9081527f4844f4ef9e791d535f02b34904c9f8ee969c9ffb8c000af70ea4a0636fb567006020526040902080546001810190915590565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810187905260e001604051602081830303815290604052805190602001208585855f612638565b61155b8787876117f9565b50505050505050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015461159d81611806565b610b5c838361192e565b73ffffffffffffffffffffffffffffffffffffffff8083165f9081527fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854601602090815260408083209385168352929052908120545b9392505050565b61160a611fbc565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84861163481611806565b73ffffffffffffffffffffffffffffffffffffffff8416611681576040517fbae9330e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f036116ba576040517fc4b6591d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0054821115611718576040517f077dfa8400000000000000000000000000000000000000000000000000000000815260048101839052602401610daf565b8261172385336115a7565b101561178b573361173485336115a7565b6040517f4ee6c4d400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260448101849052606401610daf565b611796848385612a7b565b6117a1843385612bae565b6117ab8484612c50565b604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff8616917f49995e5dd6158cf69ad3e9777c46755a1a826a446c6416992167462dad033b2a9101611414565b610c6e8383836001612caa565b610ca58133612e13565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616855290915282205460ff16611925575f8481526020828152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118c13390565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4600191505061096c565b5f91505061096c565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616855290915282205460ff1615611925575f8481526020828152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4600191505061096c565b611a12612eb9565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a150565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480611b7457507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611b5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611bab576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f610cc381611806565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611c3c575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611c3991810190613926565b60015b611c8a576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610daf565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611ce6576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610daf565b610c6e8383612f14565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611bab576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d67611fbc565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611a7c565b611de0612f76565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c8546007fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854603611e2c8582613981565b5060048101611e3b8482613981565b50835160209485012060058201558151919093012060069092019190915550565b611e64612f76565b7f8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab08000080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611ed2612f76565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b7f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268005f611f74845f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b5f85815260208490526040808220600101869055519192508491839187917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a450505050565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1615611bab576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61202560208301836136d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120b7573361206560208401846136d4565b6040517fb62b67e800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401610daf565b610cc37f8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab0800005473ffffffffffffffffffffffffffffffffffffffff167fe6595996b7bed1637680b4cd86058d60a6e7466a44f2f733b49ef571d6cd1b8161212060208601866136d4565b6040805160208181019490945273ffffffffffffffffffffffffffffffffffffffff9092168282015291860135606082015290850135608082015260a001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602091820120906121a190850185613a9d565b846020013585604001356001612638565b5f8181527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f04602052604090207f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f01547f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f00919083111561225f576040517fede8bb4300000000000000000000000000000000000000000000000000000000815260048101849052602401610daf565b42816003015410156122b35760038101546040517ff97cc22f000000000000000000000000000000000000000000000000000000008152600481018590526024810191909152426044820152606401610daf565b5f8482600201546122c49190613ab6565b825490915081111561232057815460028301546040517f85be59c0000000000000000000000000000000000000000000000000000000008152600481018790526024810192909252604482015260648101869052608401610daf565b600290910155505050565b5f8381527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f046020908152604080832073ffffffffffffffffffffffffffffffffffffffff881684527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0383528184208785529092528220547f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0092906123d0908590613ab6565b90508481111561241d576040517f12cefa38000000000000000000000000000000000000000000000000000000008152600481018790526024810186905260448101829052606401610daf565b81600101548111156124725760018201546040517f4e93deb100000000000000000000000000000000000000000000000000000000815260048101889052602481019190915260448101829052606401610daf565b73ffffffffffffffffffffffffffffffffffffffff9096165f9081526003909201602090815260408084209684529590525092909220929092555050565b73ffffffffffffffffffffffffffffffffffffffff82166124ff576040517fb92dde2f0000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b610cc35f8383612fdd565b7f8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab08000073ffffffffffffffffffffffffffffffffffffffff8216612578576040517f98d0c1e200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805473ffffffffffffffffffffffffffffffffffffffff908116908316036125cc576040517f6cd5555300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811782556040517fc71dbbd4e9575e1080da3b8c0106488e019acb5b1aeaf95ea844f6296d36b251905f90a25050565b5f612641610b62565b6040517f1901000000000000000000000000000000000000000000000000000000000000815260028101829052602281018890526042902090915082156127d657604080515f8082526020820180845284905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156126d3573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661274b576040517fdb251b3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146127d0576040517f02cd899c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301528a166024820152604401610daf565b50612a71565b873b801561291f57604080516020810188905280820187905260f889901b7fff000000000000000000000000000000000000000000000000000000000000001660608201528151604181830301815260618201928390527f1626ba7e0000000000000000000000000000000000000000000000000000000090925273ffffffffffffffffffffffffffffffffffffffff8b1691631626ba7e9161287d918691606501613aee565b602060405180830381865afa158015612898573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128bc9190613b0e565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916631626ba7e60e01b1461291a576040517fdb251b3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a6f565b604080515f8082526020820180845285905260ff8a1692820192909252606081018890526080810187905260019060a0016020604051602081039080840390855afa158015612970573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166129e8576040517fdb251b3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612a6d576040517f02cd899c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301528b166024820152604401610daf565b505b505b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff83165f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f02602090815260408083208584529091529020547f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f009082811015612b30576040517f050ab16e0000000000000000000000000000000000000000000000000000000081526004810182905260248101849052604401610daf565b828103612b6e5773ffffffffffffffffffffffffffffffffffffffff85165f9081526002830160209081526040808320878452909152812055612ba7565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260028301602090815260408083208784529091529020805484900390555b5050505050565b5f612bb984846115a7565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610b5c5781811015612c42576040517ffe9846e700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024810182905260448101839052606401610daf565b610b5c84848484035f612caa565b73ffffffffffffffffffffffffffffffffffffffff8216612c9f576040517f192eff450000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b610cc3825f83612fdd565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460073ffffffffffffffffffffffffffffffffffffffff8516612d1a576040517fae0cb89d0000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b73ffffffffffffffffffffffffffffffffffffffff8416612d69576040517fb8e4d8eb0000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b73ffffffffffffffffffffffffffffffffffffffff8086165f90815260018301602090815260408083209388168352929052208390558115612ba7578373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051612e0491815260200190565b60405180910390a35050505050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610cc3576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260248101839052604401610daf565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16611bab576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612f1d826131aa565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115612f6e57610c6e8282613278565b610cc36132f7565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16611bab576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460073ffffffffffffffffffffffffffffffffffffffff84166130375781816002015f82825461302c9190613ab6565b909155506130e79050565b73ffffffffffffffffffffffffffffffffffffffff84165f90815260208290526040902054828110156130bc576040517f1e76708100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff861660048201526024810182905260448101849052606401610daf565b73ffffffffffffffffffffffffffffffffffffffff85165f9081526020839052604090209083900390555b73ffffffffffffffffffffffffffffffffffffffff831661311257600281018054839003905561313d565b73ffffffffffffffffffffffffffffffffffffffff83165f9081526020829052604090208054830190555b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161319c91815260200190565b60405180910390a350505050565b8073ffffffffffffffffffffffffffffffffffffffff163b5f03613212576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610daf565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60605f808473ffffffffffffffffffffffffffffffffffffffff16846040516132a19190613b29565b5f60405180830381855af49150503d805f81146132d9576040519150601f19603f3d011682016040523d82523d5f602084013e6132de565b606091505b50915091506132ee85838361332f565b95945050505050565b3415611bab576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826133445761333f826133be565b6115fb565b8151158015613368575073ffffffffffffffffffffffffffffffffffffffff84163b155b156133b7576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610daf565b5092915050565b8051156133ce5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610ca5575f80fd5b5f6020828403121561343d575f80fd5b81356115fb81613400565b5f5b8381101561346257818101518382015260200161344a565b50505f910152565b5f8151808452613481816020860160208601613448565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f6115fb602083018461346a565b803573ffffffffffffffffffffffffffffffffffffffff811681146134e8575f80fd5b919050565b5f80604083850312156134fe575f80fd5b613507836134c5565b946020939093013593505050565b5f805f60608486031215613527575f80fd5b613530846134c5565b925061353e602085016134c5565b9150604084013590509250925092565b5f6020828403121561355e575f80fd5b5035919050565b5f8060408385031215613576575f80fd5b82359150613586602084016134c5565b90509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f67ffffffffffffffff808411156135d6576135d661358f565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561361c5761361c61358f565b81604052809350858152868686011115613634575f80fd5b858560208301375f602087830101525050509392505050565b5f806040838503121561365e575f80fd5b613667836134c5565b9150602083013567ffffffffffffffff811115613682575f80fd5b8301601f81018513613692575f80fd5b6136a1858235602084016135bc565b9150509250929050565b5f805f606084860312156136bd575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156136e4575f80fd5b6115fb826134c5565b5f82601f8301126136fc575f80fd5b6115fb838335602085016135bc565b5f805f805f8060c08789031215613720575f80fd5b863567ffffffffffffffff80821115613737575f80fd5b6137438a838b016136ed565b97506020890135915080821115613758575f80fd5b6137648a838b016136ed565b96506040890135915080821115613779575f80fd5b5061378689828a016136ed565b945050613795606088016134c5565b92506137a3608088016134c5565b91506137b160a088016134c5565b90509295509295509295565b5f606082840312156137cd575f80fd5b50919050565b5f805f60e084860312156137e5575f80fd5b6137ef85856137bd565b92506137fe85606086016137bd565b915060c084013590509250925092565b803560ff811681146134e8575f80fd5b5f805f805f805f60e0888a031215613834575f80fd5b61383d886134c5565b965061384b602089016134c5565b955060408801359450606088013593506138676080890161380e565b925060a0880135915060c0880135905092959891949750929550565b5f8060408385031215613894575f80fd5b61389d836134c5565b9150613586602084016134c5565b5f805f606084860312156138bd575f80fd5b6138c6846134c5565b95602085013595506040909401359392505050565b600181811c908216806138ef57607f821691505b6020821081036137cd577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60208284031215613936575f80fd5b5051919050565b601f821115610c6e57805f5260205f20601f840160051c810160208510156139625750805b601f840160051c820191505b81811015612ba7575f815560010161396e565b815167ffffffffffffffff81111561399b5761399b61358f565b6139af816139a984546138db565b8461393d565b602080601f831160018114613a01575f84156139cb5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a95565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613a4d57888601518255948401946001909101908401613a2e565b5085821015613a8957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f60208284031215613aad575f80fd5b6115fb8261380e565b8082018082111561096c577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b828152604060208201525f613b06604083018461346a565b949350505050565b5f60208284031215613b1e575f80fd5b81516115fb81613400565b5f8251613b3a818460208701613448565b919091019291505056fea26469706673582212202d51a3454e24447bd168e5958daf45f331f127970e7d30d9b95102e3ccfaf3e264736f6c63430008180033

Deployed Bytecode

0x60806040526004361061025d575f3560e01c806370a082311161014b578063ad3cb1cc116100c6578063dd62ed3e1161007c578063e63ab1e911610062578063e63ab1e91461081b578063f5298aca1461084e578063fa405eae1461086d575f80fd5b8063dd62ed3e1461078f578063e1d25fe8146107ae575f80fd5b8063d1958f12116100ac578063d1958f1214610732578063d505accf14610751578063d547741f14610770575f80fd5b8063ad3cb1cc146106b7578063b789bf52146106ff575f80fd5b806395d89b411161011b578063a217fddf11610101578063a217fddf1461066b578063a578002a1461067e578063a9059cbb1461069d575f80fd5b806395d89b41146106385780639630c8ac1461064c575f80fd5b806370a08231146105355780637ecebe00146105955780638456cb59146105b457806391d14854146105c8575f80fd5b8063313ce567116101db5780634f1ef286116101ab5780635c975abb116101915780635c975abb146104ad5780635f20ac31146104e35780636cdacfc414610516575f80fd5b80634f1ef2861461048657806352d1902d14610499575f80fd5b8063313ce567146104245780633644e5151461043f57806336568abe146104535780633f4ba83a14610472575f80fd5b806323b872dd11610230578063248a9ca311610216578063248a9ca314610383578063282c51f3146103d05780632f2ff15d14610403575f80fd5b806323b872dd14610312578063243af19314610331575f80fd5b806301ffc9a71461026157806306fdde0314610295578063095ea7b3146102b657806318160ddd146102d5575b5f80fd5b34801561026c575f80fd5b5061028061027b36600461342d565b6108da565b60405190151581526020015b60405180910390f35b3480156102a0575f80fd5b506102a9610972565b60405161028c91906134b3565b3480156102c1575f80fd5b506102806102d03660046134ed565b610a45565b3480156102e0575f80fd5b507fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854602545b60405190815260200161028c565b34801561031d575f80fd5b5061028061032c366004613515565b610a5c565b34801561033c575f80fd5b5061035061034b36600461354e565b610a8f565b60405161028c91908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561038e575f80fd5b5061030461039d36600461354e565b5f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b3480156103db575f80fd5b506103047f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b34801561040e575f80fd5b5061042261041d366004613565565b610b19565b005b34801561042f575f80fd5b506040516012815260200161028c565b34801561044a575f80fd5b50610304610b62565b34801561045e575f80fd5b5061042261046d366004613565565b610c15565b34801561047d575f80fd5b50610422610c73565b61042261049436600461364d565b610ca8565b3480156104a4575f80fd5b50610304610cc7565b3480156104b8575f80fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16610280565b3480156104ee575f80fd5b507f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0154610304565b348015610521575f80fd5b506104226105303660046136ab565b610cf5565b348015610540575f80fd5b5061030461054f3660046136d4565b73ffffffffffffffffffffffffffffffffffffffff165f9081527fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600602052604090205490565b3480156105a0575f80fd5b506103046105af3660046136d4565b610eb3565b3480156105bf575f80fd5b50610422610efc565b3480156105d3575f80fd5b506102806105e2366004613565565b5f9182527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b348015610643575f80fd5b506102a9610f2e565b348015610657575f80fd5b5061042261066636600461370b565b610f7f565b348015610676575f80fd5b506103045f81565b348015610689575f80fd5b506104226106983660046137d3565b61122c565b3480156106a8575f80fd5b5061028061032c3660046134ed565b3480156106c2575f80fd5b506102a96040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b34801561070a575f80fd5b507f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0054610304565b34801561073d575f80fd5b5061042261074c3660046136d4565b611422565b34801561075c575f80fd5b5061042261076b36600461381e565b611435565b34801561077b575f80fd5b5061042261078a366004613565565b611564565b34801561079a575f80fd5b506103046107a9366004613883565b6115a7565b3480156107b9575f80fd5b506103046107c83660046134ed565b73ffffffffffffffffffffffffffffffffffffffff919091165f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0260209081526040808320938352929052205490565b348015610826575f80fd5b506103047f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610859575f80fd5b506104226108683660046138ab565b611602565b348015610878575f80fd5b506103046108873660046134ed565b73ffffffffffffffffffffffffffffffffffffffff919091165f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0360209081526040808320938352929052205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061096c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460380546060917fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600916109c3906138db565b80601f01602080910402602001604051908101604052809291908181526020018280546109ef906138db565b8015610a3a5780601f10610a1157610100808354040283529160200191610a3a565b820191905f5260205f20905b815481529060010190602001808311610a1d57829003601f168201915b505050505091505090565b5f33610a528185856117f9565b5060019392505050565b5f6040517f234af53300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ab660405180608001604052805f81526020015f81526020015f81526020015f81525090565b505f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f046020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526040902060010154610b5281611806565b610b5c8383611810565b50505050565b5f610c107fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854605547fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460654604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091528183019490945260608101929092524660808301523060a0808401919091528151808403909101815260c09092019052805191012090565b905090565b73ffffffffffffffffffffffffffffffffffffffff81163314610c64576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6e828261192e565b505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c9d81611806565b610ca5611a0a565b50565b610cb0611aa7565b610cb982611bad565b610cc38282611bb7565b5050565b5f610cd0611cf0565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f610cff81611806565b835f03610d38576040517f2d3fb22600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f03610d71576040517f42419b6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428211610db8576040517fb156bced000000000000000000000000000000000000000000000000000000008152600481018390524260248201526044015b60405180910390fd5b5f610de97f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0180546001019081905590565b905060405180608001604052808681526020018581526020015f815260200184815250610e337f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0090565b5f8381526004919091016020908152604091829020835181558382015160018201558383015160028201556060938401516003909101558151848152908101889052808201879052918201859052517f7672e74381e97f142ab4077e21da7a43097f98f775ab34671c40026171e869969181900360800190a15050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f9081527f4844f4ef9e791d535f02b34904c9f8ee969c9ffb8c000af70ea4a0636fb56700602052604081205461096c565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610f2681611806565b610ca5611d5f565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460480546060917fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854600916109c3906138db565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f81158015610fc95750825b90505f8267ffffffffffffffff166001148015610fe55750303b155b905081158015610ff3575080155b1561102a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001178555831561108b5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b73ffffffffffffffffffffffffffffffffffffffff881615806110c2575073ffffffffffffffffffffffffffffffffffffffff8716155b806110e1575073ffffffffffffffffffffffffffffffffffffffff8616155b15611118576040517fbae9330e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111238b8b8b611dd8565b61112c87611e5c565b611134611eca565b61113e5f87611810565b506111697f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a89611810565b506111947f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8485f611f1b565b6111be7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a5f611f1b565b831561121f5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b611234611fbc565b5f61124260208501856136d4565b73ffffffffffffffffffffffffffffffffffffffff160361128f576040517fbae9330e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82602001355f036112cc576040517fc4b6591d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112d68383612018565b6112e48184604001356121b2565b6113046112f460208501856136d4565b846040013585602001358461232b565b5f6113357f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0080546001019081905590565b9050817f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f025f61136760208801886136d4565b73ffffffffffffffffffffffffffffffffffffffff16815260208082019290925260409081015f908120858252835220919091556113b1906113ab908601866136d4565b836124b0565b6113be60208501856136d4565b6040805184815281870135602082015290810183905273ffffffffffffffffffffffffffffffffffffffff91909116907fb4c03061fb5b7fed76389d5af8f2e0ddb09f8c70d1333abbb62582835e10accb906060015b60405180910390a250505050565b5f61142c81611806565b610cc38261250a565b83421115611472576040517f47a6455000000000000000000000000000000000000000000000000000000000815260048101859052602401610daf565b611550877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98189896114ec8373ffffffffffffffffffffffffffffffffffffffff165f9081527f4844f4ef9e791d535f02b34904c9f8ee969c9ffb8c000af70ea4a0636fb567006020526040902080546001810190915590565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810187905260e001604051602081830303815290604052805190602001208585855f612638565b61155b8787876117f9565b50505050505050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015461159d81611806565b610b5c838361192e565b73ffffffffffffffffffffffffffffffffffffffff8083165f9081527fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854601602090815260408083209385168352929052908120545b9392505050565b61160a611fbc565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84861163481611806565b73ffffffffffffffffffffffffffffffffffffffff8416611681576040517fbae9330e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f036116ba576040517fc4b6591d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0054821115611718576040517f077dfa8400000000000000000000000000000000000000000000000000000000815260048101839052602401610daf565b8261172385336115a7565b101561178b573361173485336115a7565b6040517f4ee6c4d400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260448101849052606401610daf565b611796848385612a7b565b6117a1843385612bae565b6117ab8484612c50565b604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff8616917f49995e5dd6158cf69ad3e9777c46755a1a826a446c6416992167462dad033b2a9101611414565b610c6e8383836001612caa565b610ca58133612e13565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616855290915282205460ff16611925575f8481526020828152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118c13390565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4600191505061096c565b5f91505061096c565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616855290915282205460ff1615611925575f8481526020828152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4600191505061096c565b611a12612eb9565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a150565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000088e218fba179d848062a9b95b4d3d632161480611b7457507f0000000000000000000000000000000088e218fba179d848062a9b95b4d3d63273ffffffffffffffffffffffffffffffffffffffff16611b5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611bab576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f610cc381611806565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611c3c575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611c3991810190613926565b60015b611c8a576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610daf565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611ce6576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610daf565b610c6e8383612f14565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000088e218fba179d848062a9b95b4d3d6321614611bab576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d67611fbc565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611a7c565b611de0612f76565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c8546007fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c854603611e2c8582613981565b5060048101611e3b8482613981565b50835160209485012060058201558151919093012060069092019190915550565b611e64612f76565b7f8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab08000080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611ed2612f76565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b7f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268005f611f74845f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b5f85815260208490526040808220600101869055519192508491839187917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a450505050565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1615611bab576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61202560208301836136d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120b7573361206560208401846136d4565b6040517fb62b67e800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401610daf565b610cc37f8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab0800005473ffffffffffffffffffffffffffffffffffffffff167fe6595996b7bed1637680b4cd86058d60a6e7466a44f2f733b49ef571d6cd1b8161212060208601866136d4565b6040805160208181019490945273ffffffffffffffffffffffffffffffffffffffff9092168282015291860135606082015290850135608082015260a001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602091820120906121a190850185613a9d565b846020013585604001356001612638565b5f8181527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f04602052604090207f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f01547f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f00919083111561225f576040517fede8bb4300000000000000000000000000000000000000000000000000000000815260048101849052602401610daf565b42816003015410156122b35760038101546040517ff97cc22f000000000000000000000000000000000000000000000000000000008152600481018590526024810191909152426044820152606401610daf565b5f8482600201546122c49190613ab6565b825490915081111561232057815460028301546040517f85be59c0000000000000000000000000000000000000000000000000000000008152600481018790526024810192909252604482015260648101869052608401610daf565b600290910155505050565b5f8381527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f046020908152604080832073ffffffffffffffffffffffffffffffffffffffff881684527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0383528184208785529092528220547f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f0092906123d0908590613ab6565b90508481111561241d576040517f12cefa38000000000000000000000000000000000000000000000000000000008152600481018790526024810186905260448101829052606401610daf565b81600101548111156124725760018201546040517f4e93deb100000000000000000000000000000000000000000000000000000000815260048101889052602481019190915260448101829052606401610daf565b73ffffffffffffffffffffffffffffffffffffffff9096165f9081526003909201602090815260408084209684529590525092909220929092555050565b73ffffffffffffffffffffffffffffffffffffffff82166124ff576040517fb92dde2f0000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b610cc35f8383612fdd565b7f8f1b20cbbba575d151776600aed9b8f8a953d65407ee4f743f3a3acfab08000073ffffffffffffffffffffffffffffffffffffffff8216612578576040517f98d0c1e200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805473ffffffffffffffffffffffffffffffffffffffff908116908316036125cc576040517f6cd5555300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811782556040517fc71dbbd4e9575e1080da3b8c0106488e019acb5b1aeaf95ea844f6296d36b251905f90a25050565b5f612641610b62565b6040517f1901000000000000000000000000000000000000000000000000000000000000815260028101829052602281018890526042902090915082156127d657604080515f8082526020820180845284905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156126d3573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661274b576040517fdb251b3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146127d0576040517f02cd899c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301528a166024820152604401610daf565b50612a71565b873b801561291f57604080516020810188905280820187905260f889901b7fff000000000000000000000000000000000000000000000000000000000000001660608201528151604181830301815260618201928390527f1626ba7e0000000000000000000000000000000000000000000000000000000090925273ffffffffffffffffffffffffffffffffffffffff8b1691631626ba7e9161287d918691606501613aee565b602060405180830381865afa158015612898573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128bc9190613b0e565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916631626ba7e60e01b1461291a576040517fdb251b3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a6f565b604080515f8082526020820180845285905260ff8a1692820192909252606081018890526080810187905260019060a0016020604051602081039080840390855afa158015612970573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166129e8576040517fdb251b3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612a6d576040517f02cd899c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301528b166024820152604401610daf565b505b505b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff83165f9081527f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f02602090815260408083208584529091529020547f9c4c4830eaf0ddba8723c7ca664593310d9079d35a5b95dd01a24180d77b8f009082811015612b30576040517f050ab16e0000000000000000000000000000000000000000000000000000000081526004810182905260248101849052604401610daf565b828103612b6e5773ffffffffffffffffffffffffffffffffffffffff85165f9081526002830160209081526040808320878452909152812055612ba7565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260028301602090815260408083208784529091529020805484900390555b5050505050565b5f612bb984846115a7565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610b5c5781811015612c42576040517ffe9846e700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024810182905260448101839052606401610daf565b610b5c84848484035f612caa565b73ffffffffffffffffffffffffffffffffffffffff8216612c9f576040517f192eff450000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b610cc3825f83612fdd565b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460073ffffffffffffffffffffffffffffffffffffffff8516612d1a576040517fae0cb89d0000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b73ffffffffffffffffffffffffffffffffffffffff8416612d69576040517fb8e4d8eb0000000000000000000000000000000000000000000000000000000081525f6004820152602401610daf565b73ffffffffffffffffffffffffffffffffffffffff8086165f90815260018301602090815260408083209388168352929052208390558115612ba7578373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051612e0491815260200190565b60405180910390a35050505050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610cc3576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260248101839052604401610daf565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16611bab576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612f1d826131aa565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115612f6e57610c6e8282613278565b610cc36132f7565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16611bab576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc48bcc4443aed8a1e6b73bae33c0732495d4a45af3fee1bf2ff284030c85460073ffffffffffffffffffffffffffffffffffffffff84166130375781816002015f82825461302c9190613ab6565b909155506130e79050565b73ffffffffffffffffffffffffffffffffffffffff84165f90815260208290526040902054828110156130bc576040517f1e76708100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff861660048201526024810182905260448101849052606401610daf565b73ffffffffffffffffffffffffffffffffffffffff85165f9081526020839052604090209083900390555b73ffffffffffffffffffffffffffffffffffffffff831661311257600281018054839003905561313d565b73ffffffffffffffffffffffffffffffffffffffff83165f9081526020829052604090208054830190555b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161319c91815260200190565b60405180910390a350505050565b8073ffffffffffffffffffffffffffffffffffffffff163b5f03613212576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610daf565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60605f808473ffffffffffffffffffffffffffffffffffffffff16846040516132a19190613b29565b5f60405180830381855af49150503d805f81146132d9576040519150601f19603f3d011682016040523d82523d5f602084013e6132de565b606091505b50915091506132ee85838361332f565b95945050505050565b3415611bab576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826133445761333f826133be565b6115fb565b8151158015613368575073ffffffffffffffffffffffffffffffffffffffff84163b155b156133b7576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610daf565b5092915050565b8051156133ce5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610ca5575f80fd5b5f6020828403121561343d575f80fd5b81356115fb81613400565b5f5b8381101561346257818101518382015260200161344a565b50505f910152565b5f8151808452613481816020860160208601613448565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f6115fb602083018461346a565b803573ffffffffffffffffffffffffffffffffffffffff811681146134e8575f80fd5b919050565b5f80604083850312156134fe575f80fd5b613507836134c5565b946020939093013593505050565b5f805f60608486031215613527575f80fd5b613530846134c5565b925061353e602085016134c5565b9150604084013590509250925092565b5f6020828403121561355e575f80fd5b5035919050565b5f8060408385031215613576575f80fd5b82359150613586602084016134c5565b90509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f67ffffffffffffffff808411156135d6576135d661358f565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561361c5761361c61358f565b81604052809350858152868686011115613634575f80fd5b858560208301375f602087830101525050509392505050565b5f806040838503121561365e575f80fd5b613667836134c5565b9150602083013567ffffffffffffffff811115613682575f80fd5b8301601f81018513613692575f80fd5b6136a1858235602084016135bc565b9150509250929050565b5f805f606084860312156136bd575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156136e4575f80fd5b6115fb826134c5565b5f82601f8301126136fc575f80fd5b6115fb838335602085016135bc565b5f805f805f8060c08789031215613720575f80fd5b863567ffffffffffffffff80821115613737575f80fd5b6137438a838b016136ed565b97506020890135915080821115613758575f80fd5b6137648a838b016136ed565b96506040890135915080821115613779575f80fd5b5061378689828a016136ed565b945050613795606088016134c5565b92506137a3608088016134c5565b91506137b160a088016134c5565b90509295509295509295565b5f606082840312156137cd575f80fd5b50919050565b5f805f60e084860312156137e5575f80fd5b6137ef85856137bd565b92506137fe85606086016137bd565b915060c084013590509250925092565b803560ff811681146134e8575f80fd5b5f805f805f805f60e0888a031215613834575f80fd5b61383d886134c5565b965061384b602089016134c5565b955060408801359450606088013593506138676080890161380e565b925060a0880135915060c0880135905092959891949750929550565b5f8060408385031215613894575f80fd5b61389d836134c5565b9150613586602084016134c5565b5f805f606084860312156138bd575f80fd5b6138c6846134c5565b95602085013595506040909401359392505050565b600181811c908216806138ef57607f821691505b6020821081036137cd577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60208284031215613936575f80fd5b5051919050565b601f821115610c6e57805f5260205f20601f840160051c810160208510156139625750805b601f840160051c820191505b81811015612ba7575f815560010161396e565b815167ffffffffffffffff81111561399b5761399b61358f565b6139af816139a984546138db565b8461393d565b602080601f831160018114613a01575f84156139cb5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a95565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613a4d57888601518255948401946001909101908401613a2e565b5085821015613a8957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f60208284031215613aad575f80fd5b6115fb8261380e565b8082018082111561096c577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b828152604060208201525f613b06604083018461346a565b949350505050565b5f60208284031215613b1e575f80fd5b81516115fb81613400565b5f8251613b3a818460208701613448565b919091019291505056fea26469706673582212202d51a3454e24447bd168e5958daf45f331f127970e7d30d9b95102e3ccfaf3e264736f6c63430008180033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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