ETH Price: $2,937.61 (-0.53%)
 

Overview

ETH Balance

Scroll LogoScroll LogoScroll Logo0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
176140692025-07-25 17:38:37183 days ago1753465117  Contract Creation0 ETH
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ChaosPushOracle

Compiler Version
v0.8.29+commit.ab55807c

Optimization Enabled:
No with 200 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";

/**
 * @title ChaosPushOracle
 * @author Chaos Labs
 * @dev A decentralized oracle contract that allows trusted oracles to push price updates
 * with multi-signature verification. Upgradable using UUPS proxy pattern.
 */
contract ChaosPushOracle is OwnableUpgradeable, UUPSUpgradeable {
    using ECDSA for bytes32;
    using MessageHashUtils for bytes32;

    // ============ Custom Errors ============

    error FeedIdMismatch();
    error TimestampTooOld();
    error TimestampTooFar();
    error TimestampNotNewer();
    error InsufficientSignatures();
    error SignerNotTrusted();
    error OracleAlreadyTrusted();
    error OracleNotFound();
    error RoundNotAvailable();
    error RoundExceedsUint80Limit();

    // ============ Structs ============

    struct RoundData {
        int256 price; // Price of the asset
        uint256 reportRoundId; // ID of the report round
        uint256 observedTs; // Timestamp when the observation was made
        uint256 blockNumber; // Block number of the transaction
        uint256 postedTs; // Timestamp when the data was posted
        uint8 numSignatures; // Count of valid signatures for this round
    }

    // ============ State Variables ============

    uint8 public decimals; // Number of decimal places for price
    string public description; // Description of the oracle
    uint80 internal _latestRound; // Tracks the latest round number, initialized to 0
    mapping(uint80 => RoundData) public rounds; // Mapping of round number to RoundData
    mapping(address => bool) public trustedOracles; // Mapping of trusted oracle addresses
    address[] public oracles; // List of all trusted oracles
    address public deprecated_trustedSender; // IMPORTANT: Maintains storage layout compatibility
    string public feedId; // The feed ID this oracle is responsible for

    // ============ Events ============

    /**
     * @dev Emitted when an oracle is added to the trusted list
     */
    event OracleAdded(address indexed oracle);

    /**
     * @dev Emitted when an oracle is removed from the trusted list
     */
    event OracleRemoved(address indexed oracle);

    /**
     * @dev Emitted when a new price update is successfully posted
     */
    event NewPriceUpdate(
        uint80 indexed roundId,
        int256 price,
        uint256 reportRoundId,
        uint256 timestamp,
        address transmitter,
        uint256 numSignatures
    );

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

    // ============ Initializer ============

    /**
     * @notice Initializes the contract instead of using a constructor
     * @param _decimals Number of decimal places for price
     * @param _description Description of the oracle
     * @param _owner Address of the contract owner
     * @param _oracles Array of initial oracle addresses to be trusted
     */
    function initialize(uint8 _decimals, string memory _description, address _owner, address[] memory _oracles)
        public
        initializer
    {
        __Ownable_init(_owner);
        __UUPSUpgradeable_init();

        decimals = _decimals;
        description = _description;
        feedId = "";
        _latestRound = 0;

        // Add initial oracles
        for (uint256 i = 0; i < _oracles.length; i++) {
            address oracle = _oracles[i];
            if (trustedOracles[oracle]) revert OracleAlreadyTrusted();
            trustedOracles[oracle] = true;
            oracles.push(oracle);
        }
    }

    /**
     * @notice Initializes the contract when upgrading from a previous version
     * @param _feedId The feed ID this oracle is responsible for
     */
    function initializeV2(string memory _feedId) external reinitializer(2) onlyOwner {
        feedId = _feedId;
    }

    // ============ Upgrade Authorization ============

    /**
     * @dev Function that authorizes an upgrade to a new implementation.
     * Only the owner can upgrade the contract.
     * @param newImplementation Address of the new implementation contract
     */
    function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}

    // ============ Oracle Management Functions ============

    /**
     * @notice Owner can add a trusted oracle
     * @param oracle Address of the oracle to be added
     */
    function addOracle(address oracle) external onlyOwner {
        if (trustedOracles[oracle]) revert OracleAlreadyTrusted();
        trustedOracles[oracle] = true;
        oracles.push(oracle);
        emit OracleAdded(oracle);
    }

    /**
     * @notice Owner can remove a trusted oracle
     * @param oracle Address of the oracle to be removed
     */
    function removeOracle(address oracle) external onlyOwner {
        if (!trustedOracles[oracle]) revert OracleNotFound();
        trustedOracles[oracle] = false;

        // Remove from oracles array
        for (uint256 i = 0; i < oracles.length; i++) {
            if (oracles[i] == oracle) {
                oracles[i] = oracles[oracles.length - 1];
                oracles.pop();
                break;
            }
        }
        emit OracleRemoved(oracle);
    }

    // ============ Update Posting Function ============

    /**
     * @notice Anyone can submit a report signed by multiple trusted oracles
     * @param report Encoded report data (string feedId, int256 price, uint256 reportRoundId, uint256 obsTs)
     * @param signatures Array of signatures from trusted oracles
     */
    function postUpdate(bytes memory report, bytes[] memory signatures) external {
        // Decode report
        (bytes32 reportFeedId, int256 price, uint256 reportRoundId, uint256 observationTs) =
            abi.decode(report, (bytes32, int256, uint256, uint256));

        // Verify feed ID matches
        if (reportFeedId != keccak256(bytes(feedId))) revert FeedIdMismatch();

        // Timestamp checks
        if (observationTs <= rounds[_latestRound].observedTs) revert TimestampNotNewer();
        if (observationTs > block.timestamp + 5 minutes) revert TimestampTooFar();

        uint256 minAllowedTimestamp = block.timestamp > 1 hours ? block.timestamp - 1 hours : 0;
        if (observationTs < minAllowedTimestamp) revert TimestampTooOld();

        // Signature verification
        // The message to be verified is the hash of the raw `report` bytes.
        bytes32 messageHash = keccak256(report);

        // Verify signatures
        uint256 validSignatures = _verifySignatures(messageHash, signatures);
        if (validSignatures < requiredSignatures()) revert InsufficientSignatures();

        // Update round data
        if (_latestRound == type(uint80).max) revert RoundExceedsUint80Limit();
        _latestRound++;

        rounds[_latestRound] = RoundData({
            price: price,
            reportRoundId: reportRoundId,
            observedTs: observationTs,
            blockNumber: block.number,
            postedTs: block.timestamp,
            numSignatures: uint8(validSignatures)
        });

        emit NewPriceUpdate(_latestRound, price, reportRoundId, observationTs, msg.sender, validSignatures);
    }

    /**
     * @dev Internal function to verify multiple signatures
     * @param messageHash The hash of the message being verified
     * @param signatures Array of signatures to verify
     * @return validSignatures Number of valid signatures
     */
    function _verifySignatures(bytes32 messageHash, bytes[] memory signatures) private view returns (uint256) {
        uint256 numSignatures = signatures.length;
        uint256 validSignatures = 0;
        address[] memory signers = new address[](numSignatures);

        for (uint256 i = 0; i < numSignatures; i++) {
            address signer = messageHash.recover(signatures[i]);

            if (!trustedOracles[signer]) revert SignerNotTrusted();

            // Check for duplicates
            bool isDuplicate = false;
            for (uint256 j = 0; j < validSignatures; j++) {
                if (signers[j] == signer) {
                    isDuplicate = true;
                    break;
                }
            }

            if (!isDuplicate) {
                signers[validSignatures] = signer;
                validSignatures++;
            }
        }

        return validSignatures;
    }

    // ============ Utility Functions ============

    /**
     * @notice Returns the number of required signatures (e.g., majority)
     * @return The number of required signatures
     */
    function requiredSignatures() public view returns (uint256) {
        uint256 totalOracles = oracles.length;
        uint256 threshold = (totalOracles * 2 + 2) / 3;
        return threshold > 0 ? threshold : 1;
    }

    // ============ Data Retrieval Functions ============

    /**
     * @notice Get the latest round number
     * @return The latest round number
     */
    function latestRound() external view returns (uint256) {
        return uint256(_latestRound);
    }

    /**
     * @notice Get the price for a specific round
     * @param roundId The round ID to retrieve price for
     * @return The price for the specified round
     */
    function getAnswer(uint256 roundId) external view returns (int256) {
        if (roundId == 0 || roundId > _latestRound) revert RoundNotAvailable();
        return rounds[uint80(roundId)].price;
    }

    /**
     * @notice Get the timestamp for a specific round
     * @param roundId The round ID to retrieve timestamp for
     * @return The timestamp for the specified round
     */
    function getTimestamp(uint256 roundId) external view returns (uint256) {
        if (roundId == 0 || roundId > _latestRound) revert RoundNotAvailable();
        return rounds[uint80(roundId)].postedTs;
    }

    /**
     * @notice Retrieve round data for a specific round
     * @param round The round number to retrieve data for
     * @return price The price for the specified round
     * @return reportRoundId The report round ID
     * @return timestamp The timestamp of the observation
     * @return blockNumber The block number when the round was posted
     */
    function getRoundData(uint80 round)
        external
        view
        returns (int256 price, uint256 reportRoundId, uint256 timestamp, uint256 blockNumber)
    {
        if (round == 0 || round > _latestRound) revert RoundNotAvailable();
        RoundData storage data = rounds[round];
        return (data.price, data.reportRoundId, data.observedTs, data.blockNumber);
    }

    /**
     * @notice Returns details of the latest successful update round
     * @return roundId The number of the latest round
     * @return answer The latest reported value
     * @return startedAt Block timestamp when the latest successful round started
     * @return updatedAt Block timestamp of the latest successful round
     * @return answeredInRound The number of the latest round
     */
    function latestRoundData()
        external
        view
        virtual
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        roundId = uint80(_latestRound);
        answer = latestAnswer();
        RoundData storage data = rounds[_latestRound];
        startedAt = data.observedTs;
        updatedAt = data.postedTs;
        answeredInRound = roundId;
    }

    /**
     * @notice Retrieve the timestamp of the latest round
     * @return timestamp The timestamp of the latest round
     */
    function latestTimestamp() external view returns (uint256 timestamp) {
        return rounds[_latestRound].postedTs;
    }

    // ============ Admin Functions ============

    /**
     * @notice Set the description of the oracle
     * @param _description The new description
     */
    function setDescription(string memory _description) external onlyOwner {
        description = _description;
    }

    /**
     * @notice Set the number of decimals for the answer values
     * @param _decimals The new number of decimals
     */
    function setDecimals(uint8 _decimals) external onlyOwner {
        decimals = _decimals;
    }

    /**
     * @notice Set the feed ID of the oracle
     * @param _feedId The new feed ID
     */
    function setFeedId(string memory _feedId) external onlyOwner {
        feedId = _feedId;
    }

    // ============ Helper Functions ============

    /**
     * @notice Helper function that generates the Ethereum-style message hash
     * @param _data The data to hash
     * @return The keccak256 hash of the data
     */
    function getMessageHash(bytes calldata _data) external pure returns (bytes32) {
        return keccak256(_data);
    }

    /**
     * @notice Chainlink-compatible function for getting the latest successfully reported value
     * @return The latest successfully reported value
     */
    function latestAnswer() public view virtual returns (int256) {
        return rounds[_latestRound].price;
    }
}

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

pragma solidity ^0.8.20;

