ETH Price: $3,994.97 (+0.16%)
Gas: 0.11 GWei

Contract

0x555a36a97B8F2DaD0bc237c6f8A4b548F576F058

Overview

ETH Balance

Scroll LogoScroll LogoScroll Logo0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x56024ff1dff66e9ab59f67afe20cd57eb193dfb7155c3fa5a8e5f142391555bc -(pending)2024-12-07 7:28:567 hrs ago1733556536IN
Pencils Protocol: Vest Factory Early User
0 ETH(Pending)(Pending)
0x72df0082d38b771dad149683b89b3e9d71f8903cf37edef8b8c3a2f5f3be1423 -(pending)2024-12-02 13:39:115 days ago1733146751IN
Pencils Protocol: Vest Factory Early User
0 ETH(Pending)(Pending)
0x3cf5c582e43759f1264eeeb5dc767f90bd4d0df0d5deff1748662245dde788e0 -(pending)2024-10-24 18:07:1643 days ago1729793236IN
Pencils Protocol: Vest Factory Early User
0 ETH(Pending)(Pending)
Claim To Wallet116463062024-12-04 18:59:432 days ago1733338783IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000055520.05898375
Claim To Wallet115863602024-12-02 14:35:085 days ago1733150108IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000016620.04336398
Release113568592024-11-24 7:09:3313 days ago1732432173IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000004350.04038773
Release113560562024-11-24 6:28:4913 days ago1732429729IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00000540.0512256
Release113560022024-11-24 6:25:5013 days ago1732429550IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000005840.04874755
Claim To Wallet113544782024-11-24 5:03:3413 days ago1732424614IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000006280.0405594
Claim To CEX113422592024-11-23 17:44:0813 days ago1732383848IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000010480.04236739
Claim To Wallet113163472024-11-22 18:35:5614 days ago1732300556IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000012520.04306135
Claim To Wallet106645642024-10-30 14:52:0337 days ago1730299923IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00001870.04698622
Claim To Wallet106348512024-10-29 14:10:4039 days ago1730211040IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000009280.04720409
Claim To Wallet106215772024-10-29 3:08:0239 days ago1730171282IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000008020.06
Claim To Wallet106078632024-10-28 15:47:1039 days ago1730130430IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000008150.04468331
Claim To Wallet105707142024-10-27 9:00:3241 days ago1730019632IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00000380.03999163
Claim To Wallet105707012024-10-27 8:59:5341 days ago1730019593IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000046640.04079648
Claim To Wallet105707002024-10-27 8:59:5041 days ago1730019590IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000046670.04082047
Claim To Wallet105706942024-10-27 8:59:3241 days ago1730019572IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00004550.03999163
Claim To Wallet105706912024-10-27 8:59:2341 days ago1730019563IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000045470.03996936
Claim To Wallet105706782024-10-27 8:58:4441 days ago1730019524IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00004650.04078997
Claim To Wallet105706772024-10-27 8:58:4141 days ago1730019521IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00004560.03996936
Claim To Wallet105706652024-10-27 8:58:0541 days ago1730019485IN
Pencils Protocol: Vest Factory Early User
0 ETH0.00004650.04078997
Claim To Wallet105706582024-10-27 8:57:4441 days ago1730019464IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000046770.04090451
Claim To Wallet105706472024-10-27 8:57:1141 days ago1730019431IN
Pencils Protocol: Vest Factory Early User
0 ETH0.000045570.04002926
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
105707012024-10-27 8:59:5341 days ago1730019593
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105707002024-10-27 8:59:5041 days ago1730019590
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706942024-10-27 8:59:3241 days ago1730019572
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706912024-10-27 8:59:2341 days ago1730019563
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706782024-10-27 8:58:4441 days ago1730019524
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706772024-10-27 8:58:4141 days ago1730019521
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706652024-10-27 8:58:0541 days ago1730019485
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706582024-10-27 8:57:4441 days ago1730019464
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706472024-10-27 8:57:1141 days ago1730019431
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706412024-10-27 8:56:5341 days ago1730019413
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706342024-10-27 8:56:3241 days ago1730019392
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706232024-10-27 8:55:5941 days ago1730019359
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105706082024-10-27 8:55:1441 days ago1730019314
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705942024-10-27 8:54:3241 days ago1730019272
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705852024-10-27 8:54:0541 days ago1730019245
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705782024-10-27 8:53:4441 days ago1730019224
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705702024-10-27 8:53:2041 days ago1730019200
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705432024-10-27 8:51:5941 days ago1730019119
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705232024-10-27 8:50:5941 days ago1730019059
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105705172024-10-27 8:50:4141 days ago1730019041
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105704912024-10-27 8:49:2341 days ago1730018963
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105704832024-10-27 8:48:5941 days ago1730018939
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105704682024-10-27 8:48:1441 days ago1730018894
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105704632024-10-27 8:47:5941 days ago1730018879
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
105704342024-10-27 8:46:3241 days ago1730018792
Pencils Protocol: Vest Factory Early User
 Contract Creation0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VestFactoryEarlyUser

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 24 : VestFactoryEarlyUser.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity ^0.8.20;

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

/// @title S2VestFactory
/// @notice Pencils Vesting Factory for Early Active User
contract VestFactoryEarlyUser is VestingWalletFactory {
    constructor(address signer, address default_admin, address token, string memory signDomain)
        VestingWalletFactory(signer, default_admin, token, signDomain)
    {}
}

File 2 of 24 : VestingWalletFactory.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity ^0.8.20;

import "./VestingWalletFragment.sol";
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract VestingWalletFactory is AccessControl, ReentrancyGuard, EIP712 {
    ////////////////////////////////////////////////////////////////////////////
    // Constants and Immutables
    ////////////////////////////////////////////////////////////////////////////

    /// @notice airdrop token address
    address private immutable token;

    /// @notice role for backend signer
    bytes32 public constant SIGNER_ROLE = keccak256("SIGNER_ROLE");

    /// @notice role for CEX related operation
    bytes32 public constant CEX_ROLE = keccak256("CEX_ROLE");

    /* For Signature */
    bytes32 private constant _TYPEHASH = keccak256(
        "Distribution(address beneficiary,uint256 initialReleaseAmount,uint256 vestingAmount,uint256 refund,uint64 startTimestamp,uint64 durationSeconds,uint64 expirationTime,uint8 decision)"
    );

    ////////////////////////////////////////////////////////////////////////////
    // State Variables
    ////////////////////////////////////////////////////////////////////////////

    struct Distribution {
        // vesting wallet's beneficiary
        address beneficiary;
        // initial release
        uint256 initialReleaseAmount;
        // stage-linear release
        uint256 vestingAmount;
        // amount of native eth to refund
        uint256 refund;
        // start time for linear release
        uint64 startTimestamp;
        // duration for linear release
        uint64 durationSeconds;
        // signature expiration
        uint64 expirationTime;
        // user decision
        uint8 decision;
    }

    /// @notice user decision
    /// @dev uint8(1): claim to cex
    /// @dev uint8(2): claim to wallet / claim to stake
    /// @dev uint8(3): refund
    mapping(address => uint8) public userDecision;

    /// @notice users' distribution data
    mapping(address => Distribution) public userDistribution;

    /// @notice users' vesting wallet
    mapping(address => address) public userToVestingWallet;

    /// @notice whether the signature is used
    mapping(bytes => bool) public signatureUsed;

    /// @notice user cex account list
    mapping(address => bytes32) public userCEXAccounts;

    /// @notice total amount for cex operation
    uint256 public totalAmountCEX;

    ////////////////////////////////////////////////////////////////////////////
    // constructor and receive
    ////////////////////////////////////////////////////////////////////////////

    constructor(address signer, address default_admin, address _token, string memory signDomain)
        EIP712(signDomain, "1")
    {
        _grantRole(SIGNER_ROLE, signer);
        _grantRole(DEFAULT_ADMIN_ROLE, default_admin);
        token = _token;
    }

    receive() external payable {
        // receive native eth for refund
    }

    ////////////////////////////////////////////////////////////////////////////
    // User-facing Functions
    ////////////////////////////////////////////////////////////////////////////

    function claimToCEX(Distribution calldata data, bytes calldata signature, address signer, bytes32 dataHash)
        external
        nonReentrant
    {
        // check whether user had claimed
        require(userDecision[data.beneficiary] == 0, "DAPPDistribution: user had claimed");
        // check data should have correct label
        require(data.decision == 1, "DAPPDistribution: invalid decision");
        // verify signature
        verifySignature(data, signature, signer);

        // effect
        userDecision[data.beneficiary] = uint8(1);
        userDistribution[data.beneficiary] = data;
        userCEXAccounts[data.beneficiary] = dataHash;
        totalAmountCEX += (data.initialReleaseAmount + data.vestingAmount);

        Address.sendValue(payable(data.beneficiary), data.refund);
    }

    function claimToWallet(Distribution calldata data, bytes calldata signature, address signer)
        external
        nonReentrant
    {
        // check whether user had claimed
        require(userDecision[data.beneficiary] == 0, "DAPPDistribution: user had claimed");
        // check data should have correct label
        require(data.decision == 2, "DAPPDistribution: invalid decision");
        // verify signature
        verifySignature(data, signature, signer);

        // create vesting wallet
        VestingWalletFragment vestingWallet = new VestingWalletFragment(
            data.beneficiary,
            data.initialReleaseAmount,
            token,
            data.vestingAmount,
            data.startTimestamp,
            data.durationSeconds
        );

        // effect
        userDecision[data.beneficiary] = uint8(2);
        userDistribution[data.beneficiary] = data;
        userToVestingWallet[data.beneficiary] = address(vestingWallet);

        // token approval
        SafeERC20.safeIncreaseAllowance(
            IERC20(token), address(vestingWallet), (data.initialReleaseAmount + data.vestingAmount)
        );
        vestingWallet.init();

        Address.sendValue(payable(data.beneficiary), data.refund);
    }

    function refund(Distribution calldata data, bytes calldata signature, address signer) external nonReentrant {
        // check whether user had claimed
        require(userDecision[data.beneficiary] == 0, "DAPPDistribution: user had claimed");
        // check data should have correct label
        require(data.decision == 3, "DAPPDistribution: invalid decision");
        // verify signature
        verifySignature(data, signature, signer);

        // effect
        userDecision[data.beneficiary] = uint8(3);
        userDistribution[data.beneficiary] = data;

        // interact
        Address.sendValue(payable(data.beneficiary), data.refund);
    }

    ////////////////////////////////////////////////////////////////////////////
    // Admin-facing Functions
    ////////////////////////////////////////////////////////////////////////////

    function withdrawAdmin(uint256 amount) public onlyRole(DEFAULT_ADMIN_ROLE) {
        uint256 belongToThis = IERC20(token).balanceOf(address(this)) - totalAmountCEX;
        require(belongToThis >= amount, "DAPPDistribution: insufficient");
        SafeERC20.safeTransfer(IERC20(token), msg.sender, amount);
    }

    function withdrawRefund(uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        Address.sendValue(payable(msg.sender), amount);
    }

    function withdrawCEX(uint256 amount) external onlyRole(CEX_ROLE) {
        totalAmountCEX -= amount;
        SafeERC20.safeTransfer(IERC20(token), msg.sender, amount);
    }

    ////////////////////////////////////////////////////////////////////////////
    // internal
    ////////////////////////////////////////////////////////////////////////////

    function verifySignature(Distribution calldata data, bytes calldata signature, address signer) internal {
        require(hasRole(SIGNER_ROLE, signer), "DAPPDistribution: invalid signer");
        require(!signatureUsed[signature], "DAPPDistribution: signature used");
        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    _TYPEHASH,
                    data.beneficiary,
                    data.initialReleaseAmount,
                    data.vestingAmount,
                    data.refund,
                    data.startTimestamp,
                    data.durationSeconds,
                    data.expirationTime,
                    data.decision
                )
            )
        );
        address recoveredSigner = ECDSA.recover(digest, signature);

        require(signer == recoveredSigner, "DAPPDistribution: invalid signature");
        require(block.timestamp <= data.expirationTime, "DAPPDistribution: signature expired");
        signatureUsed[signature] = true;
    }
}

File 3 of 24 : VestingWalletFragment.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {VestingWallet} from "@openzeppelin/contracts/finance/VestingWallet.sol";

contract VestingWalletFragment is VestingWallet {
    ////////////////////////////////////////////////////////////////////////////
    // constant & immutable
    ////////////////////////////////////////////////////////////////////////////

    /// @notice timestamp in seconds for 30 days
    uint64 private constant _secondsPerMonth = 30 days;

    /// @notice factory address
    address public immutable FACTORY;

    /// @notice The release token address
    address public immutable RELEASE_TOKEN;

    /// @notice The amount of tokens to be released immediately
    uint256 public immutable initialReleaseAmount;

    /// @notice The amount of tokens to be released linearly
    uint256 public immutable vestingReleaseAmount;

    ////////////////////////////////////////////////////////////////////////////
    // constructor & receive
    ////////////////////////////////////////////////////////////////////////////

    constructor(
        address beneficiary,
        uint256 initialReleaseAmount_,
        address vestingToken_,
        uint256 vestingAmount_,
        uint64 startTimestamp,
        uint64 durationSeconds
    ) VestingWallet(beneficiary, startTimestamp, durationSeconds) {
        // factory
        FACTORY = msg.sender;
        // set release token address
        RELEASE_TOKEN = vestingToken_;
        // set release amount
        initialReleaseAmount = initialReleaseAmount_;
        vestingReleaseAmount = vestingAmount_;
    }

    receive() external payable override {
        // block native ether sent to the contract
        revert("Not allow any ether");
    }

    ////////////////////////////////////////////////////////////////////////////
    // Initialize
    ////////////////////////////////////////////////////////////////////////////

    function init() external {
        require(msg.sender == FACTORY, "not the factory");
        // pull token
        SafeERC20.safeTransferFrom(
            IERC20(RELEASE_TOKEN), msg.sender, address(this), initialReleaseAmount + vestingReleaseAmount
        );
        // release `initialReleaseAmount`
        release(RELEASE_TOKEN);
    }

    ////////////////////////////////////////////////////////////////////////////
    // VestingWallet Override
    ////////////////////////////////////////////////////////////////////////////

    /// @dev release formula: releaseable = initAmount + vestingAmount * elapsedMonths / totalMonths
    function _vestingSchedule(uint256, uint64 timestamp) internal view override returns (uint256) {
        if (timestamp < start()) {
            return initialReleaseAmount;
        } else if (timestamp >= end()) {
            return initialReleaseAmount + vestingReleaseAmount;
        } else {
            uint256 elapsedMonths = (timestamp - start()) / _secondsPerMonth;
            uint256 totalMonths = duration() / _secondsPerMonth;
            return initialReleaseAmount + (vestingReleaseAmount * elapsedMonths) / totalMonths;
        }
    }
}

File 4 of 24 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.20;

import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
 * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
 * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
 * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _name which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Name() internal view returns (string memory) {
        return _name.toStringWithFallback(_nameFallback);
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _version which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Version() internal view returns (string memory) {
        return _version.toStringWithFallback(_versionFallback);
    }
}

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

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

    /**
     * @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) {
        return _roles[role].hasRole[account];
    }

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

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

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

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

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

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

        _revokeRole(role, callerConfirmation);
    }

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

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

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

File 6 of 24 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

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

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

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

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

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

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

File 7 of 24 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

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

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

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 8 of 24 : 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 9 of 24 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

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

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

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

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

File 10 of 24 : VestingWallet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (finance/VestingWallet.sol)
pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";
import {SafeERC20} from "../token/ERC20/utils/SafeERC20.sol";
import {Address} from "../utils/Address.sol";
import {Context} from "../utils/Context.sol";
import {Ownable} from "../access/Ownable.sol";

/**
 * @dev A vesting wallet is an ownable contract that can receive native currency and ERC20 tokens, and release these
 * assets to the wallet owner, also referred to as "beneficiary", according to a vesting schedule.
 *
 * Any assets transferred to this contract will follow the vesting schedule as if they were locked from the beginning.
 * Consequently, if the vesting has already started, any amount of tokens sent to this contract will (at least partly)
 * be immediately releasable.
 *
 * By setting the duration to 0, one can configure this contract to behave like an asset timelock that hold tokens for
 * a beneficiary until a specified time.
 *
 * NOTE: Since the wallet is {Ownable}, and ownership can be transferred, it is possible to sell unvested tokens.
 * Preventing this in a smart contract is difficult, considering that: 1) a beneficiary address could be a
 * counterfactually deployed contract, 2) there is likely to be a migration path for EOAs to become contracts in the
 * near future.
 *
 * NOTE: When using this contract with any token whose balance is adjusted automatically (i.e. a rebase token), make
 * sure to account the supply/balance adjustment in the vesting schedule to ensure the vested amount is as intended.
 */