import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable
    struct OwnableStorage {
        address _owner;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;

    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
        assembly {
            $.slot := OwnableStorageLocation
        }
    }

    /**
     * @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.
     */
    function __Ownable_init(address initialOwner) internal onlyInitializing {
        __Ownable_init_unchained(initialOwner);
    }

    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
        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) {
        OwnableStorage storage $ = _getOwnableStorage();
        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 {
        OwnableStorage storage $ = _getOwnableStorage();
        address oldOwner = $._owner;
        $._owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.22;

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

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

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

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

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

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

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

    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.
     *
     * NOTE: Consider following the ERC-7201 formula to derive storage locations.
     */
    function _initializableStorageSlot() internal pure virtual returns (bytes32) {
        return INITIALIZABLE_STORAGE;
    }

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

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.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[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an ERC-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://ethereum.org/en/developers/docs/apis/json-rpc/#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) {
        assembly ("memory-safe") {
            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 ERC-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://ethereum.org/en/developers/docs/apis/json-rpc/#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 ERC-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 Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.
     */
    function toDataWithIntendedValidatorHash(
        address validator,
        bytes32 messageHash
    ) internal pure returns (bytes32 digest) {
        assembly ("memory-safe") {
            mstore(0x00, hex"19_00")
            mstore(0x02, shl(96, validator))
            mstore(0x16, messageHash)
            digest := keccak256(0x00, 0x36)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-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) {
        assembly ("memory-safe") {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

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

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

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.20;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.22;

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

/**
 * @dev This library provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
 */
library ERC1967Utils {
    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

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

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

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

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

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

pragma solidity ^0.8.20;

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

/**
 * @dev String operations.
 */
library Strings {
    using SafeCast for *;

    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;
    uint256 private constant SPECIAL_CHARS_LOOKUP =
        (1 << 0x08) | // backspace
            (1 << 0x09) | // tab
            (1 << 0x0a) | // newline
            (1 << 0x0c) | // form feed
            (1 << 0x0d) | // carriage return
            (1 << 0x22) | // double quote
            (1 << 0x5c); // backslash

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

    /**
     * @dev The string being parsed contains characters that are not in scope of the given base.
     */
    error StringsInvalidChar();

    /**
     * @dev The string being parsed is not a properly formatted address.
     */
    error StringsInvalidAddressFormat();

    /**
     * @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;
            assembly ("memory-safe") {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                assembly ("memory-safe") {
                    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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
     * representation, according to EIP-55.
     */
    function toChecksumHexString(address addr) internal pure returns (string memory) {
        bytes memory buffer = bytes(toHexString(addr));

        // hash the hex part of buffer (skip length + 2 bytes, length 40)
        uint256 hashValue;
        assembly ("memory-safe") {
            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
        }

        for (uint256 i = 41; i > 1; --i) {
            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
                // case shift by xoring with 0x20
                buffer[i] ^= 0x20;
            }
            hashValue >>= 4;
        }
        return string(buffer);
    }

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

    /**
     * @dev Parse a decimal string and returns the value as a `uint256`.
     *
     * Requirements:
     * - The string must be formatted as `[0-9]*`
     * - The result must fit into an `uint256` type
     */
    function parseUint(string memory input) internal pure returns (uint256) {
        return parseUint(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `[0-9]*`
     * - The result must fit into an `uint256` type
     */
    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
        (bool success, uint256 value) = tryParseUint(input, begin, end);
        if (!success) revert StringsInvalidChar();
        return value;
    }

    /**
     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
     * character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseUint(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, uint256 value) {
        if (end > bytes(input).length || begin > end) return (false, 0);
        return _tryParseUintUncheckedBounds(input, begin, end);
    }

    /**
     * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.
     */
    function _tryParseUintUncheckedBounds(
        string memory input,
        uint256 begin,
        uint256 end
    ) private pure returns (bool success, uint256 value) {
        bytes memory buffer = bytes(input);

        uint256 result = 0;
        for (uint256 i = begin; i < end; ++i) {
            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
            if (chr > 9) return (false, 0);
            result *= 10;
            result += chr;
        }
        return (true, result);
    }

    /**
     * @dev Parse a decimal string and returns the value as a `int256`.
     *
     * Requirements:
     * - The string must be formatted as `[-+]?[0-9]*`
     * - The result must fit in an `int256` type.
     */
    function parseInt(string memory input) internal pure returns (int256) {
        return parseInt(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `[-+]?[0-9]*`
     * - The result must fit in an `int256` type.
     */
    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
        (bool success, int256 value) = tryParseInt(input, begin, end);
        if (!success) revert StringsInvalidChar();
        return value;
    }

    /**
     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
     * the result does not fit in a `int256`.
     *
     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
     */
    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
    }

    uint256 private constant ABS_MIN_INT256 = 2 ** 255;

    /**
     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
     * character or if the result does not fit in a `int256`.
     *
     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
     */
    function tryParseInt(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, int256 value) {
        if (end > bytes(input).length || begin > end) return (false, 0);
        return _tryParseIntUncheckedBounds(input, begin, end);
    }

    /**
     * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that
     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.
     */
    function _tryParseIntUncheckedBounds(
        string memory input,
        uint256 begin,
        uint256 end
    ) private pure returns (bool success, int256 value) {
        bytes memory buffer = bytes(input);

        // Check presence of a negative sign.
        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
        bool positiveSign = sign == bytes1("+");
        bool negativeSign = sign == bytes1("-");
        uint256 offset = (positiveSign || negativeSign).toUint();

        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);

        if (absSuccess && absValue < ABS_MIN_INT256) {
            return (true, negativeSign ? -int256(absValue) : int256(absValue));
        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
            return (true, type(int256).min);
        } else return (false, 0);
    }

    /**
     * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
     *
     * Requirements:
     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`
     * - The result must fit in an `uint256` type.
     */
    function parseHexUint(string memory input) internal pure returns (uint256) {
        return parseHexUint(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
     * - The result must fit in an `uint256` type.
     */
    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
        (bool success, uint256 value) = tryParseHexUint(input, begin, end);
        if (!success) revert StringsInvalidChar();
        return value;
    }

    /**
     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
     * invalid character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseHexUint(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, uint256 value) {
        if (end > bytes(input).length || begin > end) return (false, 0);
        return _tryParseHexUintUncheckedBounds(input, begin, end);
    }

    /**
     * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.
     */
    function _tryParseHexUintUncheckedBounds(
        string memory input,
        uint256 begin,
        uint256 end
    ) private pure returns (bool success, uint256 value) {
        bytes memory buffer = bytes(input);

        // skip 0x prefix if present
        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
        uint256 offset = hasPrefix.toUint() * 2;

        uint256 result = 0;
        for (uint256 i = begin + offset; i < end; ++i) {
            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
            if (chr > 15) return (false, 0);
            result *= 16;
            unchecked {
                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
                // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.
                result += chr;
            }
        }
        return (true, result);
    }

    /**
     * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
     *
     * Requirements:
     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
     */
    function parseAddress(string memory input) internal pure returns (address) {
        return parseAddress(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
     */
    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
        (bool success, address value) = tryParseAddress(input, begin, end);
        if (!success) revert StringsInvalidAddressFormat();
        return value;
    }

    /**
     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
     * formatted address. See {parseAddress-string} requirements.
     */
    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
        return tryParseAddress(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
     * formatted address. See {parseAddress-string-uint256-uint256} requirements.
     */
    function tryParseAddress(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, address value) {
        if (end > bytes(input).length || begin > end) return (false, address(0));

        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;

        // check that input is the correct length
        if (end - begin == expectedLength) {
            // length guarantees that this does not overflow, and value is at most type(uint160).max
            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
            return (s, address(uint160(v)));
        } else {
            return (false, address(0));
        }
    }

    function _tryParseChr(bytes1 chr) private pure returns (uint8) {
        uint8 value = uint8(chr);

        // Try to parse `chr`:
        // - Case 1: [0-9]
        // - Case 2: [a-f]
        // - Case 3: [A-F]
        // - otherwise not supported
        unchecked {
            if (value > 47 && value < 58) value -= 48;
            else if (value > 96 && value < 103) value -= 87;
            else if (value > 64 && value < 71) value -= 55;
            else return type(uint8).max;
        }

        return value;
    }

    /**
     * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.
     *
     * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.
     *
     * NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of
     * RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode
     * characters that are not in this range, but other tooling may provide different results.
     */
    function escapeJSON(string memory input) internal pure returns (string memory) {
        bytes memory buffer = bytes(input);
        bytes memory output = new bytes(2 * buffer.length); // worst case scenario
        uint256 outputLength = 0;

        for (uint256 i; i < buffer.length; ++i) {
            bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));
            if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {
                output[outputLength++] = "\\";
                if (char == 0x08) output[outputLength++] = "b";
                else if (char == 0x09) output[outputLength++] = "t";
                else if (char == 0x0a) output[outputLength++] = "n";
                else if (char == 0x0c) output[outputLength++] = "f";
                else if (char == 0x0d) output[outputLength++] = "r";
                else if (char == 0x5c) output[outputLength++] = "\\";
                else if (char == 0x22) {
                    // solhint-disable-next-line quotes
                    output[outputLength++] = '"';
                }
            } else {
                output[outputLength++] = char;
            }
        }
        // write the actual length and deallocate unused memory
        assembly ("memory-safe") {
            mstore(output, outputLength)
            mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))
        }

        return string(output);
    }

    /**
     * @dev Reads a bytes32 from a bytes array without bounds checking.
     *
     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
     * assembly block as such would prevent some optimizations.
     */
    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
        // This is not memory safe in the general case, but all calls to this private function are within bounds.
        assembly ("memory-safe") {
            value := mload(add(buffer, add(0x20, offset)))
        }
    }
}

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

pragma solidity ^0.8.20;

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

File 12 of 19 : IERC1967.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

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

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

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

pragma solidity ^0.8.20;

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

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @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 Errors.InsufficientBalance(address(this).balance, amount);
        }

        (bool success, bytes memory returndata) = recipient.call{value: amount}("");
        if (!success) {
            _revert(returndata);
        }
    }

    /**
     * @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
     * {Errors.FailedCall} 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 Errors.InsufficientBalance(address(this).balance, value);
        }
        (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 {Errors.FailedCall}) 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 {Errors.FailedCall} 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 {Errors.FailedCall}.
     */
    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
            assembly ("memory-safe") {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.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 ERC-1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
 *     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;
 *     }
 * }
 * ```
 *
 * TIP: Consider using this library along with {SlotDerivation}.
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct Int256Slot {
        int256 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) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

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

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

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

    /**
     * @dev Returns a `Int256Slot` with member `value` located at `slot`.
     */
    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns a `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        assembly ("memory-safe") {
            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) {
        assembly ("memory-safe") {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns a `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        assembly ("memory-safe") {
            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) {
        assembly ("memory-safe") {
            r.slot := store.slot
        }
    }
}

File 15 of 19 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

import {Panic} from "../Panic.sol";
import {SafeCast} from "./SafeCast.sol";

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Return the 512-bit addition of two uint256.
     *
     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.
     */
    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
        assembly ("memory-safe") {
            low := add(a, b)
            high := lt(low, a)
        }
    }

    /**
     * @dev Return the 512-bit multiplication of two uint256.
     *
     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.
     */
    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use
        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
        // variables such that product = high * 2²⁵⁶ + low.
        assembly ("memory-safe") {
            let mm := mulmod(a, b, not(0))
            low := mul(a, b)
            high := sub(sub(mm, low), lt(mm, low))
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            uint256 c = a + b;
            success = c >= a;
            result = c * SafeCast.toUint(success);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            uint256 c = a - b;
            success = c <= a;
            result = c * SafeCast.toUint(success);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            uint256 c = a * b;
            assembly ("memory-safe") {
                // Only true when the multiplication doesn't overflow
                // (c / a == b) || (a == 0)
                success := or(eq(div(c, a), b), iszero(a))
            }
            // equivalent to: success ? c : 0
            result = c * SafeCast.toUint(success);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            success = b > 0;
            assembly ("memory-safe") {
                // The `DIV` opcode returns zero when the denominator is 0.
                result := div(a, b)
            }
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            success = b > 0;
            assembly ("memory-safe") {
                // The `MOD` opcode returns zero when the denominator is 0.
                result := mod(a, b)
            }
        }
    }

    /**
     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.
     */
    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {
        (bool success, uint256 result) = tryAdd(a, b);
        return ternary(success, result, type(uint256).max);
    }

    /**
     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.
     */
    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {
        (, uint256 result) = trySub(a, b);
        return result;
    }

    /**
     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.
     */
    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {
        (bool success, uint256 result) = tryMul(a, b);
        return ternary(success, result, type(uint256).max);
    }

    /**
     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
     *
     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
     * one branch when needed, making this function more expensive.
     */
    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
        unchecked {
            // branchless ternary works because:
            // b ^ (a ^ b) == a
            // b ^ 0 == b
            return b ^ ((a ^ b) * SafeCast.toUint(condition));
        }
    }

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

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return ternary(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.
            Panic.panic(Panic.DIVISION_BY_ZERO);
        }

        // The following calculation ensures accurate ceiling division without overflow.
        // Since a is non-zero, (a - 1) / b will not overflow.
        // The largest possible result occurs when (a - 1) / b is type(uint256).max,
        // but the largest value we can obtain is type(uint256).max - 1, which happens
        // when a = type(uint256).max and b = 1.
        unchecked {
            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
        }
    }

    /**
     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     *
     * 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 {
            (uint256 high, uint256 low) = mul512(x, y);

            // Handle non-overflow cases, 256 by 256 division.
            if (high == 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 low / denominator;
            }

            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.
            if (denominator <= high) {
                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
            }

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

            // Make division exact by subtracting the remainder from [high low].
            uint256 remainder;
            assembly ("memory-safe") {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                high := sub(high, gt(remainder, low))
                low := sub(low, 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 ("memory-safe") {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [high low] by twos.
                low := div(low, twos)

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

            // Shift in bits from high into low.
            low |= high * twos;

            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.
            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⁸
            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
            inverse *= 2 - denominator * inverse; // inverse mod 2³²
            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶

            // 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²⁵⁶. Since the preconditions guarantee that the outcome is
            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high
            // is no longer required.
            result = low * inverse;
            return result;
        }
    }

    /**
     * @dev 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) {
        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
    }

    /**
     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.
     */
    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {
        unchecked {
            (uint256 high, uint256 low) = mul512(x, y);
            if (high >= 1 << n) {
                Panic.panic(Panic.UNDER_OVERFLOW);
            }
            return (high << (256 - n)) | (low >> n);
        }
    }

    /**
     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.
     */
    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {
        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);
    }

    /**
     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
     *
     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
     *
     * If the input value is not inversible, 0 is returned.
     *
     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
     */
    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
        unchecked {
            if (n == 0) return 0;

            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
            // Used to compute integers x and y such that: ax + ny = gcd(a, n).
            // When the gcd is 1, then the inverse of a modulo n exists and it's x.
            // ax + ny = 1
            // ax = 1 + (-y)n
            // ax ≡ 1 (mod n) # x is the inverse of a modulo n

            // If the remainder is 0 the gcd is n right away.
            uint256 remainder = a % n;
            uint256 gcd = n;

            // Therefore the initial coefficients are:
            // ax + ny = gcd(a, n) = n
            // 0a + 1n = n
            int256 x = 0;
            int256 y = 1;

            while (remainder != 0) {
                uint256 quotient = gcd / remainder;

                (gcd, remainder) = (
                    // The old remainder is the next gcd to try.
                    remainder,
                    // Compute the next remainder.
                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
                    // where gcd is at most n (capped to type(uint256).max)
                    gcd - remainder * quotient
                );

                (x, y) = (
                    // Increment the coefficient of a.
                    y,
                    // Decrement the coefficient of n.
                    // Can overflow, but the result is casted to uint256 so that the
                    // next value of y is "wrapped around" to a value between 0 and n - 1.
                    x - y * int256(quotient)
                );
            }

            if (gcd != 1) return 0; // No inverse exists.
            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
        }
    }

    /**
     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
     *
     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.
     *
     * NOTE: this function does NOT check that `p` is a prime greater than `2`.
     */
    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
        unchecked {
            return Math.modExp(a, p - 2, p);
        }
    }

    /**
     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
     *
     * Requirements:
     * - modulus can't be zero
     * - underlying staticcall to precompile must succeed
     *
     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
     * sure the chain you're using it on supports the precompiled contract for modular exponentiation
     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly
     * interpreted as 0.
     */
    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
        (bool success, uint256 result) = tryModExp(b, e, m);
        if (!success) {
            Panic.panic(Panic.DIVISION_BY_ZERO);
        }
        return result;
    }

    /**
     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
     * to operate modulo 0 or if the underlying precompile reverted.
     *
     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
     * of a revert, but the result may be incorrectly interpreted as 0.
     */
    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
        if (m == 0) return (false, 0);
        assembly ("memory-safe") {
            let ptr := mload(0x40)
            // | Offset    | Content    | Content (Hex)                                                      |
            // |-----------|------------|--------------------------------------------------------------------|
            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |
            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |
            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |
            // | 0x60:0x7f | value of b | 0x<.............................................................b> |
            // | 0x80:0x9f | value of e | 0x<.............................................................e> |
            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |
            mstore(ptr, 0x20)
            mstore(add(ptr, 0x20), 0x20)
            mstore(add(ptr, 0x40), 0x20)
            mstore(add(ptr, 0x60), b)
            mstore(add(ptr, 0x80), e)
            mstore(add(ptr, 0xa0), m)

            // Given the result < m, it's guaranteed to fit in 32 bytes,
            // so we can use the memory scratch space located at offset 0.
            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
            result := mload(0x00)
        }
    }

    /**
     * @dev Variant of {modExp} that supports inputs of arbitrary length.
     */
    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
        (bool success, bytes memory result) = tryModExp(b, e, m);
        if (!success) {
            Panic.panic(Panic.DIVISION_BY_ZERO);
        }
        return result;
    }

    /**
     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.
     */
    function tryModExp(
        bytes memory b,
        bytes memory e,
        bytes memory m
    ) internal view returns (bool success, bytes memory result) {
        if (_zeroBytes(m)) return (false, new bytes(0));

        uint256 mLen = m.length;

        // Encode call args in result and move the free memory pointer
        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);

        assembly ("memory-safe") {
            let dataPtr := add(result, 0x20)
            // Write result on top of args to avoid allocating extra memory.
            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
            // Overwrite the length.
            // result.length > returndatasize() is guaranteed because returndatasize() == m.length
            mstore(result, mLen)
            // Set the memory pointer after the returned data.
            mstore(0x40, add(dataPtr, mLen))
        }
    }

    /**
     * @dev Returns whether the provided byte array is zero.
     */
    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
        for (uint256 i = 0; i < byteArray.length; ++i) {
            if (byteArray[i] != 0) {
                return false;
            }
        }
        return true;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only
     * using integer operations.
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        unchecked {
            // Take care of easy edge cases when a == 0 or a == 1
            if (a <= 1) {
                return a;
            }

            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
            // the current value as `ε_n = | x_n - sqrt(a) |`.
            //
            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
            // bigger than any uint256.
            //
            // By noticing that
            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
            // to the msb function.
            uint256 aa = a;
            uint256 xn = 1;

            if (aa >= (1 << 128)) {
                aa >>= 128;
                xn <<= 64;
            }
            if (aa >= (1 << 64)) {
                aa >>= 64;
                xn <<= 32;
            }
            if (aa >= (1 << 32)) {
                aa >>= 32;
                xn <<= 16;
            }
            if (aa >= (1 << 16)) {
                aa >>= 16;
                xn <<= 8;
            }
            if (aa >= (1 << 8)) {
                aa >>= 8;
                xn <<= 4;
            }
            if (aa >= (1 << 4)) {
                aa >>= 4;
                xn <<= 2;
            }
            if (aa >= (1 << 2)) {
                xn <<= 1;
            }

            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
            //
            // We can refine our estimation by noticing that the middle of that interval minimizes the error.
            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
            // This is going to be our x_0 (and ε_0)
            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)

            // From here, Newton's method give us:
            // x_{n+1} = (x_n + a / x_n) / 2
            //
            // One should note that:
            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
            //              = ((x_n² + a) / (2 * x_n))² - a
            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
            //              = (x_n² - a)² / (2 * x_n)²
            //              = ((x_n² - a) / (2 * x_n))²
            //              ≥ 0
            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
            //
            // This gives us the proof of quadratic convergence of the sequence:
            // ε_{n+1} = | x_{n+1} - sqrt(a) |
            //         = | (x_n + a / x_n) / 2 - sqrt(a) |
            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
            //         = | (x_n - sqrt(a))² / (2 * x_n) |
            //         = | ε_n² / (2 * x_n) |
            //         = ε_n² / | (2 * x_n) |
            //
            // For the first iteration, we have a special case where x_0 is known:
            // ε_1 = ε_0² / | (2 * x_0) |
            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))
            //     ≤ 2**(e-3) / 3
            //     ≤ 2**(e-3-log2(3))
            //     ≤ 2**(e-4.5)
            //
            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
            // ε_{n+1} = ε_n² / | (2 * x_n) |
            //         ≤ (2**(e-k))² / (2 * 2**(e-1))
            //         ≤ 2**(2*e-2*k) / 2**e
            //         ≤ 2**(e-2*k)
            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above
            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5
            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9
            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18
            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36
            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72

            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
            // sqrt(a) or sqrt(a) + 1.
            return xn - SafeCast.toUint(xn > a / xn);
        }
    }

    /**
     * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 x) internal pure returns (uint256 r) {
        // If value has upper 128 bits set, log2 result is at least 128
        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
        // If upper 64 bits of 128-bit half set, add 64 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
        // If upper 32 bits of 64-bit half set, add 32 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
        // If upper 16 bits of 32-bit half set, add 16 to result
        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
        // If upper 8 bits of 16-bit half set, add 8 to result
        r |= SafeCast.toUint((x >> r) > 0xff) << 3;
        // If upper 4 bits of 8-bit half set, add 4 to result
        r |= SafeCast.toUint((x >> r) > 0xf) << 2;

        // Shifts value right by the current result and use it as an index into this lookup table:
        //
        // | x (4 bits) |  index  | table[index] = MSB position |
        // |------------|---------|-----------------------------|
        // |    0000    |    0    |        table[0] = 0         |
        // |    0001    |    1    |        table[1] = 0         |
        // |    0010    |    2    |        table[2] = 1         |
        // |    0011    |    3    |        table[3] = 1         |
        // |    0100    |    4    |        table[4] = 2         |
        // |    0101    |    5    |        table[5] = 2         |
        // |    0110    |    6    |        table[6] = 2         |
        // |    0111    |    7    |        table[7] = 2         |
        // |    1000    |    8    |        table[8] = 3         |
        // |    1001    |    9    |        table[9] = 3         |
        // |    1010    |   10    |        table[10] = 3        |
        // |    1011    |   11    |        table[11] = 3        |
        // |    1100    |   12    |        table[12] = 3        |
        // |    1101    |   13    |        table[13] = 3        |
        // |    1110    |   14    |        table[14] = 3        |
        // |    1111    |   15    |        table[15] = 3        |
        //
        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.
        assembly ("memory-safe") {
            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))
        }
    }

    /**
     * @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
        }
    }

    /**
     * @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
        }
    }

    /**
     * @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 x) internal pure returns (uint256 r) {
        // If value has upper 128 bits set, log2 result is at least 128
        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
        // If upper 64 bits of 128-bit half set, add 64 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
        // If upper 32 bits of 64-bit half set, add 32 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
        // If upper 16 bits of 32-bit half set, add 16 to result
        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8
        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);
    }

    /**
     * @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
        }
    }

    /**
     * @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 16 of 19 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.20;

/**
 * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeCast {
    /**
     * @dev Value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);

    /**
     * @dev An int value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedIntToUint(int256 value);

    /**
     * @dev Value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);

    /**
     * @dev An uint value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedUintToInt(uint256 value);

    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        if (value > type(uint248).max) {
            revert SafeCastOverflowedUintDowncast(248, value);
        }
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        if (value > type(uint240).max) {
            revert SafeCastOverflowedUintDowncast(240, value);
        }
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        if (value > type(uint232).max) {
            revert SafeCastOverflowedUintDowncast(232, value);
        }
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        if (value > type(uint224).max) {
            revert SafeCastOverflowedUintDowncast(224, value);
        }
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        if (value > type(uint216).max) {
            revert SafeCastOverflowedUintDowncast(216, value);
        }
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        if (value > type(uint208).max) {
            revert SafeCastOverflowedUintDowncast(208, value);
        }
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        if (value > type(uint200).max) {
            revert SafeCastOverflowedUintDowncast(200, value);
        }
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        if (value > type(uint192).max) {
            revert SafeCastOverflowedUintDowncast(192, value);
        }
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        if (value > type(uint184).max) {
            revert SafeCastOverflowedUintDowncast(184, value);
        }
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        if (value > type(uint176).max) {
            revert SafeCastOverflowedUintDowncast(176, value);
        }
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        if (value > type(uint168).max) {
            revert SafeCastOverflowedUintDowncast(168, value);
        }
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        if (value > type(uint160).max) {
            revert SafeCastOverflowedUintDowncast(160, value);
        }
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        if (value > type(uint152).max) {
            revert SafeCastOverflowedUintDowncast(152, value);
        }
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        if (value > type(uint144).max) {
            revert SafeCastOverflowedUintDowncast(144, value);
        }
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        if (value > type(uint136).max) {
            revert SafeCastOverflowedUintDowncast(136, value);
        }
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        if (value > type(uint128).max) {
            revert SafeCastOverflowedUintDowncast(128, value);
        }
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        if (value > type(uint120).max) {
            revert SafeCastOverflowedUintDowncast(120, value);
        }
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        if (value > type(uint112).max) {
            revert SafeCastOverflowedUintDowncast(112, value);
        }
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        if (value > type(uint104).max) {
            revert SafeCastOverflowedUintDowncast(104, value);
        }
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        if (value > type(uint96).max) {
            revert SafeCastOverflowedUintDowncast(96, value);
        }
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        if (value > type(uint88).max) {
            revert SafeCastOverflowedUintDowncast(88, value);
        }
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        if (value > type(uint80).max) {
            revert SafeCastOverflowedUintDowncast(80, value);
        }
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert SafeCastOverflowedUintDowncast(72, value);
        }
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        if (value > type(uint64).max) {
            revert SafeCastOverflowedUintDowncast(64, value);
        }
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        if (value > type(uint56).max) {
            revert SafeCastOverflowedUintDowncast(56, value);
        }
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        if (value > type(uint48).max) {
            revert SafeCastOverflowedUintDowncast(48, value);
        }
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        if (value > type(uint40).max) {
            revert SafeCastOverflowedUintDowncast(40, value);
        }
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        if (value > type(uint32).max) {
            revert SafeCastOverflowedUintDowncast(32, value);
        }
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        if (value > type(uint24).max) {
            revert SafeCastOverflowedUintDowncast(24, value);
        }
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        if (value > type(uint16).max) {
            revert SafeCastOverflowedUintDowncast(16, value);
        }
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        if (value > type(uint8).max) {
            revert SafeCastOverflowedUintDowncast(8, value);
        }
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        if (value < 0) {
            revert SafeCastOverflowedIntToUint(value);
        }
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(248, value);
        }
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(240, value);
        }
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(232, value);
        }
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(224, value);
        }
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(216, value);
        }
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(208, value);
        }
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(200, value);
        }
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(192, value);
        }
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(184, value);
        }
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(176, value);
        }
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(168, value);
        }
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(160, value);
        }
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(152, value);
        }
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(144, value);
        }
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(136, value);
        }
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(128, value);
        }
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(120, value);
        }
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(112, value);
        }
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(104, value);
        }
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(96, value);
        }
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(88, value);
        }
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(80, value);
        }
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(72, value);
        }
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(64, value);
        }
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(56, value);
        }
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(48, value);
        }
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(40, value);
        }
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(32, value);
        }
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(24, value);
        }
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(16, value);
        }
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(8, value);
        }
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        if (value > uint256(type(int256).max)) {
            revert SafeCastOverflowedUintToInt(value);
        }
        return int256(value);
    }

    /**
     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
     */
    function toUint(bool b) internal pure returns (uint256 u) {
        assembly ("memory-safe") {
            u := iszero(iszero(b))
        }
    }
}

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

pragma solidity ^0.8.20;

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

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
     *
     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
     * one branch when needed, making this function more expensive.
     */
    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
        unchecked {
            // branchless ternary works because:
            // b ^ (a ^ b) == a
            // b ^ 0 == b
            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
        }
    }

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

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return ternary(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 {
            // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
            // taking advantage of the most significant (or "sign" bit) in two's complement representation.
            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
            int256 mask = n >> 255;

            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
            return uint256((n + mask) ^ mask);
        }
    }
}

File 18 of 19 : Errors.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

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

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();

    /**
     * @dev A necessary precompile is missing.
     */
    error MissingPrecompile(address);
}

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

pragma solidity ^0.8.20;

/**
 * @dev Helper library for emitting standardized panic codes.
 *
 * ```solidity
 * contract Example {
 *      using Panic for uint256;
 *
 *      // Use any of the declared internal constants
 *      function foo() { Panic.GENERIC.panic(); }
 *
 *      // Alternatively
 *      function foo() { Panic.panic(Panic.GENERIC); }
 * }
 * ```
 *
 * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
 *
 * _Available since v5.1._
 */
// slither-disable-next-line unused-state
library Panic {
    /// @dev generic / unspecified error
    uint256 internal constant GENERIC = 0x00;
    /// @dev used by the assert() builtin
    uint256 internal constant ASSERT = 0x01;
    /// @dev arithmetic underflow or overflow
    uint256 internal constant UNDER_OVERFLOW = 0x11;
    /// @dev division or modulo by zero
    uint256 internal constant DIVISION_BY_ZERO = 0x12;
    /// @dev enum conversion error
    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
    /// @dev invalid encoding in storage
    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
    /// @dev empty array pop
    uint256 internal constant EMPTY_ARRAY_POP = 0x31;
    /// @dev array out of bounds access
    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
    /// @dev resource error (too large allocation or too large array)
    uint256 internal constant RESOURCE_ERROR = 0x41;
    /// @dev calling invalid internal function
    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;

    /// @dev Reverts with a panic code. Recommended to use with
    /// the internal constants with predefined codes.
    function panic(uint256 code) internal pure {
        assembly ("memory-safe") {
            mstore(0x00, 0x4e487b71)
            mstore(0x20, code)
            revert(0x1c, 0x24)
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","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":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"FeedIdMismatch","type":"error"},{"inputs":[],"name":"InsufficientSignatures","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OracleAlreadyTrusted","type":"error"},{"inputs":[],"name":"OracleNotFound","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"RoundExceedsUint80Limit","type":"error"},{"inputs":[],"name":"RoundNotAvailable","type":"error"},{"inputs":[],"name":"SignerNotTrusted","type":"error"},{"inputs":[],"name":"TimestampNotNewer","type":"error"},{"inputs":[],"name":"TimestampTooFar","type":"error"},{"inputs":[],"name":"TimestampTooOld","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint80","name":"roundId","type":"uint80"},{"indexed":false,"internalType":"int256","name":"price","type":"int256"},{"indexed":false,"internalType":"uint256","name":"reportRoundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"address","name":"transmitter","type":"address"},{"indexed":false,"internalType":"uint256","name":"numSignatures","type":"uint256"}],"name":"NewPriceUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oracle","type":"address"}],"name":"OracleAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oracle","type":"address"}],"name":"OracleRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oracle","type":"address"}],"name":"addOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deprecated_trustedSender","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feedId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint80","name":"round","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"int256","name":"price","type":"int256"},{"internalType":"uint256","name":"reportRoundId","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address[]","name":"_oracles","type":"address[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_feedId","type":"string"}],"name":"initializeV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oracles","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"report","type":"bytes"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"postUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oracle","type":"address"}],"name":"removeOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requiredSignatures","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"","type":"uint80"}],"name":"rounds","outputs":[{"internalType":"int256","name":"price","type":"int256"},{"internalType":"uint256","name":"reportRoundId","type":"uint256"},{"internalType":"uint256","name":"observedTs","type":"uint256"},{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"uint256","name":"postedTs","type":"uint256"},{"internalType":"uint8","name":"numSignatures","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_decimals","type":"uint8"}],"name":"setDecimals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_feedId","type":"string"}],"name":"setFeedId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"trustedOracles","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

60a06040523461003e5761001161004d565b610019610043565b613c336102c88239608051818181613145015281816131aa01526133580152613c3390f35b610049565b60405190565b5f80fd5b6100556100a1565b61005d61019e565b565b60018060a01b031690565b90565b61008161007c6100869261005f565b61006a565b61005f565b90565b6100929061006d565b90565b61009e90610089565b90565b6100aa30610095565b608052565b60401c90565b60ff1690565b6100c76100cc916100af565b6100b5565b90565b6100d990546100bb565b90565b5f0190565b5f1c90565b60018060401b031690565b6100fd610102916100e1565b6100e6565b90565b61010f90546100f1565b90565b60018060401b031690565b5f1b90565b9061013360018060401b039161011d565b9181191691161790565b61015161014c61015692610112565b61006a565b610112565b90565b90565b9061017161016c6101789261013d565b610159565b8254610122565b9055565b61018590610112565b9052565b919061019c905f6020850194019061017c565b565b6101a6610256565b6101b15f82016100cf565b61023a576101c05f8201610105565b6101d86101d260018060401b03610112565b91610112565b036101e1575b50565b6101f4905f60018060401b03910161015c565b60018060401b036102317fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d291610228610043565b91829182610189565b0390a15f6101de565b5f63f92ee8a960e01b815280610252600482016100dc565b0390fd5b61025e6102b3565b90565b5f90565b90565b90565b61027f61027a61028492610265565b61011d565b610268565b90565b6102b07ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0061026b565b90565b6102bb610261565b506102c4610287565b9056fe60806040526004361015610013575b61147f565b61001d5f356101fc565b80630a1028c4146101f75780632ede662f146101f2578063313ce567146101ed57806349a1a4fb146101e85780634a643499146101e35780634e08ff5f146101de5780634f1ef286146101d957806350d25bcd146101d457806352d1902d146101cf5780635b69a7d8146101ca5780635d24004f146101c5578063668a0f02146101c05780636c3ff133146101bb578063715018a6146101b65780637284e416146101b15780637a1395aa146101ac5780638205bf6a146101a75780638d068043146101a25780638da5cb5b1461019d57806390c3f38f146101985780639a6fc8f514610193578063ad3cb1cc1461018e578063b5ab58dc14610189578063b633620c14610184578063d608ea641461017f578063db2966021461017a578063df5dd1a514610175578063f2fde38b14610170578063fdc85fc41461016b5763feaf968c0361000e57611446565b6113b9565b611386565b611353565b61131e565b611217565b6111e2565b6111ad565b611178565b6110c7565b611056565b611021565b610fec565b610fb7565b610f84565b610f31565b610eef565b610ebc565b610e52565b610e08565b610dc4565b610c7d565b610c48565b610c09565b610b8d565b610971565b610797565b610569565b6104d1565b6102ba565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b909182601f8301121561025a5781359167ffffffffffffffff831161025557602001926001830284011161025057565b61021c565b610218565b610214565b90602082820312610290575f82013567ffffffffffffffff811161028b576102879201610220565b9091565b610210565b61020c565b90565b6102a190610295565b9052565b91906102b8905f60208501940190610298565b565b346102eb576102e76102d66102d036600461025f565b9061149f565b6102de610202565b918291826102a5565b0390f35b610208565b69ffffffffffffffffffff1690565b610308816102f0565b0361030f57565b5f80fd5b90503590610320826102ff565b565b9060208282031261033b57610338915f01610313565b90565b61020c565b90565b61035761035261035c926102f0565b610340565b6102f0565b90565b9061036990610343565b5f5260205260405f2090565b5f1c90565b90565b61038961038e91610375565b61037a565b90565b61039b905461037d565b90565b90565b6103ad6103b291610375565b61039e565b90565b6103bf90546103a1565b90565b60ff1690565b6103d46103d991610375565b6103c2565b90565b6103e690546103c8565b90565b6103f490600361035f565b906104005f8301610391565b9161040d600182016103b5565b9161041a600283016103b5565b91610427600382016103b5565b916104406005610439600485016103b5565b93016103dc565b90565b90565b61044f90610443565b9052565b90565b61045f90610453565b9052565b60ff1690565b61047290610463565b9052565b91946104be6104c8929897956104b460a0966104aa6104cf9a6104a060c08a019e5f8b0190610446565b6020890190610456565b6040870190610456565b6060850190610456565b6080830190610456565b0190610469565b565b34610508576105046104ec6104e7366004610322565b6103e9565b926104fb969496929192610202565b96879687610476565b0390f35b610208565b5f91031261051757565b61020c565b1c90565b610530906008610535930261051c565b6103c2565b90565b906105439154610520565b90565b6105515f5f90610538565b90565b9190610567905f60208501940190610469565b565b346105995761057936600461050d565b610595610584610546565b61058c610202565b91829182610554565b0390f35b610208565b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906105ca906105a2565b810190811067ffffffffffffffff8211176105e457604052565b6105ac565b906105fc6105f5610202565b92836105c0565b565b67ffffffffffffffff811161061c576106186020916105a2565b0190565b6105ac565b90825f939282370152565b9092919261064161063c826105fe565b6105e9565b9381855260208501908284011161065d5761065b92610621565b565b61059e565b9080601f830112156106805781602061067d9335910161062c565b90565b610214565b67ffffffffffffffff811161069d5760208091020190565b6105ac565b9291906106b66106b182610685565b6105e9565b938185526020808601920281019183831161070d5781905b8382106106dc575050505050565b813567ffffffffffffffff8111610708576020916106fd8784938701610662565b8152019101906106ce565b610214565b61021c565b9080601f830112156107305781602061072d933591016106a2565b90565b610214565b91909160408184031261078d575f81013567ffffffffffffffff81116107885783610761918301610662565b92602082013567ffffffffffffffff8111610783576107809201610712565b90565b610210565b610210565b61020c565b5f0190565b346107c6576107b06107aa366004610735565b906119e0565b6107b8610202565b806107c281610792565b0390f35b610208565b634e487b7160e01b5f525f60045260245ffd5b634e487b7160e01b5f52602260045260245ffd5b9060016002830492168015610812575b602083101461080d57565b6107de565b91607f1691610802565b60209181520190565b5f5260205f2090565b905f9291805490610848610841836107f2565b809461081c565b916001811690815f1461089f5750600114610863575b505050565b6108709192939450610825565b915f925b81841061088757505001905f808061085e565b60018160209295939554848601520191019290610874565b92949550505060ff19168252151560200201905f808061085e565b906108c49161082e565b90565b906108e76108e0926108d7610202565b938480926108ba565b03836105c0565b565b905f106108fc576108f9906108c7565b90565b6107cb565b61090d60075f906108e9565b90565b5190565b60209181520190565b90825f9392825e0152565b6109476109506020936109559361093e81610910565b93848093610914565b9586910161091d565b6105a2565b0190565b61096e9160208201915f818403910152610928565b90565b346109a15761098136600461050d565b61099d61098c610901565b610994610202565b91829182610959565b0390f35b610208565b6109af81610463565b036109b657565b5f80fd5b905035906109c7826109a6565b565b67ffffffffffffffff81116109e7576109e36020916105a2565b0190565b6105ac565b90929192610a016109fc826109c9565b6105e9565b93818552602085019082840111610a1d57610a1b92610621565b565b61059e565b9080601f83011215610a4057816020610a3d933591016109ec565b90565b610214565b60018060a01b031690565b610a5990610a45565b90565b610a6581610a50565b03610a6c57565b5f80fd5b90503590610a7d82610a5c565b565b67ffffffffffffffff8111610a975760208091020190565b6105ac565b90929192610ab1610aac82610a7f565b6105e9565b9381855260208086019202830192818411610aee57915b838310610ad55750505050565b60208091610ae38486610a70565b815201920191610ac8565b61021c565b9080601f83011215610b1157816020610b0e93359101610a9c565b90565b610214565b90608082820312610b8857610b2d815f84016109ba565b92602083013567ffffffffffffffff8111610b835782610b4e918501610a22565b92610b5c8360408301610a70565b92606082013567ffffffffffffffff8111610b7e57610b7b9201610af3565b90565b610210565b610210565b61020c565b34610bbf57610ba9610ba0366004610b16565b9291909161247b565b610bb1610202565b80610bbb81610792565b0390f35b610208565b919091604081840312610c0457610bdd835f8301610a70565b92602082013567ffffffffffffffff8111610bff57610bfc9201610662565b90565b610210565b61020c565b610c1d610c17366004610bc4565b906124b2565b610c25610202565b80610c2f81610792565b0390f35b9190610c46905f60208501940190610446565b565b34610c7857610c5836600461050d565b610c74610c636124c2565b610c6b610202565b91829182610c33565b0390f35b610208565b34610cad57610c8d36600461050d565b610ca9610c98612558565b610ca0610202565b918291826102a5565b0390f35b610208565b610cbb81610453565b03610cc257565b5f80fd5b90503590610cd382610cb2565b565b90602082820312610cee57610ceb915f01610cc6565b90565b61020c565b634e487b7160e01b5f52603260045260245ffd5b5490565b5f5260205f2090565b5f5260205f2090565b610d2681610d07565b821015610d4057610d38600191610d0b565b910201905f90565b610cf3565b60018060a01b031690565b610d60906008610d65930261051c565b610d45565b90565b90610d739154610d50565b90565b6005610d8181610d07565b821015610d9e57610d9b91610d9591610d1d565b90610d68565b90565b5f80fd5b610dab90610a50565b9052565b9190610dc2905f60208501940190610da2565b565b34610df457610df0610ddf610dda366004610cd5565b610d76565b610de7610202565b91829182610daf565b0390f35b610208565b610e0560065f90610d68565b90565b34610e3857610e1836600461050d565b610e34610e23610df9565b610e2b610202565b91829182610daf565b0390f35b610208565b9190610e50905f60208501940190610456565b565b34610e8257610e6236600461050d565b610e7e610e6d612587565b610e75610202565b91829182610e3d565b0390f35b610208565b90602082820312610eb7575f82013567ffffffffffffffff8111610eb257610eaf9201610a22565b90565b610210565b61020c565b34610eea57610ed4610ecf366004610e87565b6125c5565b610edc610202565b80610ee681610792565b0390f35b610208565b34610f1d57610eff36600461050d565b610f0761261d565b610f0f610202565b80610f1981610792565b0390f35b610208565b610f2e60015f906108e9565b90565b34610f6157610f4136600461050d565b610f5d610f4c610f22565b610f54610202565b91829182610959565b0390f35b610208565b90602082820312610f7f57610f7c915f016109ba565b90565b61020c565b34610fb257610f9c610f97366004610f66565b612646565b610fa4610202565b80610fae81610792565b0390f35b610208565b34610fe757610fc736600461050d565b610fe3610fd2612651565b610fda610202565b91829182610e3d565b0390f35b610208565b3461101c57610ffc36600461050d565b611018611007612742565b61100f610202565b91829182610e3d565b0390f35b610208565b346110515761103136600461050d565b61104d61103c6127e1565b611044610202565b91829182610daf565b0390f35b610208565b346110845761106e611069366004610e87565b61281f565b611076610202565b8061108081610792565b0390f35b610208565b6110be6110c5946110b46060949897956110aa608086019a5f870190610446565b6020850190610456565b6040830190610456565b0190610456565b565b346110fb576110f76110e26110dd366004610322565b61282d565b906110ee949294610202565b94859485611089565b0390f35b610208565b9061111261110d836109c9565b6105e9565b918252565b5f7f352e302e30000000000000000000000000000000000000000000000000000000910152565b6111486005611100565b9061115560208301611117565b565b61115f61113e565b90565b61116a611157565b90565b611175611162565b90565b346111a85761118836600461050d565b6111a461119361116d565b61119b610202565b91829182610959565b0390f35b610208565b346111dd576111d96111c86111c3366004610cd5565b612915565b6111d0610202565b91829182610c33565b0390f35b610208565b346112125761120e6111fd6111f8366004610cd5565b61299e565b611205610202565b91829182610e3d565b0390f35b610208565b346112455761122f61122a366004610e87565b612b59565b611237610202565b8061124181610792565b0390f35b610208565b9060208282031261126357611260915f01610a70565b90565b61020c565b61127c61127761128192610a45565b610340565b610a45565b90565b61128d90611268565b90565b61129990611284565b90565b906112a690611290565b5f5260205260405f2090565b60ff1690565b6112c89060086112cd930261051c565b6112b2565b90565b906112db91546112b8565b90565b6112f4906112ef6004915f9261129c565b6112d0565b90565b151590565b611305906112f7565b9052565b919061131c905f602085019401906112fc565b565b3461134e5761134a61133961133436600461124a565b6112de565b611341610202565b91829182611309565b0390f35b610208565b346113815761136b61136636600461124a565b612c16565b611373610202565b8061137d81610792565b0390f35b610208565b346113b45761139e61139936600461124a565b612c86565b6113a6610202565b806113b081610792565b0390f35b610208565b346113e7576113d16113cc36600461124a565b612e54565b6113d9610202565b806113e381610792565b0390f35b610208565b6113f5906102f0565b9052565b909594926114449461143361143d9261142960809661141f60a088019c5f8901906113ec565b6020870190610446565b6040850190610456565b6060830190610456565b01906113ec565b565b3461147a5761145636600461050d565b611476611461612e63565b9161146d959395610202565b958695866113f9565b0390f35b610208565b5f80fd5b5f90565b61149291369161062c565b90565b60200190565b5190565b906114b2916114ac611483565b50611487565b6114c46114be8261149b565b91611495565b2090565b6114d181610295565b036114d857565b5f80fd5b905051906114e9826114c8565b565b6114f481610443565b036114fb57565b5f80fd5b9050519061150c826114eb565b565b9050519061151b82610cb2565b565b60808183031261155e57611533825f83016114dc565b9261155b61154484602085016114ff565b93611552816040860161150e565b9360600161150e565b90565b61020c565b90565b60209181520190565b905f9291805490611589611582836107f2565b8094611566565b916001811690815f146115e057506001146115a4575b505050565b6115b19192939450610d14565b915f925b8184106115c857505001905f808061159f565b600181602092959395548486015201910192906115b5565b92949550505060ff19168252151560200201905f808061159f565b906116059161156f565b90565b9061162861162192611618610202565b938480926115fb565b03836105c0565b565b61163390611608565b90565b69ffffffffffffffffffff1690565b61165161165691610375565b611636565b90565b6116639054611645565b90565b90565b61167d61167861168292611666565b610340565b610453565b90565b634e487b7160e01b5f52601160045260245ffd5b6116a86116ae91939293610453565b92610453565b82018092116116b957565b611685565b90565b6116d56116d06116da926116be565b610340565b610453565b90565b90565b6116f46116ef6116f9926116dd565b610340565b610453565b90565b61170b61171191939293610453565b92610453565b820391821161171c57565b611685565b61172a906102f0565b69ffffffffffffffffffff81146117415760010190565b611685565b5f1b90565b9061176069ffffffffffffffffffff91611746565b9181191691161790565b90565b9061178261177d61178992610343565b61176a565b825461174b565b9055565b6117a161179c6117a692610453565b610340565b610463565b90565b6117b360c06105e9565b90565b906117c090610443565b9052565b906117ce90610453565b9052565b906117dc90610463565b9052565b6117ea9051610443565b90565b906117f95f1991611746565b9181191691161790565b61181761181261181c92610443565b610340565b610443565b90565b90565b9061183761183261183e92611803565b61181f565b82546117ed565b9055565b61184c9051610453565b90565b61186361185e61186892610453565b610340565b610453565b90565b90565b9061188361187e61188a9261184f565b61186b565b82546117ed565b9055565b6118989051610463565b90565b906118a760ff91611746565b9181191691161790565b6118c56118c06118ca92610463565b610340565b610463565b90565b90565b906118e56118e06118ec926118b1565b6118cd565b825461189b565b9055565b9061197f60a06005611985946119135f820161190d5f88016117e0565b90611822565b61192c6001820161192660208801611842565b9061186e565b6119456002820161193f60408801611842565b9061186e565b61195e6003820161195860608801611842565b9061186e565b6119776004820161197160808801611842565b9061186e565b01920161188e565b906118d0565b565b90611991916118f0565b565b909594926119de946119cd6119d7926119c36080966119b960a088019c5f890190610446565b6020870190610456565b6040850190610456565b6060830190610da2565b0190610456565b565b906119fb8260206119f08261149b565b81830101910161151d565b94919293909392939492611a3b611a35611a1d611a186007611563565b61162a565b611a2f611a298261149b565b91611495565b20610295565b91610295565b03611cdb5782611a71611a6b611a666002611a606003611a5a83611659565b9061035f565b016103b5565b610453565b91610453565b1115611cbf5782611a9e611a98611a9342611a8d61012c611669565b90611699565b610453565b91610453565b11611ca35742611ab8611ab2610e106116c1565b91610453565b115f14611c9557611ad442611ace610e106116c1565b906116fc565b5b611ae8611ae28592610453565b91610453565b10611c7957611b0991611b03611afd8261149b565b91611495565b20612f70565b9283611b24611b1e611b19612742565b610453565b91610453565b10611c5d57611b336002611659565b611b4f611b4969ffffffffffffffffffff6102f0565b916102f0565b14611c4157611b70611b69611b646002611659565b611721565b600261176d565b611bee83611bd483611bcb88611bc288611bb94391611bb0611b92429661178d565b97611ba7611b9e6117a9565b9b5f8d016117b6565b60208b016117c4565b604089016117c4565b606087016117c4565b608085016117c4565b60a083016117d2565b611be96003611be36002611659565b9061035f565b611987565b611c3c611bfb6002611659565b9391929433611c2a7f0b62719df03f34f9cd4469266344b26b09b76d94a1c2cc1a6a0f0d460cc8b7d196610343565b96611c33610202565b95869586611993565b0390a2565b5f630cf2795360e41b815280611c5960048201610792565b0390fd5b5f633724e34360e11b815280611c7560048201610792565b0390fd5b5f63d40fc74b60e01b815280611c9160048201610792565b0390fd5b611c9e5f6116e0565b611ad5565b5f63364b8df560e11b815280611cbb60048201610792565b0390fd5b5f63f0022dfb60e01b815280611cd760048201610792565b0390fd5b5f63c2a25c1b60e01b815280611cf360048201610792565b0390fd5b60401c90565b611d09611d0e91611cf7565b6112b2565b90565b611d1b9054611cfd565b90565b67ffffffffffffffff1690565b611d37611d3c91610375565b611d1e565b90565b611d499054611d2b565b90565b67ffffffffffffffff1690565b611d6d611d68611d72926116dd565b610340565b611d4c565b90565b90565b611d8c611d87611d9192611d75565b610340565b611d4c565b90565b611d9d90611284565b90565b90611db367ffffffffffffffff91611746565b9181191691161790565b611dd1611dcc611dd692611d4c565b610340565b611d4c565b90565b90565b90611df1611dec611df892611dbd565b611dd9565b8254611da0565b9055565b60401b90565b90611e1668ff000000000000000091611dfc565b9181191691161790565b611e29906112f7565b90565b90565b90611e44611e3f611e4b92611e20565b611e2c565b8254611e02565b9055565b611e5890611d78565b9052565b9190611e6f905f60208501940190611e4f565b565b909192611e7c6130e0565b93611e91611e8b5f8701611d11565b156112f7565b93611e9d5f8701611d3f565b80611eb0611eaa5f611d59565b91611d4c565b1480611fca575b90611ecb611ec56001611d78565b91611d4c565b1480611fa2575b611edd9091156112f7565b9081611f91575b50611f7557611f0d93611f02611efa6001611d78565b5f8901611ddc565b85611f63575b61238c565b611f15575b50565b611f22905f809101611e2f565b6001611f5a7fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d291611f51610202565b91829182611e5c565b0390a15f611f12565b611f7060015f8901611e2f565b611f08565b5f63f92ee8a960e01b815280611f8d60048201610792565b0390fd5b611f9c9150156112f7565b5f611ee4565b50611edd611faf30611d94565b3b611fc2611fbc5f6116e0565b91610453565b149050611ed2565b5085611eb7565b601f602091010490565b1b90565b91906008611ffa910291611ff45f1984611fdb565b92611fdb565b9181191691161790565b919061201a6120156120229361184f565b61186b565b908354611fdf565b9055565b5f90565b61203c91612036612026565b91612004565b565b5b81811061204a575050565b806120575f60019361202a565b0161203f565b9190601f811161206d575b505050565b61207961209e93610825565b90602061208584611fd1565b830193106120a6575b61209790611fd1565b019061203e565b5f8080612068565b91506120978192905061208e565b906120c4905f199060080261051c565b191690565b816120d3916120b4565b906002021790565b906120e581610910565b9067ffffffffffffffff82116121a5576121098261210385546107f2565b8561205d565b602090601f831160011461213d5791809161212c935f92612131575b50506120c9565b90555b565b90915001515f80612125565b601f1983169161214c85610825565b925f5b81811061218d57509160029391856001969410612173575b5050500201905561212f565b612183910151601f8416906120b4565b90555f8080612167565b9193602060018192878701518155019501920161214f565b6105ac565b906121b4916120db565b565b9190601f81116121c6575b505050565b6121d26121f793610d14565b9060206121de84611fd1565b830193106121ff575b6121f090611fd1565b019061203e565b5f80806121c1565b91506121f0819290506121e7565b6122215f61221b83546107f2565b836121b6565b5f80019055565b6122319061220d565b565b61224761224261224c926116dd565b610340565b6102f0565b90565b600161225b9101610453565b90565b5190565b9061226c8261225e565b81101561227d576020809102010190565b610cf3565b61228c9051610a50565b90565b61229b6122a091610375565b6112b2565b90565b6122ad905461228f565b90565b906122c56122c06122cc92611e20565b611e2c565b825461189b565b9055565b90565b5f5260205f2090565b5490565b6122e9816122dc565b821015612303576122fb6001916122d3565b910201905f90565b610cf3565b9190600861232891029161232260018060a01b0384611fdb565b92611fdb565b9181191691161790565b90565b919061234b61234661235393611290565b612332565b908354612308565b9055565b9081549168010000000000000000831015612387578261237f916001612385950181556122e0565b90612335565b565b6105ac565b6123aa9061239c6123b194613109565b6123a461311e565b5f6118d0565b60016121aa565b6123bb6007612228565b6123ce6123c75f612233565b600261176d565b6123d75f6116e0565b5b806123f36123ed6123e88561225e565b610453565b91610453565b10156124775761240c612407838390612262565b612282565b9061242161241c6004849061129c565b6122a3565b61245b5761245161245692612442600161243d6004849061129c565b6122b0565b61244c60056122d0565b612357565b61224f565b6123d8565b5f636586df7960e01b81528061247360048201610792565b0390fd5b5050565b90612487939291611e71565b565b9061249b91612496613134565b61249d565b565b906124b0916124ab816131e6565b613249565b565b906124bc91612489565b565b5f90565b6124ca6124be565b506124ea5f6124e460036124de6002611659565b9061035f565b01610391565b90565b6124fe906124f9613347565b61254c565b90565b90565b61251861251361251d92612501565b611746565b610295565b90565b6125497f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc612504565b90565b50612555612520565b90565b612568612563611483565b6124ed565b90565b61257f61257a612584926102f0565b610340565b610453565b90565b61258f612026565b506125a261259d6002611659565b61256b565b90565b6125b6906125b16133a5565b6125b8565b565b6125c39060076121aa565b565b6125ce906125a5565b565b6125d86133a5565b6125e061260a565b565b6125f66125f16125fb926116dd565b610340565b610a45565b90565b612607906125e2565b90565b61261b6126165f6125fe565b61342e565b565b6126256125d0565b565b612638906126336133a5565b61263a565b565b612644905f6118d0565b565b61264f90612627565b565b612659612026565b5061267a6004612674600361266e6002611659565b9061035f565b016103b5565b90565b90565b61269461268f6126999261267d565b610340565b610453565b90565b6126ab6126b191939293610453565b92610453565b916126bd838202610453565b9281840414901517156126cc57565b611685565b90565b6126e86126e36126ed926126d1565b610340565b610453565b90565b634e487b7160e01b5f52601260045260245ffd5b61271061271691610453565b91610453565b908115612721570490565b6126f0565b61273a61273561273f92611d75565b610340565b610453565b90565b61274a612026565b5061278e61277e61276e61275e6005610d07565b6127686002612680565b9061269c565b6127786002612680565b90611699565b61278860036126d4565b90612704565b806127a161279b5f6116e0565b91610453565b115f146127ac575b90565b506127b76001612726565b6127a9565b5f90565b6127cc6127d191610375565b610d45565b90565b6127de90546127c0565b90565b6127e96127bc565b506127fc5f6127f661349a565b016127d4565b90565b6128109061280b6133a5565b612812565b565b61281d9060016121aa565b565b612828906127ff565b565b90565b6128356124be565b5061283e612026565b50612847612026565b50612850612026565b508061286461285e5f612233565b916102f0565b1480156128d6575b6128ba5761287e61288391600361035f565b61282a565b61288e5f8201610391565b61289a600183016103b5565b926128b360036128ac600286016103b5565b94016103b5565b9193929190565b5f633a800deb60e01b8152806128d260048201610792565b0390fd5b50806128f36128ed6128e86002611659565b6102f0565b916102f0565b1161286c565b61290d61290861291292610453565b610340565b6102f0565b90565b61291d6124be565b508061293161292b5f6116e0565b91610453565b14801561297b575b61295f575f61295661295c926129506003916128f9565b9061035f565b01610391565b90565b5f633a800deb60e01b81528061297760048201610792565b0390fd5b508061299861299261298d6002611659565b61256b565b91610453565b11612939565b6129a6612026565b50806129ba6129b45f6116e0565b91610453565b148015612a05575b6129e95760046129e06129e6926129da6003916128f9565b9061035f565b016103b5565b90565b5f633a800deb60e01b815280612a0160048201610792565b0390fd5b5080612a22612a1c612a176002611659565b61256b565b91610453565b116129c2565b612a3c612a37612a419261267d565b610340565b611d4c565b90565b612a4d90611d4c565b9052565b9190612a64905f60208501940190612a44565b565b612a706002612a28565b90612a796130e0565b612a845f8201611d11565b8015612b14575b612af857612ab4612abd92612aa2855f8501611ddc565b612aaf60015f8501611e2f565b612b39565b5f809101611e2f565b612af37fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d291612aea610202565b91829182612a51565b0390a1565b5f63f92ee8a960e01b815280612b1060048201610792565b0390fd5b50612b205f8201611d3f565b612b32612b2c85611d4c565b91611d4c565b1015612a8b565b612b4a90612b456133a5565b612b4c565b565b612b579060076121aa565b565b612b6290612a66565b565b612b7590612b706133a5565b612b77565b565b612b8b612b866004839061129c565b6122a3565b612bfa57612ba56001612ba06004849061129c565b6122b0565b612bb9612bb260056122d0565b8290612357565b612be27e47706786c922d17b39285dc59d696bafea72c0b003d3841ae1202076f4c2e491611290565b90612beb610202565b80612bf581610792565b0390a2565b5f636586df7960e01b815280612c1260048201610792565b0390fd5b612c1f90612b64565b565b612c3290612c2d6133a5565b612c34565b565b80612c4f612c49612c445f6125fe565b610a50565b91610a50565b14612c5f57612c5d9061342e565b565b612c82612c6b5f6125fe565b5f918291631e4fbdf760e01b835260048301610daf565b0390fd5b612c8f90612c21565b565b612ca290612c9d6133a5565b612cfb565b565b634e487b7160e01b5f52603160045260245ffd5b612cca91612cc46127bc565b91612335565b565b612cd5816122dc565b8015612cf6576001900390612cf3612ced83836122e0565b90612cb8565b55565b612ca4565b612d18612d12612d0d6004849061129c565b6122a3565b156112f7565b612e3857612d315f612d2c6004849061129c565b6122b0565b612d3a5f6116e0565b5b80612d57612d51612d4c6005610d07565b610453565b91610453565b1015612e3257612d72612d6c60058390610d1d565b90610d68565b612d84612d7e84610a50565b91610a50565b14612d9757612d929061224f565b612d3b565b612ddd90612dd7612dcf612dc96005612dc3612db36005610d07565b612dbd6001612726565b906116fc565b90610d1d565b90610d68565b916005610d1d565b90612335565b612def612dea60056122d0565b612ccc565b5b612e1a7f9c8e7d83025bef8a04c664b2f753f64b8814bdb7e27291d7e50935f18cc3c71291611290565b90612e23610202565b80612e2d81610792565b0390a2565b50612df0565b5f630b0a0e0d60e21b815280612e5060048201610792565b0390fd5b612e5d90612c91565b565b5f90565b612e6b612e5f565b50612e746124be565b50612e7d612026565b50612e86612026565b50612e8f612e5f565b50612e9a6002611659565b90612ea36124c2565b90612ec1612ebc6003612eb66002611659565b9061035f565b61282a565b90612eda6004612ed3600285016103b5565b93016103b5565b908490565b5190565b90612ef5612ef083610a7f565b6105e9565b918252565b369037565b90612f24612f0c83612ee3565b92602080612f1a8693610a7f565b9201910390612efa565b565b90612f3082612edf565b811015612f41576020809102010190565b610cf3565b90612f5090610a50565b9052565b612f5d90610453565b5f198114612f6b5760010190565b611685565b91612f79612026565b50612f8382612edf565b91612f8d5f6116e0565b90612f9784612eff565b92612fa15f6116e0565b945b85612fb6612fb083610453565b91610453565b10156130d657612fd287612fcb858990612f26565b51906134be565b92612ff0612fea612fe56004879061129c565b6122a3565b156112f7565b6130ba575f97612fff5f6116e0565b5b8061301361300d89610453565b91610453565b10156130a95761302c613027898390612262565b612282565b61303e61303888610a50565b91610a50565b146130515761304c9061224f565b613000565b50939094975061306660019792975b156112f7565b61307f575b506130759061224f565b9495929195612fa3565b613075919761309d6130a2926130988991849092612262565b612f46565b612f54565b969061306b565b509390949761306690979297613060565b5f631cb6602160e31b8152806130d260048201610792565b0390fd5b5094505091505090565b6130e861352b565b90565b6130fc906130f761353f565b6130fe565b565b613107906135d7565b565b613112906130eb565b565b61311c61353f565b565b613126613114565b565b61313190611284565b90565b61313d30613128565b61316f6131697f0000000000000000000000000000000000000000000000000000000000000000610a50565b91610a50565b148015613199575b61317d57565b5f63703e46dd60e11b81528061319560048201610792565b0390fd5b506131a26135e2565b6131d46131ce7f0000000000000000000000000000000000000000000000000000000000000000610a50565b91610a50565b1415613177565b506131e46133a5565b565b6131ef906131db565b565b6131fa90611268565b90565b613206906131f1565b90565b61321290611284565b90565b60e01b90565b9060208282031261323457613231915f016114dc565b90565b61020c565b613241610202565b3d5f823e3d90fd5b9190613277602061326161325c866131fd565b613209565b6352d1902d9061326f610202565b938492613215565b8252818061328760048201610792565b03915afa80915f92613317575b50155f146132c85750509060016132a957505b565b6132c4905f918291634c9c8ce360e01b835260048301610daf565b0390fd5b92836132e36132dd6132d8612520565b610295565b91610295565b036132f8576132f3929350613608565b6132a7565b613313845f918291632a87526960e21b8352600483016102a5565b0390fd5b61333991925060203d8111613340575b61333181836105c0565b81019061321b565b905f613294565b503d613327565b61335030613128565b61338261337c7f0000000000000000000000000000000000000000000000000000000000000000610a50565b91610a50565b0361338957565b5f63703e46dd60e11b8152806133a160048201610792565b0390fd5b6133ad6127e1565b6133c66133c06133bb613691565b610a50565b91610a50565b036133cd57565b6133ef6133d8613691565b5f91829163118cdaa760e01b835260048301610daf565b0390fd5b9061340460018060a01b0391611746565b9181191691161790565b9061342361341e61342a92611290565b612332565b82546133f3565b9055565b61343661349a565b61344e6134445f83016127d4565b915f84910161340e565b9061348261347c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093611290565b91611290565b9161348b610202565b8061349581610792565b0390a3565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6134dd916134d4916134ce6127bc565b506136e1565b909291926137c9565b90565b90565b6134f76134f26134fc926134e0565b611746565b610295565b90565b6135287ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006134e3565b90565b613533611483565b5061353c6134ff565b90565b61355061354a61389e565b156112f7565b61355657565b5f631afcd79f60e31b81528061356e60048201610792565b0390fd5b6135839061357e61353f565b613585565b565b806135a061359a6135955f6125fe565b610a50565b91610a50565b146135b0576135ae9061342e565b565b6135d36135bc5f6125fe565b5f918291631e4fbdf760e01b835260048301610daf565b0390fd5b6135e090613572565b565b6135ea6127bc565b506136055f6135ff6135fa612520565b6138bc565b016127d4565b90565b90613612826138bf565b8161363d7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b91611290565b90613646610202565b8061365081610792565b0390a261365c8161149b565b61366e6136685f6116e0565b91610453565b115f146136825761367e9161398f565b505b565b505061368c613914565b613680565b6136996127bc565b503390565b5f90565b90565b6136b96136b46136be926136a2565b610340565b610453565b90565b6136d56136d06136da92610453565b611746565b610295565b90565b5f90565b9190916136ec6127bc565b506136f561369e565b506136fe611483565b506137088361149b565b61371b61371560416136a5565b91610453565b145f146137625761375b919261372f611483565b50613738611483565b506137416136dd565b506020810151606060408301519201515f1a909192613a37565b9192909190565b5061376c5f6125fe565b9061378061377b60029461149b565b6136c1565b91929190565b634e487b7160e01b5f52602160045260245ffd5b600411156137a457565b613786565b906137b38261379a565b565b6137c16137c691610375565b61184f565b90565b806137dc6137d65f6137a9565b916137a9565b145f146137e7575050565b806137fb6137f560016137a9565b916137a9565b145f1461381e575f63f645eedf60e01b81528061381a60048201610792565b0390fd5b8061383261382c60026137a9565b916137a9565b145f146138605761385c613845836137b5565b5f91829163fce698f760e01b835260048301610e3d565b0390fd5b61387361386d60036137a9565b916137a9565b1461387b5750565b613896905f9182916335e2f38360e21b8352600483016102a5565b0390fd5b5f90565b6138a661389a565b506138b95f6138b36130e0565b01611d11565b90565b90565b803b6138d36138cd5f6116e0565b91610453565b146138f5576138f3905f6138ed6138e8612520565b6138bc565b0161340e565b565b613910905f918291634c9c8ce360e01b835260048301610daf565b0390fd5b346139276139215f6116e0565b91610453565b1161392e57565b5f63b398979f60e01b81528061394660048201610792565b0390fd5b606090565b9061396161395c836105fe565b6105e9565b918252565b3d5f14613981576139763d61394f565b903d5f602084013e5b565b61398961394a565b9061397f565b5f806139bb9361399d61394a565b508390602081019051915af4906139b2613966565b90919091613b33565b90565b90565b6139d56139d06139da926139be565b610340565b610453565b90565b613a12613a1994613a086060949897956139fe608086019a5f870190610298565b6020850190610469565b6040830190610298565b0190610298565b565b613a2f613a2a613a34926116dd565b611746565b610295565b90565b939293613a426127bc565b50613a4b61369e565b50613a54611483565b50613a5e856137b5565b613a90613a8a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a06139c1565b91610453565b11613b1d5790613ab3602094955f94939293613aaa610202565b948594856139dd565b838052039060015afa15613b1857613acb5f51611746565b80613ae6613ae0613adb5f6125fe565b610a50565b91610a50565b14613afc575f91613af65f613a1b565b91929190565b50613b065f6125fe565b600191613b125f613a1b565b91929190565b613239565b505050613b295f6125fe565b9060039291929190565b90613b4790613b4061394a565b50156112f7565b5f14613b535750613bb7565b613b5c8261149b565b613b6e613b685f6116e0565b91610453565b1480613b9c575b613b7d575090565b613b98905f918291639996b31560e01b835260048301610daf565b0390fd5b50803b613bb1613bab5f6116e0565b91610453565b14613b75565b613bc08161149b565b613bd2613bcc5f6116e0565b91610453565b115f14613be157805190602001fd5b5f63d6bda27560e01b815280613bf960048201610792565b0390fdfea26469706673582212209de8f82d1c014ff899eb02d221cae989f60f6442b6513404c07034c01054027a64736f6c634300081d0033

Deployed Bytecode

0x60806040526004361015610013575b61147f565b61001d5f356101fc565b80630a1028c4146101f75780632ede662f146101f2578063313ce567146101ed57806349a1a4fb146101e85780634a643499146101e35780634e08ff5f146101de5780634f1ef286146101d957806350d25bcd146101d457806352d1902d146101cf5780635b69a7d8146101ca5780635d24004f146101c5578063668a0f02146101c05780636c3ff133146101bb578063715018a6146101b65780637284e416146101b15780637a1395aa146101ac5780638205bf6a146101a75780638d068043146101a25780638da5cb5b1461019d57806390c3f38f146101985780639a6fc8f514610193578063ad3cb1cc1461018e578063b5ab58dc14610189578063b633620c14610184578063d608ea641461017f578063db2966021461017a578063df5dd1a514610175578063f2fde38b14610170578063fdc85fc41461016b5763feaf968c0361000e57611446565b6113b9565b611386565b611353565b61131e565b611217565b6111e2565b6111ad565b611178565b6110c7565b611056565b611021565b610fec565b610fb7565b610f84565b610f31565b610eef565b610ebc565b610e52565b610e08565b610dc4565b610c7d565b610c48565b610c09565b610b8d565b610971565b610797565b610569565b6104d1565b6102ba565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b909182601f8301121561025a5781359167ffffffffffffffff831161025557602001926001830284011161025057565b61021c565b610218565b610214565b90602082820312610290575f82013567ffffffffffffffff811161028b576102879201610220565b9091565b610210565b61020c565b90565b6102a190610295565b9052565b91906102b8905f60208501940190610298565b565b346102eb576102e76102d66102d036600461025f565b9061149f565b6102de610202565b918291826102a5565b0390f35b610208565b69ffffffffffffffffffff1690565b610308816102f0565b0361030f57565b5f80fd5b90503590610320826102ff565b565b9060208282031261033b57610338915f01610313565b90565b61020c565b90565b61035761035261035c926102f0565b610340565b6102f0565b90565b9061036990610343565b5f5260205260405f2090565b5f1c90565b90565b61038961038e91610375565b61037a565b90565b61039b905461037d565b90565b90565b6103ad6103b291610375565b61039e565b90565b6103bf90546103a1565b90565b60ff1690565b6103d46103d991610375565b6103c2565b90565b6103e690546103c8565b90565b6103f490600361035f565b906104005f8301610391565b9161040d600182016103b5565b9161041a600283016103b5565b91610427600382016103b5565b916104406005610439600485016103b5565b93016103dc565b90565b90565b61044f90610443565b9052565b90565b61045f90610453565b9052565b60ff1690565b61047290610463565b9052565b91946104be6104c8929897956104b460a0966104aa6104cf9a6104a060c08a019e5f8b0190610446565b6020890190610456565b6040870190610456565b6060850190610456565b6080830190610456565b0190610469565b565b34610508576105046104ec6104e7366004610322565b6103e9565b926104fb969496929192610202565b96879687610476565b0390f35b610208565b5f91031261051757565b61020c565b1c90565b610530906008610535930261051c565b6103c2565b90565b906105439154610520565b90565b6105515f5f90610538565b90565b9190610567905f60208501940190610469565b565b346105995761057936600461050d565b610595610584610546565b61058c610202565b91829182610554565b0390f35b610208565b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906105ca906105a2565b810190811067ffffffffffffffff8211176105e457604052565b6105ac565b906105fc6105f5610202565b92836105c0565b565b67ffffffffffffffff811161061c576106186020916105a2565b0190565b6105ac565b90825f939282370152565b9092919261064161063c826105fe565b6105e9565b9381855260208501908284011161065d5761065b92610621565b565b61059e565b9080601f830112156106805781602061067d9335910161062c565b90565b610214565b67ffffffffffffffff811161069d5760208091020190565b6105ac565b9291906106b66106b182610685565b6105e9565b938185526020808601920281019183831161070d5781905b8382106106dc575050505050565b813567ffffffffffffffff8111610708576020916106fd8784938701610662565b8152019101906106ce565b610214565b61021c565b9080601f830112156107305781602061072d933591016106a2565b90565b610214565b91909160408184031261078d575f81013567ffffffffffffffff81116107885783610761918301610662565b92602082013567ffffffffffffffff8111610783576107809201610712565b90565b610210565b610210565b61020c565b5f0190565b346107c6576107b06107aa366004610735565b906119e0565b6107b8610202565b806107c281610792565b0390f35b610208565b634e487b7160e01b5f525f60045260245ffd5b634e487b7160e01b5f52602260045260245ffd5b9060016002830492168015610812575b602083101461080d57565b6107de565b91607f1691610802565b60209181520190565b5f5260205f2090565b905f9291805490610848610841836107f2565b809461081c565b916001811690815f1461089f5750600114610863575b505050565b6108709192939450610825565b915f925b81841061088757505001905f808061085e565b60018160209295939554848601520191019290610874565b92949550505060ff19168252151560200201905f808061085e565b906108c49161082e565b90565b906108e76108e0926108d7610202565b938480926108ba565b03836105c0565b565b905f106108fc576108f9906108c7565b90565b6107cb565b61090d60075f906108e9565b90565b5190565b60209181520190565b90825f9392825e0152565b6109476109506020936109559361093e81610910565b93848093610914565b9586910161091d565b6105a2565b0190565b61096e9160208201915f818403910152610928565b90565b346109a15761098136600461050d565b61099d61098c610901565b610994610202565b91829182610959565b0390f35b610208565b6109af81610463565b036109b657565b5f80fd5b905035906109c7826109a6565b565b67ffffffffffffffff81116109e7576109e36020916105a2565b0190565b6105ac565b90929192610a016109fc826109c9565b6105e9565b93818552602085019082840111610a1d57610a1b92610621565b565b61059e565b9080601f83011215610a4057816020610a3d933591016109ec565b90565b610214565b60018060a01b031690565b610a5990610a45565b90565b610a6581610a50565b03610a6c57565b5f80fd5b90503590610a7d82610a5c565b565b67ffffffffffffffff8111610a975760208091020190565b6105ac565b90929192610ab1610aac82610a7f565b6105e9565b9381855260208086019202830192818411610aee57915b838310610ad55750505050565b60208091610ae38486610a70565b815201920191610ac8565b61021c565b9080601f83011215610b1157816020610b0e93359101610a9c565b90565b610214565b90608082820312610b8857610b2d815f84016109ba565b92602083013567ffffffffffffffff8111610b835782610b4e918501610a22565b92610b5c8360408301610a70565b92606082013567ffffffffffffffff8111610b7e57610b7b9201610af3565b90565b610210565b610210565b61020c565b34610bbf57610ba9610ba0366004610b16565b9291909161247b565b610bb1610202565b80610bbb81610792565b0390f35b610208565b919091604081840312610c0457610bdd835f8301610a70565b92602082013567ffffffffffffffff8111610bff57610bfc9201610662565b90565b610210565b61020c565b610c1d610c17366004610bc4565b906124b2565b610c25610202565b80610c2f81610792565b0390f35b9190610c46905f60208501940190610446565b565b34610c7857610c5836600461050d565b610c74610c636124c2565b610c6b610202565b91829182610c33565b0390f35b610208565b34610cad57610c8d36600461050d565b610ca9610c98612558565b610ca0610202565b918291826102a5565b0390f35b610208565b610cbb81610453565b03610cc257565b5f80fd5b90503590610cd382610cb2565b565b90602082820312610cee57610ceb915f01610cc6565b90565b61020c565b634e487b7160e01b5f52603260045260245ffd5b5490565b5f5260205f2090565b5f5260205f2090565b610d2681610d07565b821015610d4057610d38600191610d0b565b910201905f90565b610cf3565b60018060a01b031690565b610d60906008610d65930261051c565b610d45565b90565b90610d739154610d50565b90565b6005610d8181610d07565b821015610d9e57610d9b91610d9591610d1d565b90610d68565b90565b5f80fd5b610dab90610a50565b9052565b9190610dc2905f60208501940190610da2565b565b34610df457610df0610ddf610dda366004610cd5565b610d76565b610de7610202565b91829182610daf565b0390f35b610208565b610e0560065f90610d68565b90565b34610e3857610e1836600461050d565b610e34610e23610df9565b610e2b610202565b91829182610daf565b0390f35b610208565b9190610e50905f60208501940190610456565b565b34610e8257610e6236600461050d565b610e7e610e6d612587565b610e75610202565b91829182610e3d565b0390f35b610208565b90602082820312610eb7575f82013567ffffffffffffffff8111610eb257610eaf9201610a22565b90565b610210565b61020c565b34610eea57610ed4610ecf366004610e87565b6125c5565b610edc610202565b80610ee681610792565b0390f35b610208565b34610f1d57610eff36600461050d565b610f0761261d565b610f0f610202565b80610f1981610792565b0390f35b610208565b610f2e60015f906108e9565b90565b34610f6157610f4136600461050d565b610f5d610f4c610f22565b610f54610202565b91829182610959565b0390f35b610208565b90602082820312610f7f57610f7c915f016109ba565b90565b61020c565b34610fb257610f9c610f97366004610f66565b612646565b610fa4610202565b80610fae81610792565b0390f35b610208565b34610fe757610fc736600461050d565b610fe3610fd2612651565b610fda610202565b91829182610e3d565b0390f35b610208565b3461101c57610ffc36600461050d565b611018611007612742565b61100f610202565b91829182610e3d565b0390f35b610208565b346110515761103136600461050d565b61104d61103c6127e1565b611044610202565b91829182610daf565b0390f35b610208565b346110845761106e611069366004610e87565b61281f565b611076610202565b8061108081610792565b0390f35b610208565b6110be6110c5946110b46060949897956110aa608086019a5f870190610446565b6020850190610456565b6040830190610456565b0190610456565b565b346110fb576110f76110e26110dd366004610322565b61282d565b906110ee949294610202565b94859485611089565b0390f35b610208565b9061111261110d836109c9565b6105e9565b918252565b5f7f352e302e30000000000000000000000000000000000000000000000000000000910152565b6111486005611100565b9061115560208301611117565b565b61115f61113e565b90565b61116a611157565b90565b611175611162565b90565b346111a85761118836600461050d565b6111a461119361116d565b61119b610202565b91829182610959565b0390f35b610208565b346111dd576111d96111c86111c3366004610cd5565b612915565b6111d0610202565b91829182610c33565b0390f35b610208565b346112125761120e6111fd6111f8366004610cd5565b61299e565b611205610202565b91829182610e3d565b0390f35b610208565b346112455761122f61122a366004610e87565b612b59565b611237610202565b8061124181610792565b0390f35b610208565b9060208282031261126357611260915f01610a70565b90565b61020c565b61127c61127761128192610a45565b610340565b610a45565b90565b61128d90611268565b90565b61129990611284565b90565b906112a690611290565b5f5260205260405f2090565b60ff1690565b6112c89060086112cd930261051c565b6112b2565b90565b906112db91546112b8565b90565b6112f4906112ef6004915f9261129c565b6112d0565b90565b151590565b611305906112f7565b9052565b919061131c905f602085019401906112fc565b565b3461134e5761134a61133961133436600461124a565b6112de565b611341610202565b91829182611309565b0390f35b610208565b346113815761136b61136636600461124a565b612c16565b611373610202565b8061137d81610792565b0390f35b610208565b346113b45761139e61139936600461124a565b612c86565b6113a6610202565b806113b081610792565b0390f35b610208565b346113e7576113d16113cc36600461124a565b612e54565b6113d9610202565b806113e381610792565b0390f35b610208565b6113f5906102f0565b9052565b909594926114449461143361143d9261142960809661141f60a088019c5f8901906113ec565b6020870190610446565b6040850190610456565b6060830190610456565b01906113ec565b565b3461147a5761145636600461050d565b611476611461612e63565b9161146d959395610202565b958695866113f9565b0390f35b610208565b5f80fd5b5f90565b61149291369161062c565b90565b60200190565b5190565b906114b2916114ac611483565b50611487565b6114c46114be8261149b565b91611495565b2090565b6114d181610295565b036114d857565b5f80fd5b905051906114e9826114c8565b565b6114f481610443565b036114fb57565b5f80fd5b9050519061150c826114eb565b565b9050519061151b82610cb2565b565b60808183031261155e57611533825f83016114dc565b9261155b61154484602085016114ff565b93611552816040860161150e565b9360600161150e565b90565b61020c565b90565b60209181520190565b905f9291805490611589611582836107f2565b8094611566565b916001811690815f146115e057506001146115a4575b505050565b6115b19192939450610d14565b915f925b8184106115c857505001905f808061159f565b600181602092959395548486015201910192906115b5565b92949550505060ff19168252151560200201905f808061159f565b906116059161156f565b90565b9061162861162192611618610202565b938480926115fb565b03836105c0565b565b61163390611608565b90565b69ffffffffffffffffffff1690565b61165161165691610375565b611636565b90565b6116639054611645565b90565b90565b61167d61167861168292611666565b610340565b610453565b90565b634e487b7160e01b5f52601160045260245ffd5b6116a86116ae91939293610453565b92610453565b82018092116116b957565b611685565b90565b6116d56116d06116da926116be565b610340565b610453565b90565b90565b6116f46116ef6116f9926116dd565b610340565b610453565b90565b61170b61171191939293610453565b92610453565b820391821161171c57565b611685565b61172a906102f0565b69ffffffffffffffffffff81146117415760010190565b611685565b5f1b90565b9061176069ffffffffffffffffffff91611746565b9181191691161790565b90565b9061178261177d61178992610343565b61176a565b825461174b565b9055565b6117a161179c6117a692610453565b610340565b610463565b90565b6117b360c06105e9565b90565b906117c090610443565b9052565b906117ce90610453565b9052565b906117dc90610463565b9052565b6117ea9051610443565b90565b906117f95f1991611746565b9181191691161790565b61181761181261181c92610443565b610340565b610443565b90565b90565b9061183761183261183e92611803565b61181f565b82546117ed565b9055565b61184c9051610453565b90565b61186361185e61186892610453565b610340565b610453565b90565b90565b9061188361187e61188a9261184f565b61186b565b82546117ed565b9055565b6118989051610463565b90565b906118a760ff91611746565b9181191691161790565b6118c56118c06118ca92610463565b610340565b610463565b90565b90565b906118e56118e06118ec926118b1565b6118cd565b825461189b565b9055565b9061197f60a06005611985946119135f820161190d5f88016117e0565b90611822565b61192c6001820161192660208801611842565b9061186e565b6119456002820161193f60408801611842565b9061186e565b61195e6003820161195860608801611842565b9061186e565b6119776004820161197160808801611842565b9061186e565b01920161188e565b906118d0565b565b90611991916118f0565b565b909594926119de946119cd6119d7926119c36080966119b960a088019c5f890190610446565b6020870190610456565b6040850190610456565b6060830190610da2565b0190610456565b565b906119fb8260206119f08261149b565b81830101910161151d565b94919293909392939492611a3b611a35611a1d611a186007611563565b61162a565b611a2f611a298261149b565b91611495565b20610295565b91610295565b03611cdb5782611a71611a6b611a666002611a606003611a5a83611659565b9061035f565b016103b5565b610453565b91610453565b1115611cbf5782611a9e611a98611a9342611a8d61012c611669565b90611699565b610453565b91610453565b11611ca35742611ab8611ab2610e106116c1565b91610453565b115f14611c9557611ad442611ace610e106116c1565b906116fc565b5b611ae8611ae28592610453565b91610453565b10611c7957611b0991611b03611afd8261149b565b91611495565b20612f70565b9283611b24611b1e611b19612742565b610453565b91610453565b10611c5d57611b336002611659565b611b4f611b4969ffffffffffffffffffff6102f0565b916102f0565b14611c4157611b70611b69611b646002611659565b611721565b600261176d565b611bee83611bd483611bcb88611bc288611bb94391611bb0611b92429661178d565b97611ba7611b9e6117a9565b9b5f8d016117b6565b60208b016117c4565b604089016117c4565b606087016117c4565b608085016117c4565b60a083016117d2565b611be96003611be36002611659565b9061035f565b611987565b611c3c611bfb6002611659565b9391929433611c2a7f0b62719df03f34f9cd4469266344b26b09b76d94a1c2cc1a6a0f0d460cc8b7d196610343565b96611c33610202565b95869586611993565b0390a2565b5f630cf2795360e41b815280611c5960048201610792565b0390fd5b5f633724e34360e11b815280611c7560048201610792565b0390fd5b5f63d40fc74b60e01b815280611c9160048201610792565b0390fd5b611c9e5f6116e0565b611ad5565b5f63364b8df560e11b815280611cbb60048201610792565b0390fd5b5f63f0022dfb60e01b815280611cd760048201610792565b0390fd5b5f63c2a25c1b60e01b815280611cf360048201610792565b0390fd5b60401c90565b611d09611d0e91611cf7565b6112b2565b90565b611d1b9054611cfd565b90565b67ffffffffffffffff1690565b611d37611d3c91610375565b611d1e565b90565b611d499054611d2b565b90565b67ffffffffffffffff1690565b611d6d611d68611d72926116dd565b610340565b611d4c565b90565b90565b611d8c611d87611d9192611d75565b610340565b611d4c565b90565b611d9d90611284565b90565b90611db367ffffffffffffffff91611746565b9181191691161790565b611dd1611dcc611dd692611d4c565b610340565b611d4c565b90565b90565b90611df1611dec611df892611dbd565b611dd9565b8254611da0565b9055565b60401b90565b90611e1668ff000000000000000091611dfc565b9181191691161790565b611e29906112f7565b90565b90565b90611e44611e3f611e4b92611e20565b611e2c565b8254611e02565b9055565b611e5890611d78565b9052565b9190611e6f905f60208501940190611e4f565b565b909192611e7c6130e0565b93611e91611e8b5f8701611d11565b156112f7565b93611e9d5f8701611d3f565b80611eb0611eaa5f611d59565b91611d4c565b1480611fca575b90611ecb611ec56001611d78565b91611d4c565b1480611fa2575b611edd9091156112f7565b9081611f91575b50611f7557611f0d93611f02611efa6001611d78565b5f8901611ddc565b85611f63575b61238c565b611f15575b50565b611f22905f809101611e2f565b6001611f5a7fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d291611f51610202565b91829182611e5c565b0390a15f611f12565b611f7060015f8901611e2f565b611f08565b5f63f92ee8a960e01b815280611f8d60048201610792565b0390fd5b611f9c9150156112f7565b5f611ee4565b50611edd611faf30611d94565b3b611fc2611fbc5f6116e0565b91610453565b149050611ed2565b5085611eb7565b601f602091010490565b1b90565b91906008611ffa910291611ff45f1984611fdb565b92611fdb565b9181191691161790565b919061201a6120156120229361184f565b61186b565b908354611fdf565b9055565b5f90565b61203c91612036612026565b91612004565b565b5b81811061204a575050565b806120575f60019361202a565b0161203f565b9190601f811161206d575b505050565b61207961209e93610825565b90602061208584611fd1565b830193106120a6575b61209790611fd1565b019061203e565b5f8080612068565b91506120978192905061208e565b906120c4905f199060080261051c565b191690565b816120d3916120b4565b906002021790565b906120e581610910565b9067ffffffffffffffff82116121a5576121098261210385546107f2565b8561205d565b602090601f831160011461213d5791809161212c935f92612131575b50506120c9565b90555b565b90915001515f80612125565b601f1983169161214c85610825565b925f5b81811061218d57509160029391856001969410612173575b5050500201905561212f565b612183910151601f8416906120b4565b90555f8080612167565b9193602060018192878701518155019501920161214f565b6105ac565b906121b4916120db565b565b9190601f81116121c6575b505050565b6121d26121f793610d14565b9060206121de84611fd1565b830193106121ff575b6121f090611fd1565b019061203e565b5f80806121c1565b91506121f0819290506121e7565b6122215f61221b83546107f2565b836121b6565b5f80019055565b6122319061220d565b565b61224761224261224c926116dd565b610340565b6102f0565b90565b600161225b9101610453565b90565b5190565b9061226c8261225e565b81101561227d576020809102010190565b610cf3565b61228c9051610a50565b90565b61229b6122a091610375565b6112b2565b90565b6122ad905461228f565b90565b906122c56122c06122cc92611e20565b611e2c565b825461189b565b9055565b90565b5f5260205f2090565b5490565b6122e9816122dc565b821015612303576122fb6001916122d3565b910201905f90565b610cf3565b9190600861232891029161232260018060a01b0384611fdb565b92611fdb565b9181191691161790565b90565b919061234b61234661235393611290565b612332565b908354612308565b9055565b9081549168010000000000000000831015612387578261237f916001612385950181556122e0565b90612335565b565b6105ac565b6123aa9061239c6123b194613109565b6123a461311e565b5f6118d0565b60016121aa565b6123bb6007612228565b6123ce6123c75f612233565b600261176d565b6123d75f6116e0565b5b806123f36123ed6123e88561225e565b610453565b91610453565b10156124775761240c612407838390612262565b612282565b9061242161241c6004849061129c565b6122a3565b61245b5761245161245692612442600161243d6004849061129c565b6122b0565b61244c60056122d0565b612357565b61224f565b6123d8565b5f636586df7960e01b81528061247360048201610792565b0390fd5b5050565b90612487939291611e71565b565b9061249b91612496613134565b61249d565b565b906124b0916124ab816131e6565b613249565b565b906124bc91612489565b565b5f90565b6124ca6124be565b506124ea5f6124e460036124de6002611659565b9061035f565b01610391565b90565b6124fe906124f9613347565b61254c565b90565b90565b61251861251361251d92612501565b611746565b610295565b90565b6125497f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc612504565b90565b50612555612520565b90565b612568612563611483565b6124ed565b90565b61257f61257a612584926102f0565b610340565b610453565b90565b61258f612026565b506125a261259d6002611659565b61256b565b90565b6125b6906125b16133a5565b6125b8565b565b6125c39060076121aa565b565b6125ce906125a5565b565b6125d86133a5565b6125e061260a565b565b6125f66125f16125fb926116dd565b610340565b610a45565b90565b612607906125e2565b90565b61261b6126165f6125fe565b61342e565b565b6126256125d0565b565b612638906126336133a5565b61263a565b565b612644905f6118d0565b565b61264f90612627565b565b612659612026565b5061267a6004612674600361266e6002611659565b9061035f565b016103b5565b90565b90565b61269461268f6126999261267d565b610340565b610453565b90565b6126ab6126b191939293610453565b92610453565b916126bd838202610453565b9281840414901517156126cc57565b611685565b90565b6126e86126e36126ed926126d1565b610340565b610453565b90565b634e487b7160e01b5f52601260045260245ffd5b61271061271691610453565b91610453565b908115612721570490565b6126f0565b61273a61273561273f92611d75565b610340565b610453565b90565b61274a612026565b5061278e61277e61276e61275e6005610d07565b6127686002612680565b9061269c565b6127786002612680565b90611699565b61278860036126d4565b90612704565b806127a161279b5f6116e0565b91610453565b115f146127ac575b90565b506127b76001612726565b6127a9565b5f90565b6127cc6127d191610375565b610d45565b90565b6127de90546127c0565b90565b6127e96127bc565b506127fc5f6127f661349a565b016127d4565b90565b6128109061280b6133a5565b612812565b565b61281d9060016121aa565b565b612828906127ff565b565b90565b6128356124be565b5061283e612026565b50612847612026565b50612850612026565b508061286461285e5f612233565b916102f0565b1480156128d6575b6128ba5761287e61288391600361035f565b61282a565b61288e5f8201610391565b61289a600183016103b5565b926128b360036128ac600286016103b5565b94016103b5565b9193929190565b5f633a800deb60e01b8152806128d260048201610792565b0390fd5b50806128f36128ed6128e86002611659565b6102f0565b916102f0565b1161286c565b61290d61290861291292610453565b610340565b6102f0565b90565b61291d6124be565b508061293161292b5f6116e0565b91610453565b14801561297b575b61295f575f61295661295c926129506003916128f9565b9061035f565b01610391565b90565b5f633a800deb60e01b81528061297760048201610792565b0390fd5b508061299861299261298d6002611659565b61256b565b91610453565b11612939565b6129a6612026565b50806129ba6129b45f6116e0565b91610453565b148015612a05575b6129e95760046129e06129e6926129da6003916128f9565b9061035f565b016103b5565b90565b5f633a800deb60e01b815280612a0160048201610792565b0390fd5b5080612a22612a1c612a176002611659565b61256b565b91610453565b116129c2565b612a3c612a37612a419261267d565b610340565b611d4c565b90565b612a4d90611d4c565b9052565b9190612a64905f60208501940190612a44565b565b612a706002612a28565b90612a796130e0565b612a845f8201611d11565b8015612b14575b612af857612ab4612abd92612aa2855f8501611ddc565b612aaf60015f8501611e2f565b612b39565b5f809101611e2f565b612af37fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d291612aea610202565b91829182612a51565b0390a1565b5f63f92ee8a960e01b815280612b1060048201610792565b0390fd5b50612b205f8201611d3f565b612b32612b2c85611d4c565b91611d4c565b1015612a8b565b612b4a90612b456133a5565b612b4c565b565b612b579060076121aa565b565b612b6290612a66565b565b612b7590612b706133a5565b612b77565b565b612b8b612b866004839061129c565b6122a3565b612bfa57612ba56001612ba06004849061129c565b6122b0565b612bb9612bb260056122d0565b8290612357565b612be27e47706786c922d17b39285dc59d696bafea72c0b003d3841ae1202076f4c2e491611290565b90612beb610202565b80612bf581610792565b0390a2565b5f636586df7960e01b815280612c1260048201610792565b0390fd5b612c1f90612b64565b565b612c3290612c2d6133a5565b612c34565b565b80612c4f612c49612c445f6125fe565b610a50565b91610a50565b14612c5f57612c5d9061342e565b565b612c82612c6b5f6125fe565b5f918291631e4fbdf760e01b835260048301610daf565b0390fd5b612c8f90612c21565b565b612ca290612c9d6133a5565b612cfb565b565b634e487b7160e01b5f52603160045260245ffd5b612cca91612cc46127bc565b91612335565b565b612cd5816122dc565b8015612cf6576001900390612cf3612ced83836122e0565b90612cb8565b55565b612ca4565b612d18612d12612d0d6004849061129c565b6122a3565b156112f7565b612e3857612d315f612d2c6004849061129c565b6122b0565b612d3a5f6116e0565b5b80612d57612d51612d4c6005610d07565b610453565b91610453565b1015612e3257612d72612d6c60058390610d1d565b90610d68565b612d84612d7e84610a50565b91610a50565b14612d9757612d929061224f565b612d3b565b612ddd90612dd7612dcf612dc96005612dc3612db36005610d07565b612dbd6001612726565b906116fc565b90610d1d565b90610d68565b916005610d1d565b90612335565b612def612dea60056122d0565b612ccc565b5b612e1a7f9c8e7d83025bef8a04c664b2f753f64b8814bdb7e27291d7e50935f18cc3c71291611290565b90612e23610202565b80612e2d81610792565b0390a2565b50612df0565b5f630b0a0e0d60e21b815280612e5060048201610792565b0390fd5b612e5d90612c91565b565b5f90565b612e6b612e5f565b50612e746124be565b50612e7d612026565b50612e86612026565b50612e8f612e5f565b50612e9a6002611659565b90612ea36124c2565b90612ec1612ebc6003612eb66002611659565b9061035f565b61282a565b90612eda6004612ed3600285016103b5565b93016103b5565b908490565b5190565b90612ef5612ef083610a7f565b6105e9565b918252565b369037565b90612f24612f0c83612ee3565b92602080612f1a8693610a7f565b9201910390612efa565b565b90612f3082612edf565b811015612f41576020809102010190565b610cf3565b90612f5090610a50565b9052565b612f5d90610453565b5f198114612f6b5760010190565b611685565b91612f79612026565b50612f8382612edf565b91612f8d5f6116e0565b90612f9784612eff565b92612fa15f6116e0565b945b85612fb6612fb083610453565b91610453565b10156130d657612fd287612fcb858990612f26565b51906134be565b92612ff0612fea612fe56004879061129c565b6122a3565b156112f7565b6130ba575f97612fff5f6116e0565b5b8061301361300d89610453565b91610453565b10156130a95761302c613027898390612262565b612282565b61303e61303888610a50565b91610a50565b146130515761304c9061224f565b613000565b50939094975061306660019792975b156112f7565b61307f575b506130759061224f565b9495929195612fa3565b613075919761309d6130a2926130988991849092612262565b612f46565b612f54565b969061306b565b509390949761306690979297613060565b5f631cb6602160e31b8152806130d260048201610792565b0390fd5b5094505091505090565b6130e861352b565b90565b6130fc906130f761353f565b6130fe565b565b613107906135d7565b565b613112906130eb565b565b61311c61353f565b565b613126613114565b565b61313190611284565b90565b61313d30613128565b61316f6131697f000000000000000000000000a17887fd35b14a4c6e6ec87458591941934d444c610a50565b91610a50565b148015613199575b61317d57565b5f63703e46dd60e11b81528061319560048201610792565b0390fd5b506131a26135e2565b6131d46131ce7f000000000000000000000000a17887fd35b14a4c6e6ec87458591941934d444c610a50565b91610a50565b1415613177565b506131e46133a5565b565b6131ef906131db565b565b6131fa90611268565b90565b613206906131f1565b90565b61321290611284565b90565b60e01b90565b9060208282031261323457613231915f016114dc565b90565b61020c565b613241610202565b3d5f823e3d90fd5b9190613277602061326161325c866131fd565b613209565b6352d1902d9061326f610202565b938492613215565b8252818061328760048201610792565b03915afa80915f92613317575b50155f146132c85750509060016132a957505b565b6132c4905f918291634c9c8ce360e01b835260048301610daf565b0390fd5b92836132e36132dd6132d8612520565b610295565b91610295565b036132f8576132f3929350613608565b6132a7565b613313845f918291632a87526960e21b8352600483016102a5565b0390fd5b61333991925060203d8111613340575b61333181836105c0565b81019061321b565b905f613294565b503d613327565b61335030613128565b61338261337c7f000000000000000000000000a17887fd35b14a4c6e6ec87458591941934d444c610a50565b91610a50565b0361338957565b5f63703e46dd60e11b8152806133a160048201610792565b0390fd5b6133ad6127e1565b6133c66133c06133bb613691565b610a50565b91610a50565b036133cd57565b6133ef6133d8613691565b5f91829163118cdaa760e01b835260048301610daf565b0390fd5b9061340460018060a01b0391611746565b9181191691161790565b9061342361341e61342a92611290565b612332565b82546133f3565b9055565b61343661349a565b61344e6134445f83016127d4565b915f84910161340e565b9061348261347c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093611290565b91611290565b9161348b610202565b8061349581610792565b0390a3565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6134dd916134d4916134ce6127bc565b506136e1565b909291926137c9565b90565b90565b6134f76134f26134fc926134e0565b611746565b610295565b90565b6135287ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006134e3565b90565b613533611483565b5061353c6134ff565b90565b61355061354a61389e565b156112f7565b61355657565b5f631afcd79f60e31b81528061356e60048201610792565b0390fd5b6135839061357e61353f565b613585565b565b806135a061359a6135955f6125fe565b610a50565b91610a50565b146135b0576135ae9061342e565b565b6135d36135bc5f6125fe565b5f918291631e4fbdf760e01b835260048301610daf565b0390fd5b6135e090613572565b565b6135ea6127bc565b506136055f6135ff6135fa612520565b6138bc565b016127d4565b90565b90613612826138bf565b8161363d7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b91611290565b90613646610202565b8061365081610792565b0390a261365c8161149b565b61366e6136685f6116e0565b91610453565b115f146136825761367e9161398f565b505b565b505061368c613914565b613680565b6136996127bc565b503390565b5f90565b90565b6136b96136b46136be926136a2565b610340565b610453565b90565b6136d56136d06136da92610453565b611746565b610295565b90565b5f90565b9190916136ec6127bc565b506136f561369e565b506136fe611483565b506137088361149b565b61371b61371560416136a5565b91610453565b145f146137625761375b919261372f611483565b50613738611483565b506137416136dd565b506020810151606060408301519201515f1a909192613a37565b9192909190565b5061376c5f6125fe565b9061378061377b60029461149b565b6136c1565b91929190565b634e487b7160e01b5f52602160045260245ffd5b600411156137a457565b613786565b906137b38261379a565b565b6137c16137c691610375565b61184f565b90565b806137dc6137d65f6137a9565b916137a9565b145f146137e7575050565b806137fb6137f560016137a9565b916137a9565b145f1461381e575f63f645eedf60e01b81528061381a60048201610792565b0390fd5b8061383261382c60026137a9565b916137a9565b145f146138605761385c613845836137b5565b5f91829163fce698f760e01b835260048301610e3d565b0390fd5b61387361386d60036137a9565b916137a9565b1461387b5750565b613896905f9182916335e2f38360e21b8352600483016102a5565b0390fd5b5f90565b6138a661389a565b506138b95f6138b36130e0565b01611d11565b90565b90565b803b6138d36138cd5f6116e0565b91610453565b146138f5576138f3905f6138ed6138e8612520565b6138bc565b0161340e565b565b613910905f918291634c9c8ce360e01b835260048301610daf565b0390fd5b346139276139215f6116e0565b91610453565b1161392e57565b5f63b398979f60e01b81528061394660048201610792565b0390fd5b606090565b9061396161395c836105fe565b6105e9565b918252565b3d5f14613981576139763d61394f565b903d5f602084013e5b565b61398961394a565b9061397f565b5f806139bb9361399d61394a565b508390602081019051915af4906139b2613966565b90919091613b33565b90565b90565b6139d56139d06139da926139be565b610340565b610453565b90565b613a12613a1994613a086060949897956139fe608086019a5f870190610298565b6020850190610469565b6040830190610298565b0190610298565b565b613a2f613a2a613a34926116dd565b611746565b610295565b90565b939293613a426127bc565b50613a4b61369e565b50613a54611483565b50613a5e856137b5565b613a90613a8a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a06139c1565b91610453565b11613b1d5790613ab3602094955f94939293613aaa610202565b948594856139dd565b838052039060015afa15613b1857613acb5f51611746565b80613ae6613ae0613adb5f6125fe565b610a50565b91610a50565b14613afc575f91613af65f613a1b565b91929190565b50613b065f6125fe565b600191613b125f613a1b565b91929190565b613239565b505050613b295f6125fe565b9060039291929190565b90613b4790613b4061394a565b50156112f7565b5f14613b535750613bb7565b613b5c8261149b565b613b6e613b685f6116e0565b91610453565b1480613b9c575b613b7d575090565b613b98905f918291639996b31560e01b835260048301610daf565b0390fd5b50803b613bb1613bab5f6116e0565b91610453565b14613b75565b613bc08161149b565b613bd2613bcc5f6116e0565b91610453565b115f14613be157805190602001fd5b5f63d6bda27560e01b815280613bf960048201610792565b0390fdfea26469706673582212209de8f82d1c014ff899eb02d221cae989f60f6442b6513404c07034c01054027a64736f6c634300081d0033

Block Transaction Gas Used Reward
view all blocks sequenced

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

Validator Index Block Amount
View All Withdrawals

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

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