contract VestingWallet is Context, Ownable {
    event EtherReleased(uint256 amount);
    event ERC20Released(address indexed token, uint256 amount);

    uint256 private _released;
    mapping(address token => uint256) private _erc20Released;
    uint64 private immutable _start;
    uint64 private immutable _duration;

    /**
     * @dev Sets the sender as the initial owner, the beneficiary as the pending owner, the start timestamp and the
     * vesting duration of the vesting wallet.
     */
    constructor(address beneficiary, uint64 startTimestamp, uint64 durationSeconds) payable Ownable(beneficiary) {
        _start = startTimestamp;
        _duration = durationSeconds;
    }

    /**
     * @dev The contract should be able to receive Eth.
     */
    receive() external payable virtual {}

    /**
     * @dev Getter for the start timestamp.
     */
    function start() public view virtual returns (uint256) {
        return _start;
    }

    /**
     * @dev Getter for the vesting duration.
     */
    function duration() public view virtual returns (uint256) {
        return _duration;
    }

    /**
     * @dev Getter for the end timestamp.
     */
    function end() public view virtual returns (uint256) {
        return start() + duration();
    }

    /**
     * @dev Amount of eth already released
     */
    function released() public view virtual returns (uint256) {
        return _released;
    }

    /**
     * @dev Amount of token already released
     */
    function released(address token) public view virtual returns (uint256) {
        return _erc20Released[token];
    }

    /**
     * @dev Getter for the amount of releasable eth.
     */
    function releasable() public view virtual returns (uint256) {
        return vestedAmount(uint64(block.timestamp)) - released();
    }

    /**
     * @dev Getter for the amount of releasable `token` tokens. `token` should be the address of an
     * IERC20 contract.
     */
    function releasable(address token) public view virtual returns (uint256) {
        return vestedAmount(token, uint64(block.timestamp)) - released(token);
    }

    /**
     * @dev Release the native token (ether) that have already vested.
     *
     * Emits a {EtherReleased} event.
     */
    function release() public virtual {
        uint256 amount = releasable();
        _released += amount;
        emit EtherReleased(amount);
        Address.sendValue(payable(owner()), amount);
    }

    /**
     * @dev Release the tokens that have already vested.
     *
     * Emits a {ERC20Released} event.
     */
    function release(address token) public virtual {
        uint256 amount = releasable(token);
        _erc20Released[token] += amount;
        emit ERC20Released(token, amount);
        SafeERC20.safeTransfer(IERC20(token), owner(), amount);
    }

    /**
     * @dev Calculates the amount of ether that has already vested. Default implementation is a linear vesting curve.
     */
    function vestedAmount(uint64 timestamp) public view virtual returns (uint256) {
        return _vestingSchedule(address(this).balance + released(), timestamp);
    }

    /**
     * @dev Calculates the amount of tokens that has already vested. Default implementation is a linear vesting curve.
     */
    function vestedAmount(address token, uint64 timestamp) public view virtual returns (uint256) {
        return _vestingSchedule(IERC20(token).balanceOf(address(this)) + released(token), timestamp);
    }

    /**
     * @dev Virtual implementation of the vesting formula. This returns the amount vested, as a function of time, for
     * an asset given its total historical allocation.
     */
    function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view virtual returns (uint256) {
        if (timestamp < start()) {
            return 0;
        } else if (timestamp >= end()) {
            return totalAllocation;
        } else {
            return (totalAllocation * (timestamp - start())) / duration();
        }
    }
}

File 11 of 24 : MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (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), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

File 12 of 24 : ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.20;

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

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using
     * {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 13 of 24 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.20;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 14 of 24 : 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 15 of 24 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

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

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

pragma solidity ^0.8.20;

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

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

File 17 of 24 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 18 of 24 : 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 19 of 24 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 20 of 24 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

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

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 21 of 24 : 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 22 of 24 : 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 23 of 24 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 24 of 24 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@scroll-tech/[email protected]/=/lib/scroll-contracts/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/scroll-contracts/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=lib/scroll-contracts/node_modules/hardhat/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "scroll-contracts/=lib/scroll-contracts/",
    "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
    "solmate/=lib/scroll-contracts/lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"default_admin","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"signDomain","type":"string"}],"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":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"CEX_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":"SIGNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"initialReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"vestingAmount","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"durationSeconds","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint8","name":"decision","type":"uint8"}],"internalType":"struct VestingWalletFactory.Distribution","name":"data","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"claimToCEX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"initialReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"vestingAmount","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"durationSeconds","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint8","name":"decision","type":"uint8"}],"internalType":"struct VestingWalletFactory.Distribution","name":"data","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"signer","type":"address"}],"name":"claimToWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"initialReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"vestingAmount","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"durationSeconds","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint8","name":"decision","type":"uint8"}],"internalType":"struct VestingWalletFactory.Distribution","name":"data","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"signer","type":"address"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","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":"bytes","name":"","type":"bytes"}],"name":"signatureUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmountCEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userCEXAccounts","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userDecision","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userDistribution","outputs":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"initialReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"vestingAmount","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"durationSeconds","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint8","name":"decision","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userToVestingWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawCEX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101806040523480156200001257600080fd5b5060405162003b5138038062003b518339810160408190526200003591620002f1565b604080518082019091526001808252603160f81b60208301528055849084908490849081906200006782600262000165565b610120526200007881600362000165565b61014052815160208084019190912060e052815190820120610100524660a0526200010660e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0526200013b7fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f70856200019e565b50620001496000846200019e565b50506001600160a01b0316610160525062000597945050505050565b600060208351101562000185576200017d836200024c565b905062000198565b8162000192848262000471565b5060ff90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000243576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620001fa3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000198565b50600062000198565b600080829050601f8151111562000283578260405163305a27a960e01b81526004016200027a91906200053d565b60405180910390fd5b8051620002908262000572565b179392505050565b80516001600160a01b0381168114620002b057600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620002e8578181015183820152602001620002ce565b50506000910152565b600080600080608085870312156200030857600080fd5b620003138562000298565b9350620003236020860162000298565b9250620003336040860162000298565b60608601519092506001600160401b03808211156200035157600080fd5b818701915087601f8301126200036657600080fd5b8151818111156200037b576200037b620002b5565b604051601f8201601f19908116603f01168101908382118183101715620003a657620003a6620002b5565b816040528281528a6020848701011115620003c057600080fd5b620003d3836020830160208801620002cb565b979a9699509497505050505050565b600181811c90821680620003f757607f821691505b6020821081036200041857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200046c57600081815260208120601f850160051c81016020861015620004475750805b601f850160051c820191505b81811015620004685782815560010162000453565b5050505b505050565b81516001600160401b038111156200048d576200048d620002b5565b620004a5816200049e8454620003e2565b846200041e565b602080601f831160018114620004dd5760008415620004c45750858301515b600019600386901b1c1916600185901b17855562000468565b600085815260208120601f198616915b828110156200050e57888601518255948401946001909101908401620004ed565b50858210156200052d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600082518060208401526200055e816040850160208701620002cb565b601f01601f19169190910160400192915050565b80516020808301519190811015620004185760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161016051613538620006196000396000818161072b015281816108bd01528181610a0001528181610c580152610d2c0152600061157501526000611541015260006118c8015260006118a0015260006117f8015260006118230152600061184e01526135386000f3fe608060405260043610620001535760003560e01c8063a1ebf35d11620000b9578063bf8c271e1162000078578063bf8c271e1462000526578063ca318eb7146200054b578063d547741f1462000563578063d77836ce1462000588578063e54819fb14620005ad578063f0bc203e14620005d257600080fd5b8063a1ebf35d1462000411578063a217fddf1462000447578063abdd26c0146200045e578063ac87d70f14620004b1578063bb10c82914620004e757600080fd5b806336568abe116200011257806336568abe14620002705780633cf69475146200029557806350d48f35146200037557806384b0196e146200039a57806391d1485414620003c75780639d15349514620003ec57600080fd5b806301ffc9a71462000160578063035fbaa2146200019a578063248a9ca314620001e15780632f2ff15d14620002245780633141c2ae146200024b57600080fd5b366200015b57005b600080fd5b3480156200016d57600080fd5b50620001856200017f36600462001d7c565b62000603565b60405190151581526020015b60405180910390f35b348015620001a757600080fd5b50620001ce620001b936600462001dbe565b60046020526000908152604090205460ff1681565b60405160ff909116815260200162000191565b348015620001ee57600080fd5b50620002156200020036600462001dde565b60009081526020819052604090206001015490565b60405190815260200162000191565b3480156200023157600080fd5b50620002496200024336600462001df8565b6200063b565b005b3480156200025857600080fd5b50620002496200026a36600462001e91565b6200066a565b3480156200027d57600080fd5b50620002496200028f36600462001df8565b62000979565b348015620002a257600080fd5b506200031c620002b436600462001dbe565b600560205260009081526040902080546001820154600283015460038401546004909401546001600160a01b0390931693919290919067ffffffffffffffff80821691680100000000000000008104821691600160801b82041690600160c01b900460ff1688565b604080516001600160a01b039099168952602089019790975295870194909452606086019290925267ffffffffffffffff908116608086015290811660a08501521660c083015260ff1660e08201526101000162000191565b3480156200038257600080fd5b50620002496200039436600462001dde565b620009b4565b348015620003a757600080fd5b50620003b262000a2b565b60405162000191979695949392919062001f57565b348015620003d457600080fd5b5062000185620003e636600462001df8565b62000a75565b348015620003f957600080fd5b50620002496200040b36600462001dde565b62000a9e565b3480156200041e57600080fd5b50620002157fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f7081565b3480156200045457600080fd5b5062000215600081565b3480156200046b57600080fd5b50620004986200047d36600462001dbe565b6006602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200162000191565b348015620004be57600080fd5b50620002157f7418aa4a899c98df044e2089f8bc72f5122185fae64a789283934d191489bae681565b348015620004f457600080fd5b50620001856200050636600462002009565b805160208183018101805160078252928201919093012091525460ff1681565b3480156200053357600080fd5b50620002496200054536600462001e91565b62000ab7565b3480156200055857600080fd5b506200021560095481565b3480156200057057600080fd5b50620002496200058236600462001df8565b62000bfe565b3480156200059557600080fd5b5062000249620005a736600462001dde565b62000c27565b348015620005ba57600080fd5b5062000249620005cc366004620020c4565b62000d53565b348015620005df57600080fd5b5062000215620005f136600462001dbe565b60086020526000908152604090205481565b60006001600160e01b03198216637965db0b60e01b14806200063557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260208190526040902060010154620006588162000efd565b62000664838362000f0c565b50505050565b6200067462000fa4565b6004600062000687602087018762001dbe565b6001600160a01b0316815260208101919091526040016000205460ff1615620006cd5760405162461bcd60e51b8152600401620006c4906200213f565b60405180910390fd5b620006e0610100850160e0860162002191565b60ff16600214620007055760405162461bcd60e51b8152600401620006c490620021b1565b620007138484848462000fcf565b600062000724602086018662001dbe565b60208601357f000000000000000000000000000000000000000000000000000000000000000060408801356200076160a08a0160808b016200220a565b6200077360c08b0160a08c016200220a565b604051620007819062001d6e565b6001600160a01b0396871681526020810195909552949092166040840152606083015267ffffffffffffffff908116608083015290911660a082015260c001604051809103906000f080158015620007dd573d6000803e3d6000fd5b509050600260046000620007f5602089018962001dbe565b6001600160a01b031681526020808201929092526040016000908120805460ff191660ff94909416939093179092558691600591620008379084018462001dbe565b6001600160a01b0316815260208101919091526040016000206200085c828262002248565b508190506006600062000873602089018962001dbe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620008f97f00000000000000000000000000000000000000000000000000000000000000008287604001358860200135620008f3919062002386565b6200133c565b806001600160a01b031663e1c7392a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200093557600080fd5b505af11580156200094a573d6000803e3d6000fd5b506200096e925062000963915050602087018762001dbe565b8660600135620013cd565b506200066460018055565b6001600160a01b0381163314620009a35760405163334bd91960e11b815260040160405180910390fd5b620009af828262001469565b505050565b7f7418aa4a899c98df044e2089f8bc72f5122185fae64a789283934d191489bae6620009e08162000efd565b8160096000828254620009f491906200239c565b9091555062000a2790507f00000000000000000000000000000000000000000000000000000000000000003384620014d8565b5050565b60006060806000806000606062000a4162001539565b62000a4b6200156d565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600062000aab8162000efd565b62000a273383620013cd565b62000ac162000fa4565b6004600062000ad4602087018762001dbe565b6001600160a01b0316815260208101919091526040016000205460ff161562000b115760405162461bcd60e51b8152600401620006c4906200213f565b62000b24610100850160e0860162002191565b60ff1660031462000b495760405162461bcd60e51b8152600401620006c490620021b1565b62000b578484848462000fcf565b60036004600062000b6c602088018862001dbe565b6001600160a01b031681526020808201929092526040016000908120805460ff191660ff9490941693909317909255859160059162000bae9084018462001dbe565b6001600160a01b03168152602081019190915260400160002062000bd3828262002248565b5062000bf4905062000be9602086018662001dbe565b8560600135620013cd565b6200066460018055565b60008281526020819052604090206001015462000c1b8162000efd565b62000664838362001469565b600062000c348162000efd565b6009546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801562000ca0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cc69190620023b2565b62000cd291906200239c565b90508281101562000d265760405162461bcd60e51b815260206004820152601e60248201527f44415050446973747269627574696f6e3a20696e73756666696369656e7400006044820152606401620006c4565b620009af7f00000000000000000000000000000000000000000000000000000000000000003385620014d8565b62000d5d62000fa4565b6004600062000d70602088018862001dbe565b6001600160a01b0316815260208101919091526040016000205460ff161562000dad5760405162461bcd60e51b8152600401620006c4906200213f565b62000dc0610100860160e0870162002191565b60ff1660011462000de55760405162461bcd60e51b8152600401620006c490620021b1565b62000df38585858562000fcf565b60016004600062000e08602089018962001dbe565b6001600160a01b031681526020808201929092526040016000908120805460ff191660ff9490941693909317909255869160059162000e4a9084018462001dbe565b6001600160a01b03168152602081019190915260400160002062000e6f828262002248565b508190506008600062000e86602089018962001dbe565b6001600160a01b03166001600160a01b03168152602001908152602001600020819055508460400135856020013562000ec0919062002386565b6009600082825462000ed3919062002386565b9091555062000eec905062000963602087018762001dbe565b62000ef660018055565b5050505050565b62000f0981336200159c565b50565b600062000f1a838362000a75565b62000f9b576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905562000f523390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000635565b50600062000635565b60026001540362000fc857604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b62000ffb7fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f708262000a75565b620010495760405162461bcd60e51b815260206004820181905260248201527f44415050446973747269627574696f6e3a20696e76616c6964207369676e65726044820152606401620006c4565b600783836040516200105d929190620023cc565b9081526040519081900360200190205460ff1615620010bf5760405162461bcd60e51b815260206004820181905260248201527f44415050446973747269627574696f6e3a207369676e617475726520757365646044820152606401620006c4565b6000620011ce7fd2fcbf608521732b1a84c44cab1e8261d8d65184582baf4a82676860bbbc2f08620010f5602088018862001dbe565b6020880135604089013560608a01356200111660a08c0160808d016200220a565b6200112860c08d0160a08e016200220a565b6200113a60e08e0160c08f016200220a565b8d60e00160208101906200114f919062002191565b60408051602081019a909a526001600160a01b03909816978901979097526060880195909552608087019390935260a086019190915267ffffffffffffffff90811660c086015290811660e08501521661010083015260ff166101208201526101400160405160208183030381529060405280519060200120620015d9565b90506000620012148286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200160992505050565b9050806001600160a01b0316836001600160a01b031614620012855760405162461bcd60e51b815260206004820152602360248201527f44415050446973747269627574696f6e3a20696e76616c6964207369676e617460448201526275726560e81b6064820152608401620006c4565b6200129760e0870160c088016200220a565b67ffffffffffffffff16421115620012fe5760405162461bcd60e51b815260206004820152602360248201527f44415050446973747269627574696f6e3a207369676e617475726520657870696044820152621c995960ea1b6064820152608401620006c4565b60016007868660405162001314929190620023cc565b908152604051908190036020019020805491151560ff19909216919091179055505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa1580156200138d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013b39190620023b2565b9050620006648484620013c7858562002386565b62001637565b80471015620013f25760405163cd78605960e01b8152306004820152602401620006c4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811462001441576040519150601f19603f3d011682016040523d82523d6000602084013e62001446565b606091505b5050905080620009af57604051630a12f52160e11b815260040160405180910390fd5b600062001477838362000a75565b1562000f9b576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600162000635565b6040516001600160a01b03838116602483015260448201839052620009af91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050620016c9565b6060620015687f0000000000000000000000000000000000000000000000000000000000000000600262001733565b905090565b6060620015687f0000000000000000000000000000000000000000000000000000000000000000600362001733565b620015a8828262000a75565b62000a275760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401620006c4565b600062000635620015e9620017eb565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000806200161b868662001919565b9250925092506200162d82826200196a565b5090949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526200168a848262001a35565b62000664576040516001600160a01b03848116602483015260006044830152620016c291869182169063095ea7b39060640162001506565b6200066484825b6000620016e06001600160a01b0384168362001ae6565b9050805160001415801562001708575080806020019051810190620017069190620023dc565b155b15620009af57604051635274afe760e01b81526001600160a01b0384166004820152602401620006c4565b606060ff83146200175157620017498362001afd565b905062000635565b8180546200175f9062002400565b80601f01602080910402602001604051908101604052809291908181526020018280546200178d9062002400565b8015620017de5780601f10620017b257610100808354040283529160200191620017de565b820191906000526020600020905b815481529060010190602001808311620017c057829003601f168201915b5050505050905062000635565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156200184557507f000000000000000000000000000000000000000000000000000000000000000046145b156200187057507f000000000000000000000000000000000000000000000000000000000000000090565b62001568604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103620019575760208401516040850151606086015160001a620019488882858562001b3e565b95509550955050505062001963565b50508151600091506002905b9250925092565b600082600381111562001981576200198162002436565b036200198b575050565b6001826003811115620019a257620019a262002436565b03620019c15760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115620019d857620019d862002436565b03620019fb5760405163fce698f760e01b815260048101829052602401620006c4565b600382600381111562001a125762001a1262002436565b0362000a27576040516335e2f38360e21b815260048101829052602401620006c4565b6000806000846001600160a01b03168460405162001a5491906200244c565b6000604051808303816000865af19150503d806000811462001a93576040519150601f19603f3d011682016040523d82523d6000602084013e62001a98565b606091505b509150915081801562001ac657508051158062001ac657508080602001905181019062001ac69190620023dc565b801562001add57506000856001600160a01b03163b115b95945050505050565b606062001af68383600062001c12565b9392505050565b6060600062001b0c8362001cb7565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562001b7b575060009150600390508262001c08565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562001bd0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662001bfe5750600092506001915082905062001c08565b9250600091508190505b9450945094915050565b60608147101562001c395760405163cd78605960e01b8152306004820152602401620006c4565b600080856001600160a01b0316848660405162001c5791906200244c565b60006040518083038185875af1925050503d806000811462001c96576040519150601f19603f3d011682016040523d82523d6000602084013e62001c9b565b606091505b509150915062001cad86838362001ce0565b9695505050505050565b600060ff8216601f8111156200063557604051632cd44ac360e21b815260040160405180910390fd5b60608262001cf95762001cf38262001d44565b62001af6565b815115801562001d1157506001600160a01b0384163b155b1562001d3c57604051639996b31560e01b81526001600160a01b0385166004820152602401620006c4565b508062001af6565b80511562001d555780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b611098806200246b83390190565b60006020828403121562001d8f57600080fd5b81356001600160e01b03198116811462001af657600080fd5b6001600160a01b038116811462000f0957600080fd5b60006020828403121562001dd157600080fd5b813562001af68162001da8565b60006020828403121562001df157600080fd5b5035919050565b6000806040838503121562001e0c57600080fd5b82359150602083013562001e208162001da8565b809150509250929050565b6000610100828403121562001e3f57600080fd5b50919050565b60008083601f84011262001e5857600080fd5b50813567ffffffffffffffff81111562001e7157600080fd5b60208301915083602082850101111562001e8a57600080fd5b9250929050565b600080600080610140858703121562001ea957600080fd5b62001eb5868662001e2b565b935061010085013567ffffffffffffffff81111562001ed357600080fd5b62001ee18782880162001e45565b90945092505061012085013562001ef88162001da8565b939692955090935050565b60005b8381101562001f2057818101518382015260200162001f06565b50506000910152565b6000815180845262001f4381602086016020860162001f03565b601f01601f19169290920160200192915050565b60ff60f81b881681526000602060e08184015262001f7960e084018a62001f29565b838103604085015262001f8d818a62001f29565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101562001fe15783518352928401929184019160010162001fc3565b50909c9b505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156200201c57600080fd5b813567ffffffffffffffff808211156200203557600080fd5b818401915084601f8301126200204a57600080fd5b8135818111156200205f576200205f62001ff3565b604051601f8201601f19908116603f011681019083821181831017156200208a576200208a62001ff3565b81604052828152876020848701011115620020a457600080fd5b826020860160208301376000928101602001929092525095945050505050565b60008060008060006101608688031215620020de57600080fd5b620020ea878762001e2b565b945061010086013567ffffffffffffffff8111156200210857600080fd5b620021168882890162001e45565b9095509350506101208601356200212d8162001da8565b94979396509194610140013592915050565b60208082526022908201527f44415050446973747269627574696f6e3a20757365722068616420636c61696d604082015261195960f21b606082015260800190565b60ff8116811462000f0957600080fd5b600060208284031215620021a457600080fd5b813562001af68162002181565b60208082526022908201527f44415050446973747269627574696f6e3a20696e76616c69642064656369736960408201526137b760f11b606082015260800190565b67ffffffffffffffff8116811462000f0957600080fd5b6000602082840312156200221d57600080fd5b813562001af681620021f3565b600081356200063581620021f3565b60008135620006358162002181565b8135620022558162001da8565b81546001600160a01b0319166001600160a01b0391909116178155602082013560018201556040820135600282015560608201356003820155600481016080830135620022a281620021f3565b815467ffffffffffffffff191667ffffffffffffffff82161782555062002302620022d060a085016200222a565b82546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff000000000000000016178255565b620023406200231460c085016200222a565b82805467ffffffffffffffff60801b191660809290921b67ffffffffffffffff60801b16919091179055565b620009af6200235260e0850162002239565b82805460ff60c01b191660c09290921b60ff60c01b16919091179055565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000635576200063562002370565b8181038181111562000635576200063562002370565b600060208284031215620023c557600080fd5b5051919050565b8183823760009101908152919050565b600060208284031215620023ef57600080fd5b8151801515811462001af657600080fd5b600181811c908216806200241557607f821691505b60208210810362001e3f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b600082516200246081846020870162001f03565b919091019291505056fe6101406040523480156200001257600080fd5b506040516200109838038062001098833981016040819052620000359162000133565b858282826001600160a01b0381166200006857604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200007381620000ae565b506001600160401b039182166080521660a05250503360c052506001600160a01b039190911660e052610100919091526101205250620001a2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200011657600080fd5b919050565b80516001600160401b03811681146200011657600080fd5b60008060008060008060c087890312156200014d57600080fd5b6200015887620000fe565b9550602087015194506200016f60408801620000fe565b93506060870151925062000186608088016200011b565b91506200019660a088016200011b565b90509295509295509295565b60805160a05160c05160e0516101005161012051610e5262000246600039600081816103ba015281816106f301528181610862015261091e0152600081816102bd01528181610714015281816108210152818161088301526109520152600081816102f1015281816106cd015261074201526000818161020901526106690152600081816101a70152818161076a01526108f00152600061063b0152610e526000f3fe6080604052600436106101185760003560e01c806392aadec4116100a0578063e1c7392a11610064578063e1c7392a14610393578063e9b45886146103a8578063efbe1c1c146103dc578063f2fde38b146103f1578063fbccedae1461041157600080fd5b806392aadec4146102df57806396132521146103135780639852595c14610328578063a3f8eace1461035e578063be9a65551461037e57600080fd5b8063715018a6116100e7578063715018a614610243578063810ec23b1461025857806386d1a69f146102785780638da5cb5b1461028d5780638e58ca44146102ab57600080fd5b80630a17b06b146101655780630fb5a6b41461019857806319165587146101d55780632dd31000146101f757600080fd5b366101605760405162461bcd60e51b81526020600482015260136024820152722737ba1030b63637bb9030b73c9032ba3432b960691b60448201526064015b60405180910390fd5b600080fd5b34801561017157600080fd5b50610185610180366004610cbd565b610426565b6040519081526020015b60405180910390f35b3480156101a457600080fd5b507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16610185565b3480156101e157600080fd5b506101f56101f0366004610cef565b61044a565b005b34801561020357600080fd5b5061022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161018f565b34801561024f57600080fd5b506101f56104e5565b34801561026457600080fd5b50610185610273366004610d0a565b6104f9565b34801561028457600080fd5b506101f561058f565b34801561029957600080fd5b506000546001600160a01b031661022b565b3480156102b757600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156102eb57600080fd5b5061022b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561031f57600080fd5b50600154610185565b34801561033457600080fd5b50610185610343366004610cef565b6001600160a01b031660009081526002602052604090205490565b34801561036a57600080fd5b50610185610379366004610cef565b610603565b34801561038a57600080fd5b50610185610630565b34801561039f57600080fd5b506101f561065e565b3480156103b457600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156103e857600080fd5b50610185610766565b3480156103fd57600080fd5b506101f561040c366004610cef565b6107aa565b34801561041d57600080fd5b506101856107e5565b600061044461043460015490565b61043e9047610d53565b83610803565b92915050565b600061045582610603565b6001600160a01b038316600090815260026020526040812080549293508392909190610482908490610d53565b90915550506040518181526001600160a01b038316907fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b9060200160405180910390a26104e1826104db6000546001600160a01b031690565b8361097f565b5050565b6104ed6109e3565b6104f76000610a10565b565b6001600160a01b038216600090815260026020526040812054610588906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa15801561055a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057e9190610d66565b61043e9190610d53565b9392505050565b60006105996107e5565b905080600160008282546105ad9190610d53565b90915550506040518181527fda9d4e5f101b8b9b1c5b76d0c5a9f7923571acfc02376aa076b75a8c080c956b9060200160405180910390a16106006105fa6000546001600160a01b031690565b82610a60565b50565b6001600160a01b03811660009081526002602052604081205461062683426104f9565b6104449190610d7f565b67ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106c85760405162461bcd60e51b815260206004820152600f60248201526e6e6f742074686520666163746f727960881b6044820152606401610157565b61073d7f000000000000000000000000000000000000000000000000000000000000000033306107387f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610d53565b610af7565b6104f77f000000000000000000000000000000000000000000000000000000000000000061044a565b60007f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1661079b610630565b6107a59190610d53565b905090565b6107b26109e3565b6001600160a01b0381166107dc57604051631e4fbdf760e01b815260006004820152602401610157565b61060081610a10565b60006107f060015490565b6107f942610426565b6107a59190610d7f565b600061080d610630565b8267ffffffffffffffff16101561084557507f0000000000000000000000000000000000000000000000000000000000000000610444565b61084d610766565b8267ffffffffffffffff16106108ae576108a77f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610d53565b9050610444565b600062278d006108bc610630565b6108d09067ffffffffffffffff8616610d7f565b6108da9190610d92565b9050600061091562278d0067ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016610d92565b905080610942837f0000000000000000000000000000000000000000000000000000000000000000610db4565b61094c9190610d92565b610976907f0000000000000000000000000000000000000000000000000000000000000000610d53565b92505050610444565b6040516001600160a01b038381166024830152604482018390526109de91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610b36565b505050565b6000546001600160a01b031633146104f75760405163118cdaa760e01b8152336004820152602401610157565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80471015610a835760405163cd78605960e01b8152306004820152602401610157565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ad0576040519150601f19603f3d011682016040523d82523d6000602084013e610ad5565b606091505b50509050806109de57604051630a12f52160e11b815260040160405180910390fd5b6040516001600160a01b038481166024830152838116604483015260648201839052610b309186918216906323b872dd906084016109ac565b50505050565b6000610b4b6001600160a01b03841683610b99565b90508051600014158015610b70575080806020019051810190610b6e9190610dcb565b155b156109de57604051635274afe760e01b81526001600160a01b0384166004820152602401610157565b60606105888383600084600080856001600160a01b03168486604051610bbf9190610ded565b60006040518083038185875af1925050503d8060008114610bfc576040519150601f19603f3d011682016040523d82523d6000602084013e610c01565b606091505b5091509150610c11868383610c1b565b9695505050505050565b606082610c3057610c2b82610c77565b610588565b8151158015610c4757506001600160a01b0384163b155b15610c7057604051639996b31560e01b81526001600160a01b0385166004820152602401610157565b5080610588565b805115610c875780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b803567ffffffffffffffff81168114610cb857600080fd5b919050565b600060208284031215610ccf57600080fd5b61058882610ca0565b80356001600160a01b0381168114610cb857600080fd5b600060208284031215610d0157600080fd5b61058882610cd8565b60008060408385031215610d1d57600080fd5b610d2683610cd8565b9150610d3460208401610ca0565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561044457610444610d3d565b600060208284031215610d7857600080fd5b5051919050565b8181038181111561044457610444610d3d565b600082610daf57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761044457610444610d3d565b600060208284031215610ddd57600080fd5b8151801515811461058857600080fd5b6000825160005b81811015610e0e5760208186018101518583015201610df4565b50600092019182525091905056fea2646970667358221220b4a205c842eec87e0c7d76401aefb5acce22302ce72048ba30a23cb4c346b75664736f6c63430008140033a26469706673582212203f3cdd6033cd92f1f9041f71f535029232e2f1b6ffdd9ed66687d66617bc2db564736f6c63430008140033000000000000000000000000095e0d107be60363a566c24f3a436d081b05dfa500000000000000000000000036c229e7f34b95a1e57e922f06e9423e94d43850000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec30000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001f50656e63696c7350726f746f636f6c56657374696e674561726c795573657200

Deployed Bytecode

0x608060405260043610620001535760003560e01c8063a1ebf35d11620000b9578063bf8c271e1162000078578063bf8c271e1462000526578063ca318eb7146200054b578063d547741f1462000563578063d77836ce1462000588578063e54819fb14620005ad578063f0bc203e14620005d257600080fd5b8063a1ebf35d1462000411578063a217fddf1462000447578063abdd26c0146200045e578063ac87d70f14620004b1578063bb10c82914620004e757600080fd5b806336568abe116200011257806336568abe14620002705780633cf69475146200029557806350d48f35146200037557806384b0196e146200039a57806391d1485414620003c75780639d15349514620003ec57600080fd5b806301ffc9a71462000160578063035fbaa2146200019a578063248a9ca314620001e15780632f2ff15d14620002245780633141c2ae146200024b57600080fd5b366200015b57005b600080fd5b3480156200016d57600080fd5b50620001856200017f36600462001d7c565b62000603565b60405190151581526020015b60405180910390f35b348015620001a757600080fd5b50620001ce620001b936600462001dbe565b60046020526000908152604090205460ff1681565b60405160ff909116815260200162000191565b348015620001ee57600080fd5b50620002156200020036600462001dde565b60009081526020819052604090206001015490565b60405190815260200162000191565b3480156200023157600080fd5b50620002496200024336600462001df8565b6200063b565b005b3480156200025857600080fd5b50620002496200026a36600462001e91565b6200066a565b3480156200027d57600080fd5b50620002496200028f36600462001df8565b62000979565b348015620002a257600080fd5b506200031c620002b436600462001dbe565b600560205260009081526040902080546001820154600283015460038401546004909401546001600160a01b0390931693919290919067ffffffffffffffff80821691680100000000000000008104821691600160801b82041690600160c01b900460ff1688565b604080516001600160a01b039099168952602089019790975295870194909452606086019290925267ffffffffffffffff908116608086015290811660a08501521660c083015260ff1660e08201526101000162000191565b3480156200038257600080fd5b50620002496200039436600462001dde565b620009b4565b348015620003a757600080fd5b50620003b262000a2b565b60405162000191979695949392919062001f57565b348015620003d457600080fd5b5062000185620003e636600462001df8565b62000a75565b348015620003f957600080fd5b50620002496200040b36600462001dde565b62000a9e565b3480156200041e57600080fd5b50620002157fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f7081565b3480156200045457600080fd5b5062000215600081565b3480156200046b57600080fd5b50620004986200047d36600462001dbe565b6006602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200162000191565b348015620004be57600080fd5b50620002157f7418aa4a899c98df044e2089f8bc72f5122185fae64a789283934d191489bae681565b348015620004f457600080fd5b50620001856200050636600462002009565b805160208183018101805160078252928201919093012091525460ff1681565b3480156200053357600080fd5b50620002496200054536600462001e91565b62000ab7565b3480156200055857600080fd5b506200021560095481565b3480156200057057600080fd5b50620002496200058236600462001df8565b62000bfe565b3480156200059557600080fd5b5062000249620005a736600462001dde565b62000c27565b348015620005ba57600080fd5b5062000249620005cc366004620020c4565b62000d53565b348015620005df57600080fd5b5062000215620005f136600462001dbe565b60086020526000908152604090205481565b60006001600160e01b03198216637965db0b60e01b14806200063557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260208190526040902060010154620006588162000efd565b62000664838362000f0c565b50505050565b6200067462000fa4565b6004600062000687602087018762001dbe565b6001600160a01b0316815260208101919091526040016000205460ff1615620006cd5760405162461bcd60e51b8152600401620006c4906200213f565b60405180910390fd5b620006e0610100850160e0860162002191565b60ff16600214620007055760405162461bcd60e51b8152600401620006c490620021b1565b620007138484848462000fcf565b600062000724602086018662001dbe565b60208601357f000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec360408801356200076160a08a0160808b016200220a565b6200077360c08b0160a08c016200220a565b604051620007819062001d6e565b6001600160a01b0396871681526020810195909552949092166040840152606083015267ffffffffffffffff908116608083015290911660a082015260c001604051809103906000f080158015620007dd573d6000803e3d6000fd5b509050600260046000620007f5602089018962001dbe565b6001600160a01b031681526020808201929092526040016000908120805460ff191660ff94909416939093179092558691600591620008379084018462001dbe565b6001600160a01b0316815260208101919091526040016000206200085c828262002248565b508190506006600062000873602089018962001dbe565b6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620008f97f000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec38287604001358860200135620008f3919062002386565b6200133c565b806001600160a01b031663e1c7392a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200093557600080fd5b505af11580156200094a573d6000803e3d6000fd5b506200096e925062000963915050602087018762001dbe565b8660600135620013cd565b506200066460018055565b6001600160a01b0381163314620009a35760405163334bd91960e11b815260040160405180910390fd5b620009af828262001469565b505050565b7f7418aa4a899c98df044e2089f8bc72f5122185fae64a789283934d191489bae6620009e08162000efd565b8160096000828254620009f491906200239c565b9091555062000a2790507f000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec33384620014d8565b5050565b60006060806000806000606062000a4162001539565b62000a4b6200156d565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600062000aab8162000efd565b62000a273383620013cd565b62000ac162000fa4565b6004600062000ad4602087018762001dbe565b6001600160a01b0316815260208101919091526040016000205460ff161562000b115760405162461bcd60e51b8152600401620006c4906200213f565b62000b24610100850160e0860162002191565b60ff1660031462000b495760405162461bcd60e51b8152600401620006c490620021b1565b62000b578484848462000fcf565b60036004600062000b6c602088018862001dbe565b6001600160a01b031681526020808201929092526040016000908120805460ff191660ff9490941693909317909255859160059162000bae9084018462001dbe565b6001600160a01b03168152602081019190915260400160002062000bd3828262002248565b5062000bf4905062000be9602086018662001dbe565b8560600135620013cd565b6200066460018055565b60008281526020819052604090206001015462000c1b8162000efd565b62000664838362001469565b600062000c348162000efd565b6009546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec316906370a0823190602401602060405180830381865afa15801562000ca0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cc69190620023b2565b62000cd291906200239c565b90508281101562000d265760405162461bcd60e51b815260206004820152601e60248201527f44415050446973747269627574696f6e3a20696e73756666696369656e7400006044820152606401620006c4565b620009af7f000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec33385620014d8565b62000d5d62000fa4565b6004600062000d70602088018862001dbe565b6001600160a01b0316815260208101919091526040016000205460ff161562000dad5760405162461bcd60e51b8152600401620006c4906200213f565b62000dc0610100860160e0870162002191565b60ff1660011462000de55760405162461bcd60e51b8152600401620006c490620021b1565b62000df38585858562000fcf565b60016004600062000e08602089018962001dbe565b6001600160a01b031681526020808201929092526040016000908120805460ff191660ff9490941693909317909255869160059162000e4a9084018462001dbe565b6001600160a01b03168152602081019190915260400160002062000e6f828262002248565b508190506008600062000e86602089018962001dbe565b6001600160a01b03166001600160a01b03168152602001908152602001600020819055508460400135856020013562000ec0919062002386565b6009600082825462000ed3919062002386565b9091555062000eec905062000963602087018762001dbe565b62000ef660018055565b5050505050565b62000f0981336200159c565b50565b600062000f1a838362000a75565b62000f9b576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905562000f523390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000635565b50600062000635565b60026001540362000fc857604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b62000ffb7fe2f4eaae4a9751e85a3e4a7b9587827a877f29914755229b07a7b2da98285f708262000a75565b620010495760405162461bcd60e51b815260206004820181905260248201527f44415050446973747269627574696f6e3a20696e76616c6964207369676e65726044820152606401620006c4565b600783836040516200105d929190620023cc565b9081526040519081900360200190205460ff1615620010bf5760405162461bcd60e51b815260206004820181905260248201527f44415050446973747269627574696f6e3a207369676e617475726520757365646044820152606401620006c4565b6000620011ce7fd2fcbf608521732b1a84c44cab1e8261d8d65184582baf4a82676860bbbc2f08620010f5602088018862001dbe565b6020880135604089013560608a01356200111660a08c0160808d016200220a565b6200112860c08d0160a08e016200220a565b6200113a60e08e0160c08f016200220a565b8d60e00160208101906200114f919062002191565b60408051602081019a909a526001600160a01b03909816978901979097526060880195909552608087019390935260a086019190915267ffffffffffffffff90811660c086015290811660e08501521661010083015260ff166101208201526101400160405160208183030381529060405280519060200120620015d9565b90506000620012148286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200160992505050565b9050806001600160a01b0316836001600160a01b031614620012855760405162461bcd60e51b815260206004820152602360248201527f44415050446973747269627574696f6e3a20696e76616c6964207369676e617460448201526275726560e81b6064820152608401620006c4565b6200129760e0870160c088016200220a565b67ffffffffffffffff16421115620012fe5760405162461bcd60e51b815260206004820152602360248201527f44415050446973747269627574696f6e3a207369676e617475726520657870696044820152621c995960ea1b6064820152608401620006c4565b60016007868660405162001314929190620023cc565b908152604051908190036020019020805491151560ff19909216919091179055505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa1580156200138d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013b39190620023b2565b9050620006648484620013c7858562002386565b62001637565b80471015620013f25760405163cd78605960e01b8152306004820152602401620006c4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811462001441576040519150601f19603f3d011682016040523d82523d6000602084013e62001446565b606091505b5050905080620009af57604051630a12f52160e11b815260040160405180910390fd5b600062001477838362000a75565b1562000f9b576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600162000635565b6040516001600160a01b03838116602483015260448201839052620009af91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050620016c9565b6060620015687f50656e63696c7350726f746f636f6c56657374696e674561726c79557365721f600262001733565b905090565b6060620015687f3100000000000000000000000000000000000000000000000000000000000001600362001733565b620015a8828262000a75565b62000a275760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401620006c4565b600062000635620015e9620017eb565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000806200161b868662001919565b9250925092506200162d82826200196a565b5090949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526200168a848262001a35565b62000664576040516001600160a01b03848116602483015260006044830152620016c291869182169063095ea7b39060640162001506565b6200066484825b6000620016e06001600160a01b0384168362001ae6565b9050805160001415801562001708575080806020019051810190620017069190620023dc565b155b15620009af57604051635274afe760e01b81526001600160a01b0384166004820152602401620006c4565b606060ff83146200175157620017498362001afd565b905062000635565b8180546200175f9062002400565b80601f01602080910402602001604051908101604052809291908181526020018280546200178d9062002400565b8015620017de5780601f10620017b257610100808354040283529160200191620017de565b820191906000526020600020905b815481529060010190602001808311620017c057829003601f168201915b5050505050905062000635565b6000306001600160a01b037f000000000000000000000000555a36a97b8f2dad0bc237c6f8a4b548f576f058161480156200184557507f000000000000000000000000000000000000000000000000000000000008275046145b156200187057507f1fd1db40ffc386c80ed299dca3655a08dd905ae54bcea45400c2ff8625c714e190565b62001568604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f18cbde537a25687322ff49b959a6fdfd8810dc682a4ee667d42e99db218baf48918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103620019575760208401516040850151606086015160001a620019488882858562001b3e565b95509550955050505062001963565b50508151600091506002905b9250925092565b600082600381111562001981576200198162002436565b036200198b575050565b6001826003811115620019a257620019a262002436565b03620019c15760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115620019d857620019d862002436565b03620019fb5760405163fce698f760e01b815260048101829052602401620006c4565b600382600381111562001a125762001a1262002436565b0362000a27576040516335e2f38360e21b815260048101829052602401620006c4565b6000806000846001600160a01b03168460405162001a5491906200244c565b6000604051808303816000865af19150503d806000811462001a93576040519150601f19603f3d011682016040523d82523d6000602084013e62001a98565b606091505b509150915081801562001ac657508051158062001ac657508080602001905181019062001ac69190620023dc565b801562001add57506000856001600160a01b03163b115b95945050505050565b606062001af68383600062001c12565b9392505050565b6060600062001b0c8362001cb7565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562001b7b575060009150600390508262001c08565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562001bd0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662001bfe5750600092506001915082905062001c08565b9250600091508190505b9450945094915050565b60608147101562001c395760405163cd78605960e01b8152306004820152602401620006c4565b600080856001600160a01b0316848660405162001c5791906200244c565b60006040518083038185875af1925050503d806000811462001c96576040519150601f19603f3d011682016040523d82523d6000602084013e62001c9b565b606091505b509150915062001cad86838362001ce0565b9695505050505050565b600060ff8216601f8111156200063557604051632cd44ac360e21b815260040160405180910390fd5b60608262001cf95762001cf38262001d44565b62001af6565b815115801562001d1157506001600160a01b0384163b155b1562001d3c57604051639996b31560e01b81526001600160a01b0385166004820152602401620006c4565b508062001af6565b80511562001d555780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b611098806200246b83390190565b60006020828403121562001d8f57600080fd5b81356001600160e01b03198116811462001af657600080fd5b6001600160a01b038116811462000f0957600080fd5b60006020828403121562001dd157600080fd5b813562001af68162001da8565b60006020828403121562001df157600080fd5b5035919050565b6000806040838503121562001e0c57600080fd5b82359150602083013562001e208162001da8565b809150509250929050565b6000610100828403121562001e3f57600080fd5b50919050565b60008083601f84011262001e5857600080fd5b50813567ffffffffffffffff81111562001e7157600080fd5b60208301915083602082850101111562001e8a57600080fd5b9250929050565b600080600080610140858703121562001ea957600080fd5b62001eb5868662001e2b565b935061010085013567ffffffffffffffff81111562001ed357600080fd5b62001ee18782880162001e45565b90945092505061012085013562001ef88162001da8565b939692955090935050565b60005b8381101562001f2057818101518382015260200162001f06565b50506000910152565b6000815180845262001f4381602086016020860162001f03565b601f01601f19169290920160200192915050565b60ff60f81b881681526000602060e08184015262001f7960e084018a62001f29565b838103604085015262001f8d818a62001f29565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101562001fe15783518352928401929184019160010162001fc3565b50909c9b505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156200201c57600080fd5b813567ffffffffffffffff808211156200203557600080fd5b818401915084601f8301126200204a57600080fd5b8135818111156200205f576200205f62001ff3565b604051601f8201601f19908116603f011681019083821181831017156200208a576200208a62001ff3565b81604052828152876020848701011115620020a457600080fd5b826020860160208301376000928101602001929092525095945050505050565b60008060008060006101608688031215620020de57600080fd5b620020ea878762001e2b565b945061010086013567ffffffffffffffff8111156200210857600080fd5b620021168882890162001e45565b9095509350506101208601356200212d8162001da8565b94979396509194610140013592915050565b60208082526022908201527f44415050446973747269627574696f6e3a20757365722068616420636c61696d604082015261195960f21b606082015260800190565b60ff8116811462000f0957600080fd5b600060208284031215620021a457600080fd5b813562001af68162002181565b60208082526022908201527f44415050446973747269627574696f6e3a20696e76616c69642064656369736960408201526137b760f11b606082015260800190565b67ffffffffffffffff8116811462000f0957600080fd5b6000602082840312156200221d57600080fd5b813562001af681620021f3565b600081356200063581620021f3565b60008135620006358162002181565b8135620022558162001da8565b81546001600160a01b0319166001600160a01b0391909116178155602082013560018201556040820135600282015560608201356003820155600481016080830135620022a281620021f3565b815467ffffffffffffffff191667ffffffffffffffff82161782555062002302620022d060a085016200222a565b82546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff000000000000000016178255565b620023406200231460c085016200222a565b82805467ffffffffffffffff60801b191660809290921b67ffffffffffffffff60801b16919091179055565b620009af6200235260e0850162002239565b82805460ff60c01b191660c09290921b60ff60c01b16919091179055565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000635576200063562002370565b8181038181111562000635576200063562002370565b600060208284031215620023c557600080fd5b5051919050565b8183823760009101908152919050565b600060208284031215620023ef57600080fd5b8151801515811462001af657600080fd5b600181811c908216806200241557607f821691505b60208210810362001e3f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b600082516200246081846020870162001f03565b919091019291505056fe6101406040523480156200001257600080fd5b506040516200109838038062001098833981016040819052620000359162000133565b858282826001600160a01b0381166200006857604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200007381620000ae565b506001600160401b039182166080521660a05250503360c052506001600160a01b039190911660e052610100919091526101205250620001a2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200011657600080fd5b919050565b80516001600160401b03811681146200011657600080fd5b60008060008060008060c087890312156200014d57600080fd5b6200015887620000fe565b9550602087015194506200016f60408801620000fe565b93506060870151925062000186608088016200011b565b91506200019660a088016200011b565b90509295509295509295565b60805160a05160c05160e0516101005161012051610e5262000246600039600081816103ba015281816106f301528181610862015261091e0152600081816102bd01528181610714015281816108210152818161088301526109520152600081816102f1015281816106cd015261074201526000818161020901526106690152600081816101a70152818161076a01526108f00152600061063b0152610e526000f3fe6080604052600436106101185760003560e01c806392aadec4116100a0578063e1c7392a11610064578063e1c7392a14610393578063e9b45886146103a8578063efbe1c1c146103dc578063f2fde38b146103f1578063fbccedae1461041157600080fd5b806392aadec4146102df57806396132521146103135780639852595c14610328578063a3f8eace1461035e578063be9a65551461037e57600080fd5b8063715018a6116100e7578063715018a614610243578063810ec23b1461025857806386d1a69f146102785780638da5cb5b1461028d5780638e58ca44146102ab57600080fd5b80630a17b06b146101655780630fb5a6b41461019857806319165587146101d55780632dd31000146101f757600080fd5b366101605760405162461bcd60e51b81526020600482015260136024820152722737ba1030b63637bb9030b73c9032ba3432b960691b60448201526064015b60405180910390fd5b600080fd5b34801561017157600080fd5b50610185610180366004610cbd565b610426565b6040519081526020015b60405180910390f35b3480156101a457600080fd5b507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16610185565b3480156101e157600080fd5b506101f56101f0366004610cef565b61044a565b005b34801561020357600080fd5b5061022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161018f565b34801561024f57600080fd5b506101f56104e5565b34801561026457600080fd5b50610185610273366004610d0a565b6104f9565b34801561028457600080fd5b506101f561058f565b34801561029957600080fd5b506000546001600160a01b031661022b565b3480156102b757600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156102eb57600080fd5b5061022b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561031f57600080fd5b50600154610185565b34801561033457600080fd5b50610185610343366004610cef565b6001600160a01b031660009081526002602052604090205490565b34801561036a57600080fd5b50610185610379366004610cef565b610603565b34801561038a57600080fd5b50610185610630565b34801561039f57600080fd5b506101f561065e565b3480156103b457600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156103e857600080fd5b50610185610766565b3480156103fd57600080fd5b506101f561040c366004610cef565b6107aa565b34801561041d57600080fd5b506101856107e5565b600061044461043460015490565b61043e9047610d53565b83610803565b92915050565b600061045582610603565b6001600160a01b038316600090815260026020526040812080549293508392909190610482908490610d53565b90915550506040518181526001600160a01b038316907fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b9060200160405180910390a26104e1826104db6000546001600160a01b031690565b8361097f565b5050565b6104ed6109e3565b6104f76000610a10565b565b6001600160a01b038216600090815260026020526040812054610588906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa15801561055a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057e9190610d66565b61043e9190610d53565b9392505050565b60006105996107e5565b905080600160008282546105ad9190610d53565b90915550506040518181527fda9d4e5f101b8b9b1c5b76d0c5a9f7923571acfc02376aa076b75a8c080c956b9060200160405180910390a16106006105fa6000546001600160a01b031690565b82610a60565b50565b6001600160a01b03811660009081526002602052604081205461062683426104f9565b6104449190610d7f565b67ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106c85760405162461bcd60e51b815260206004820152600f60248201526e6e6f742074686520666163746f727960881b6044820152606401610157565b61073d7f000000000000000000000000000000000000000000000000000000000000000033306107387f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610d53565b610af7565b6104f77f000000000000000000000000000000000000000000000000000000000000000061044a565b60007f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1661079b610630565b6107a59190610d53565b905090565b6107b26109e3565b6001600160a01b0381166107dc57604051631e4fbdf760e01b815260006004820152602401610157565b61060081610a10565b60006107f060015490565b6107f942610426565b6107a59190610d7f565b600061080d610630565b8267ffffffffffffffff16101561084557507f0000000000000000000000000000000000000000000000000000000000000000610444565b61084d610766565b8267ffffffffffffffff16106108ae576108a77f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610d53565b9050610444565b600062278d006108bc610630565b6108d09067ffffffffffffffff8616610d7f565b6108da9190610d92565b9050600061091562278d0067ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016610d92565b905080610942837f0000000000000000000000000000000000000000000000000000000000000000610db4565b61094c9190610d92565b610976907f0000000000000000000000000000000000000000000000000000000000000000610d53565b92505050610444565b6040516001600160a01b038381166024830152604482018390526109de91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610b36565b505050565b6000546001600160a01b031633146104f75760405163118cdaa760e01b8152336004820152602401610157565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80471015610a835760405163cd78605960e01b8152306004820152602401610157565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ad0576040519150601f19603f3d011682016040523d82523d6000602084013e610ad5565b606091505b50509050806109de57604051630a12f52160e11b815260040160405180910390fd5b6040516001600160a01b038481166024830152838116604483015260648201839052610b309186918216906323b872dd906084016109ac565b50505050565b6000610b4b6001600160a01b03841683610b99565b90508051600014158015610b70575080806020019051810190610b6e9190610dcb565b155b156109de57604051635274afe760e01b81526001600160a01b0384166004820152602401610157565b60606105888383600084600080856001600160a01b03168486604051610bbf9190610ded565b60006040518083038185875af1925050503d8060008114610bfc576040519150601f19603f3d011682016040523d82523d6000602084013e610c01565b606091505b5091509150610c11868383610c1b565b9695505050505050565b606082610c3057610c2b82610c77565b610588565b8151158015610c4757506001600160a01b0384163b155b15610c7057604051639996b31560e01b81526001600160a01b0385166004820152602401610157565b5080610588565b805115610c875780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b803567ffffffffffffffff81168114610cb857600080fd5b919050565b600060208284031215610ccf57600080fd5b61058882610ca0565b80356001600160a01b0381168114610cb857600080fd5b600060208284031215610d0157600080fd5b61058882610cd8565b60008060408385031215610d1d57600080fd5b610d2683610cd8565b9150610d3460208401610ca0565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561044457610444610d3d565b600060208284031215610d7857600080fd5b5051919050565b8181038181111561044457610444610d3d565b600082610daf57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761044457610444610d3d565b600060208284031215610ddd57600080fd5b8151801515811461058857600080fd5b6000825160005b81811015610e0e5760208186018101518583015201610df4565b50600092019182525091905056fea2646970667358221220b4a205c842eec87e0c7d76401aefb5acce22302ce72048ba30a23cb4c346b75664736f6c63430008140033a26469706673582212203f3cdd6033cd92f1f9041f71f535029232e2f1b6ffdd9ed66687d66617bc2db564736f6c63430008140033

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

000000000000000000000000095e0d107be60363a566c24f3a436d081b05dfa500000000000000000000000036c229e7f34b95a1e57e922f06e9423e94d43850000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec30000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001f50656e63696c7350726f746f636f6c56657374696e674561726c795573657200

-----Decoded View---------------
Arg [0] : signer (address): 0x095e0D107bE60363a566C24F3A436d081b05dfa5
Arg [1] : default_admin (address): 0x36c229E7f34B95A1E57E922F06E9423e94D43850
Arg [2] : token (address): 0xb0643F7b3e2E2F10FE4e38728a763eC05f4ADeC3
Arg [3] : signDomain (string): PencilsProtocolVestingEarlyUser

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000095e0d107be60363a566c24f3a436d081b05dfa5
Arg [1] : 00000000000000000000000036c229e7f34b95a1e57e922f06e9423e94d43850
Arg [2] : 000000000000000000000000b0643f7b3e2e2f10fe4e38728a763ec05f4adec3
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 000000000000000000000000000000000000000000000000000000000000001f
Arg [5] : 50656e63696c7350726f746f636f6c56657374696e674561726c795573657200


Block Transaction Gas Used Reward
view all blocks sequenced

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

Validator Index Block Amount
View All Withdrawals

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