Holesky Testnet

Contract

0x93EAE6368b56383485645d2EebdCE4fF9f77d72C

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SedaCoreV1

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 20 : SedaCoreV1.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

import {IRequestHandler} from "../interfaces/IRequestHandler.sol";
import {IResultHandler} from "../interfaces/IResultHandler.sol";
import {ISedaCore} from "../interfaces/ISedaCore.sol";
import {RequestHandlerBase} from "./abstract/RequestHandlerBase.sol";
import {ResultHandlerBase} from "./abstract/ResultHandlerBase.sol";
import {SedaDataTypes} from "../libraries/SedaDataTypes.sol";

/// @title SedaCoreV1
/// @notice Core contract for the Seda protocol, managing requests and results
/// @dev Implements ResultHandler and RequestHandler functionalities, and manages active requests
contract SedaCoreV1 is ISedaCore, RequestHandlerBase, ResultHandlerBase, UUPSUpgradeable, OwnableUpgradeable {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    // ============ Constants ============

    // Constant storage slot for the state following the ERC-7201 standard
    bytes32 private constant CORE_V1_STORAGE_SLOT =
        keccak256(abi.encode(uint256(keccak256("sedacore.storage.v1")) - 1)) & ~bytes32(uint256(0xff));

    // ============ Errors ============

    // Error thrown when a result is posted with a timestamp before the corresponding request
    error InvalidResultTimestamp(bytes32 drId, uint256 resultTimestamp, uint256 requestTimestamp);

    // ============ Storage ============

    /// @custom:storage-location erc7201:sedacore.storage.v1
    struct SedaCoreStorage {
        // Enumerable Set to store the request IDs that are pending
        // `pendingRequests` keeps track of all active data requests that have been posted but not yet fulfilled.
        // This set is used to manage the lifecycle of requests, allowing easy retrieval and status tracking.
        // When a request is posted, it is added to `pendingRequests`.
        // When a result is posted and the request is fulfilled, it is removed from `pendingRequests`
        EnumerableSet.Bytes32Set pendingRequests;
        // Mapping to store request timestamps for pending DRs
        mapping(bytes32 => uint256) requestTimestamps;
    }

    // ============ Constructor & Initializer ============

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

    /// @notice Initializes the SedaCoreV1 contract
    /// @param sedaProverAddress The address of the Seda prover contract
    /// @dev This function replaces the constructor for proxy compatibility and can only be called once
    function initialize(address sedaProverAddress) external initializer {
        __ResultHandler_init(sedaProverAddress);
        __Ownable_init(msg.sender);
        __UUPSUpgradeable_init();
    }

    // ============ Public Functions ============

    /// @inheritdoc RequestHandlerBase
    /// @dev Overrides the base implementation to also add the request ID and timestamp to storage
    function postRequest(
        SedaDataTypes.RequestInputs calldata inputs
    ) public override(RequestHandlerBase, IRequestHandler) returns (bytes32) {
        bytes32 requestId = super.postRequest(inputs);
        _addRequest(requestId);
        // Store the request timestamp
        _storageV1().requestTimestamps[requestId] = block.timestamp;

        return requestId;
    }

    /// @inheritdoc ResultHandlerBase
    /// @dev Overrides the base implementation to validate result timestamp and clean up storage
    function postResult(
        SedaDataTypes.Result calldata result,
        uint64 batchHeight,
        bytes32[] calldata proof
    ) public override(ResultHandlerBase, IResultHandler) returns (bytes32) {
        uint256 requestTimestamp = _storageV1().requestTimestamps[result.drId];
        // Validate result timestamp comes after request timestamp
        // Note: requestTimestamp = 0 for requests not tracked by this contract (always passes validation)
        if (result.blockTimestamp <= requestTimestamp) {
            revert InvalidResultTimestamp(result.drId, result.blockTimestamp, requestTimestamp);
        }

        bytes32 resultId = super.postResult(result, batchHeight, proof);

        _removeRequest(result.drId);
        delete _storageV1().requestTimestamps[result.drId];

        return resultId;
    }

    // ============ Public View Functions ============

    /// @notice Retrieves a list of active requests
    /// @dev This function is gas-intensive due to iteration over the pendingRequests array.
    /// Users should be cautious when using high `limit` values in production environments, as it can result in high gas consumption.
    /// @param offset The starting index in the pendingRequests array
    /// @param limit The maximum number of requests to return
    /// @return An array of SedaDataTypes.Request structs
    function getPendingRequests(uint256 offset, uint256 limit) public view returns (SedaDataTypes.Request[] memory) {
        uint256 totalRequests = _storageV1().pendingRequests.length();
        if (offset >= totalRequests) {
            return new SedaDataTypes.Request[](0);
        }

        uint256 actualLimit = (offset + limit > totalRequests) ? totalRequests - offset : limit;
        SedaDataTypes.Request[] memory queriedPendingRequests = new SedaDataTypes.Request[](actualLimit);
        for (uint256 i = 0; i < actualLimit; i++) {
            bytes32 requestId = _storageV1().pendingRequests.at(offset + i);
            queriedPendingRequests[i] = getRequest(requestId);
        }

        return queriedPendingRequests;
    }

    // ============ Internal Functions ============

    /// @notice Returns the storage struct for the contract
    /// @dev Uses ERC-7201 storage pattern to access the storage struct at a specific slot
    /// @return s The storage struct containing the contract's state variables
    function _storageV1() internal pure returns (SedaCoreStorage storage s) {
        bytes32 slot = CORE_V1_STORAGE_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := slot
        }
    }

    /// @notice Adds a request ID to the pendingRequests set
    /// @dev This function is internal to ensure that only the contract's internal logic can add requests,
    /// preventing unauthorized additions and maintaining proper state management.
    /// @param requestId The ID of the request to add
    function _addRequest(bytes32 requestId) internal {
        _storageV1().pendingRequests.add(requestId);
    }

    /// @notice Removes a request ID from the pendingRequests set if it exists
    /// @dev This function is internal to ensure that only the contract's internal logic can remove requests,
    /// maintaining proper state transitions and preventing unauthorized removals.
    /// @param requestId The ID of the request to remove
    function _removeRequest(bytes32 requestId) internal {
        _storageV1().pendingRequests.remove(requestId);
    }

    /// @dev Required override for UUPSUpgradeable. Ensures only the owner can upgrade the implementation.
    /// @inheritdoc UUPSUpgradeable
    /// @param newImplementation Address of the new implementation contract
    function _authorizeUpgrade(
        address newImplementation
    )
        internal
        virtual
        override
        onlyOwner // solhint-disable-next-line no-empty-blocks
    {}
}

File 2 of 20 : OwnableUpgradeable.sol
// 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);
    }
}

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.20;

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

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

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

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

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

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in 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.
     * See {_onlyProxy}.
     */
    function _checkProxy() internal view virtual {
        if (
            address(this) == __self || // Must be called through delegatecall
            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
        ) {
            revert UUPSUnauthorizedCallContext();
        }
    }

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

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

    /**
     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
     *
     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
     * is expected to be the implementation slot in 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);
        }
    }
}

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

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

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

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

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

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

File 6 of 20 : draft-IERC1822.sol
// 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);
}

File 7 of 20 : 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);
}

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

pragma solidity ^0.8.20;

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

File 9 of 20 : ERC1967Utils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.21;

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

File 10 of 20 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.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, ) = recipient.call{value: amount}("");
        if (!success) {
            revert Errors.FailedCall();
        }
    }

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

File 11 of 20 : 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);
}

File 12 of 20 : StorageSlot.sol
// 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 13 of 20 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

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

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }
}

File 14 of 20 : RequestHandlerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {SedaDataTypes} from "../../libraries/SedaDataTypes.sol";
import {IRequestHandler} from "../../interfaces/IRequestHandler.sol";

/// @title RequestHandler
/// @notice Implements the RequestHandlerBase for managing Seda protocol requests
abstract contract RequestHandlerBase is IRequestHandler {
    // ============ Constants ============

    // Define a unique storage slot for RequestHandlerBase
    bytes32 private constant REQUEST_HANDLER_STORAGE_SLOT =
        keccak256(abi.encode(uint256(keccak256("seda.requesthandler.storage")) - 1)) & ~bytes32(uint256(0xff));

    // ============ Storage ============

    /// @custom:storage-location erc7201:seda.requesthandler.storage
    struct RequestHandlerStorage {
        // Mapping of request IDs to Request structs
        mapping(bytes32 => SedaDataTypes.Request) requests;
    }

    // ============ External Functions ============

    /// @notice Derives a request ID from the given inputs
    /// @param inputs The request inputs
    /// @return The derived request ID
    function deriveRequestId(SedaDataTypes.RequestInputs calldata inputs) external pure returns (bytes32) {
        return SedaDataTypes.deriveRequestId(inputs);
    }

    // ============ Public Functions ============

    /// @inheritdoc IRequestHandler
    function postRequest(
        SedaDataTypes.RequestInputs calldata inputs
    ) public virtual override(IRequestHandler) returns (bytes32) {
        if (inputs.replicationFactor == 0) {
            revert InvalidReplicationFactor();
        }

        bytes32 requestId = SedaDataTypes.deriveRequestId(inputs);
        if (bytes(_requestHandlerStorage().requests[requestId].version).length != 0) {
            revert RequestAlreadyExists(requestId);
        }

        _requestHandlerStorage().requests[requestId] = SedaDataTypes.Request({
            version: SedaDataTypes.VERSION,
            execProgramId: inputs.execProgramId,
            execInputs: inputs.execInputs,
            execGasLimit: inputs.execGasLimit,
            tallyProgramId: inputs.tallyProgramId,
            tallyInputs: inputs.tallyInputs,
            tallyGasLimit: inputs.tallyGasLimit,
            replicationFactor: inputs.replicationFactor,
            consensusFilter: inputs.consensusFilter,
            gasPrice: inputs.gasPrice,
            memo: inputs.memo
        });

        emit RequestPosted(requestId);
        return requestId;
    }

    /// @inheritdoc IRequestHandler
    function getRequest(
        bytes32 requestId
    ) public view virtual override(IRequestHandler) returns (SedaDataTypes.Request memory) {
        SedaDataTypes.Request memory request = _requestHandlerStorage().requests[requestId];
        // Version field is always set
        if (bytes(request.version).length == 0) {
            revert RequestNotFound(requestId);
        }

        return _requestHandlerStorage().requests[requestId];
    }

    // ============ Internal Functions ============

    /// @notice Returns the storage struct for the contract
    /// @dev Uses ERC-7201 storage pattern to access the storage struct at a specific slot
    /// @return s The storage struct containing the contract's state variables
    function _requestHandlerStorage() internal pure returns (RequestHandlerStorage storage s) {
        bytes32 slot = REQUEST_HANDLER_STORAGE_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := slot
        }
    }
}

File 15 of 20 : ResultHandlerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import {SedaDataTypes} from "../../libraries/SedaDataTypes.sol";
import {IProver} from "../../interfaces/IProver.sol";
import {IResultHandler} from "../../interfaces/IResultHandler.sol";

/// @title ResultHandler
/// @notice Implements the ResultHandlerBase for managing Seda protocol results
abstract contract ResultHandlerBase is IResultHandler, Initializable {
    // ============ Constants ============

    // Define a unique storage slot for ResultHandlerBase
    bytes32 private constant RESULT_HANDLER_STORAGE_SLOT =
        keccak256(abi.encode(uint256(keccak256("seda.resulthandler.storage")) - 1)) & ~bytes32(uint256(0xff));

    // ============ Storage ============

    /// @custom:storage-location erc7201:seda.resulthandler.storage
    struct ResultHandlerStorage {
        IProver sedaProver;
        // Mapping of request IDs to Result structs
        mapping(bytes32 => SedaDataTypes.Result) results;
    }

    // ============ Constructor & Initializer ============

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

    /// @notice Initializes the ResultHandler contract
    /// @dev Sets up the contract with the provided Seda prover address
    /// @param sedaProverAddress The address of the Seda prover contract
    // solhint-disable-next-line func-name-mixedcase
    function __ResultHandler_init(address sedaProverAddress) internal onlyInitializing {
        _resultHandlerStorage().sedaProver = IProver(sedaProverAddress);
    }

    // ============ External Functions ============

    /// @inheritdoc IResultHandler
    function getSedaProver() external view override(IResultHandler) returns (address) {
        return address(_resultHandlerStorage().sedaProver);
    }

    /// @notice Verifies the result without storing it
    /// @param result The result to verify
    /// @param batchHeight The height of the batch the result belongs to
    /// @param proof The proof associated with the result
    /// @return A boolean indicating whether the result is valid
    function verifyResult(
        SedaDataTypes.Result calldata result,
        uint64 batchHeight,
        bytes32[] calldata proof
    ) external view returns (bytes32) {
        bytes32 resultId = SedaDataTypes.deriveResultId(result);
        if (!_resultHandlerStorage().sedaProver.verifyResultProof(resultId, batchHeight, proof)) {
            revert InvalidResultProof(resultId);
        }

        return resultId;
    }

    /// @notice Derives a result ID from the given result
    /// @param result The result data
    /// @return The derived result ID
    function deriveResultId(SedaDataTypes.Result calldata result) external pure returns (bytes32) {
        return SedaDataTypes.deriveResultId(result);
    }

    // ============ Public Functions ============

    /// @inheritdoc IResultHandler
    function postResult(
        SedaDataTypes.Result calldata result,
        uint64 batchHeight,
        bytes32[] calldata proof
    ) public virtual override(IResultHandler) returns (bytes32) {
        bytes32 resultId = SedaDataTypes.deriveResultId(result);
        if (_resultHandlerStorage().results[result.drId].drId != bytes32(0)) {
            revert ResultAlreadyExists(resultId);
        }
        if (!_resultHandlerStorage().sedaProver.verifyResultProof(resultId, batchHeight, proof)) {
            revert InvalidResultProof(resultId);
        }

        _resultHandlerStorage().results[result.drId] = result;

        emit ResultPosted(resultId);
        return resultId;
    }

    /// @inheritdoc IResultHandler
    function getResult(bytes32 requestId) public view override(IResultHandler) returns (SedaDataTypes.Result memory) {
        SedaDataTypes.Result memory result = _resultHandlerStorage().results[requestId];
        if (bytes(result.version).length == 0) {
            revert ResultNotFound(requestId);
        }
        return _resultHandlerStorage().results[requestId];
    }

    // ============ Internal Functions ============

    /// @notice Returns the storage struct for the contract
    /// @dev Uses ERC-7201 storage pattern to access the storage struct at a specific slot
    /// @return s The storage struct containing the contract's state variables
    function _resultHandlerStorage() private pure returns (ResultHandlerStorage storage s) {
        bytes32 slot = RESULT_HANDLER_STORAGE_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := slot
        }
    }
}

File 16 of 20 : IProver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {SedaDataTypes} from "../libraries/SedaDataTypes.sol";

/// @title IProver Interface
/// @notice Interface for the Prover contract in the Seda protocol
interface IProver {
    event BatchPosted(uint256 indexed batchHeight, bytes32 batchHash);

    /// @notice Gets the height of the most recently posted batch
    /// @return uint64 The height of the last batch, 0 if no batches exist
    function getLastBatchHeight() external view returns (uint64);

    /// @notice Posts a new batch with new data and validator proofs
    /// @param newBatch The new batch data to be posted
    /// @param signatures Array of signatures validating the new batch
    /// @param validatorProofs Array of validator proofs, each containing validator data and a Merkle proof
    function postBatch(
        SedaDataTypes.Batch calldata newBatch,
        bytes[] calldata signatures,
        SedaDataTypes.ValidatorProof[] calldata validatorProofs
    ) external;

    /// @notice Verifies a result Merkle proof
    /// @param resultId The ID of the result to verify
    /// @param batchHeight The height of the batch to verify the result proof for
    /// @param merkleProof The Merkle proof to be verified
    /// @return bool Returns true if the Merkle proof is valid, false otherwise
    function verifyResultProof(
        bytes32 resultId,
        uint64 batchHeight,
        bytes32[] calldata merkleProof
    ) external view returns (bool);
}

File 17 of 20 : IRequestHandler.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {SedaDataTypes} from "../libraries/SedaDataTypes.sol";

/// @title IRequestHandler
/// @notice Interface for the Request Handler contract.
interface IRequestHandler {
    error InvalidReplicationFactor();
    error RequestAlreadyExists(bytes32);
    error RequestNotFound(bytes32);

    event RequestPosted(bytes32 indexed requestId);

    /// @notice Retrieves a stored data request by its unique identifier.
    /// @param id The unique identifier of the request to retrieve.
    /// @return request The details of the requested data.
    function getRequest(bytes32 id) external view returns (SedaDataTypes.Request memory);

    /// @notice Allows users to post a new data request.
    /// @param inputs The input parameters for the data request.
    /// @return requestId The unique identifier for the posted request.
    function postRequest(SedaDataTypes.RequestInputs calldata inputs) external returns (bytes32);
}

File 18 of 20 : IResultHandler.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {SedaDataTypes} from "../libraries/SedaDataTypes.sol";

/// @title IResultHandler
/// @notice Interface for handling result posting and retrieval
interface IResultHandler {
    error InvalidResultProof(bytes32);
    error ResultAlreadyExists(bytes32);
    error ResultNotFound(bytes32);

    event ResultPosted(bytes32 indexed resultId);

    /// @notice Retrieves a result by its ID
    /// @param requestId The unique identifier of the request
    /// @return The result data associated with the given ID
    function getResult(bytes32 requestId) external view returns (SedaDataTypes.Result memory);

    /// @notice Posts a new result with a proof
    /// @param result The result data to be posted
    /// @param batchHeight The height of the batch the result belongs to
    /// @param proof The proof associated with the result
    /// @return resultId The unique identifier of the posted result
    function postResult(
        SedaDataTypes.Result calldata result,
        uint64 batchHeight,
        bytes32[] memory proof
    ) external returns (bytes32);

    /// @notice Returns the address of the Seda prover contract
    /// @return The address of the Seda prover contract
    function getSedaProver() external view returns (address);
}

File 19 of 20 : ISedaCore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {IResultHandler} from "./IResultHandler.sol";
import {IRequestHandler} from "./IRequestHandler.sol";
import {SedaDataTypes} from "../libraries/SedaDataTypes.sol";

/// @title ISedaCoreV1
/// @notice Interface for the main Seda protocol contract that handles both requests and results
interface ISedaCore is IResultHandler, IRequestHandler {
    /// @notice Retrieves a paginated list of pending requests
    /// @param offset The starting position in the list
    /// @param limit The maximum number of requests to return
    /// @return An array of Request structs
    function getPendingRequests(uint256 offset, uint256 limit) external view returns (SedaDataTypes.Request[] memory);
}

File 20 of 20 : SedaDataTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

// TODO: Rearrange struct fields to minimize storage gaps and optimize packing

/// @title SedaDataTypes Library
/// @notice Contains data structures and utility functions for the SEDA protocol
library SedaDataTypes {
    string internal constant VERSION = "0.0.1";

    /// @notice Input parameters for creating a data request
    struct RequestInputs {
        /// Identifier of Execution WASM binary
        bytes32 execProgramId;
        /// Inputs for Execution WASM binary
        bytes execInputs;
        /// Maximum of gas units for DR Execution
        uint64 execGasLimit;
        /// Identifier of Tally WASM binary
        bytes32 tallyProgramId;
        /// Inputs for Tally WASM binary
        bytes tallyInputs;
        /// Maximum of gas units for DR Tally
        uint64 tallyGasLimit;
        /// Amount of required DR executors
        uint16 replicationFactor;
        /// Filter applied before tally execution
        bytes consensusFilter;
        /// Amount of SEDA tokens per gas unit
        uint128 gasPrice;
        /// Public info attached to DR
        bytes memo;
    }

    /// @notice Full data request structure
    struct Request {
        /// Semantic Version
        string version;
        // DR definition
        /// Identifier of Execution WASM binary
        bytes32 execProgramId;
        /// Inputs for Execution WASM binary
        bytes execInputs;
        /// Maximum of gas units for DR Execution
        uint64 execGasLimit;
        /// Identifier of Tally WASM binary
        bytes32 tallyProgramId;
        /// Inputs for Tally WASM binary
        bytes tallyInputs;
        /// Maximum of gas units for DR Tally
        uint64 tallyGasLimit;
        /// Amount of required DR executors
        uint16 replicationFactor;
        /// Filter to be applied before tally execution
        bytes consensusFilter;
        /// Amount of SEDA tokens per gas unit
        uint128 gasPrice;
        /// Public info attached to DR
        bytes memo;
    }

    /// @notice Result of a data request execution
    struct Result {
        /// Semantic Version
        string version;
        /// Data Request Identifier
        bytes32 drId;
        /// True or false whether the reveal results are in consensus or not (≥ 66%)
        bool consensus;
        /// Exit code of Tally WASM binary execution
        uint8 exitCode;
        /// Result from Tally WASM binary execution
        bytes result;
        /// Block Height at which data request was finalized
        uint64 blockHeight;
        /// The timestamp of the block the data result is included
        uint64 blockTimestamp;
        /// Gas used by the complete data request execution
        uint64 gasUsed;
        // Fields from Data Request Execution
        /// Payback address set by the relayer
        bytes paybackAddress;
        /// Payload set by SEDA Protocol (e.g. OEV-enabled data requests)
        bytes sedaPayload;
    }

    /// @notice Represents a batch of data request results
    /// @dev This struct is used in the batch verification process
    struct Batch {
        uint64 batchHeight;
        uint64 blockHeight;
        bytes32 validatorsRoot;
        bytes32 resultsRoot;
        bytes32 provingMetadata;
    }

    /// @notice Proof structure for validator verification
    /// @dev Used in the validator set verification process
    struct ValidatorProof {
        uint32 votingPower;
        address signer;
        bytes32[] merkleProof;
    }

    /// @notice Derives a unique batch ID from a Batch struct
    /// @param batch The Batch struct to derive the ID from
    /// @return The derived batch ID
    function deriveBatchId(Batch memory batch) internal pure returns (bytes32) {
        return
            keccak256(
                bytes.concat(
                    bytes8(batch.batchHeight),
                    bytes8(batch.blockHeight),
                    batch.validatorsRoot,
                    batch.resultsRoot,
                    batch.provingMetadata
                )
            );
    }

    /// @notice Derives a unique result ID from a Result struct
    /// @param result The Result struct to derive the ID from
    /// @return The derived result ID
    function deriveResultId(Result memory result) internal pure returns (bytes32) {
        return
            keccak256(
                bytes.concat(
                    keccak256(bytes(SedaDataTypes.VERSION)),
                    result.drId,
                    result.consensus ? bytes1(0x01) : bytes1(0x00),
                    bytes1(result.exitCode),
                    keccak256(result.result),
                    bytes8(result.blockHeight),
                    bytes8(result.blockTimestamp),
                    bytes8(result.gasUsed),
                    keccak256(result.paybackAddress),
                    keccak256(result.sedaPayload)
                )
            );
    }

    /// @notice Derives a unique request ID from RequestInputs
    /// @param inputs The RequestInputs struct to derive the ID from
    /// @return The derived request ID
    function deriveRequestId(RequestInputs memory inputs) internal pure returns (bytes32) {
        return
            keccak256(
                bytes.concat(
                    keccak256(bytes(SedaDataTypes.VERSION)),
                    inputs.execProgramId,
                    keccak256(inputs.execInputs),
                    bytes8(inputs.execGasLimit),
                    inputs.tallyProgramId,
                    keccak256(inputs.tallyInputs),
                    bytes8(inputs.tallyGasLimit),
                    bytes2(inputs.replicationFactor),
                    keccak256(inputs.consensusFilter),
                    bytes16(inputs.gasPrice),
                    keccak256(inputs.memo)
                )
            );
    }
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidReplicationFactor","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"InvalidResultProof","type":"error"},{"inputs":[{"internalType":"bytes32","name":"drId","type":"bytes32"},{"internalType":"uint256","name":"resultTimestamp","type":"uint256"},{"internalType":"uint256","name":"requestTimestamp","type":"uint256"}],"name":"InvalidResultTimestamp","type":"error"},{"inputs":[],"name":"NotInitializing","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":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"RequestAlreadyExists","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"RequestNotFound","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ResultAlreadyExists","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ResultNotFound","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":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"RequestPosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"resultId","type":"bytes32"}],"name":"ResultPosted","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":[{"components":[{"internalType":"bytes32","name":"execProgramId","type":"bytes32"},{"internalType":"bytes","name":"execInputs","type":"bytes"},{"internalType":"uint64","name":"execGasLimit","type":"uint64"},{"internalType":"bytes32","name":"tallyProgramId","type":"bytes32"},{"internalType":"bytes","name":"tallyInputs","type":"bytes"},{"internalType":"uint64","name":"tallyGasLimit","type":"uint64"},{"internalType":"uint16","name":"replicationFactor","type":"uint16"},{"internalType":"bytes","name":"consensusFilter","type":"bytes"},{"internalType":"uint128","name":"gasPrice","type":"uint128"},{"internalType":"bytes","name":"memo","type":"bytes"}],"internalType":"struct SedaDataTypes.RequestInputs","name":"inputs","type":"tuple"}],"name":"deriveRequestId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"version","type":"string"},{"internalType":"bytes32","name":"drId","type":"bytes32"},{"internalType":"bool","name":"consensus","type":"bool"},{"internalType":"uint8","name":"exitCode","type":"uint8"},{"internalType":"bytes","name":"result","type":"bytes"},{"internalType":"uint64","name":"blockHeight","type":"uint64"},{"internalType":"uint64","name":"blockTimestamp","type":"uint64"},{"internalType":"uint64","name":"gasUsed","type":"uint64"},{"internalType":"bytes","name":"paybackAddress","type":"bytes"},{"internalType":"bytes","name":"sedaPayload","type":"bytes"}],"internalType":"struct SedaDataTypes.Result","name":"result","type":"tuple"}],"name":"deriveResultId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getPendingRequests","outputs":[{"components":[{"internalType":"string","name":"version","type":"string"},{"internalType":"bytes32","name":"execProgramId","type":"bytes32"},{"internalType":"bytes","name":"execInputs","type":"bytes"},{"internalType":"uint64","name":"execGasLimit","type":"uint64"},{"internalType":"bytes32","name":"tallyProgramId","type":"bytes32"},{"internalType":"bytes","name":"tallyInputs","type":"bytes"},{"internalType":"uint64","name":"tallyGasLimit","type":"uint64"},{"internalType":"uint16","name":"replicationFactor","type":"uint16"},{"internalType":"bytes","name":"consensusFilter","type":"bytes"},{"internalType":"uint128","name":"gasPrice","type":"uint128"},{"internalType":"bytes","name":"memo","type":"bytes"}],"internalType":"struct SedaDataTypes.Request[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"getRequest","outputs":[{"components":[{"internalType":"string","name":"version","type":"string"},{"internalType":"bytes32","name":"execProgramId","type":"bytes32"},{"internalType":"bytes","name":"execInputs","type":"bytes"},{"internalType":"uint64","name":"execGasLimit","type":"uint64"},{"internalType":"bytes32","name":"tallyProgramId","type":"bytes32"},{"internalType":"bytes","name":"tallyInputs","type":"bytes"},{"internalType":"uint64","name":"tallyGasLimit","type":"uint64"},{"internalType":"uint16","name":"replicationFactor","type":"uint16"},{"internalType":"bytes","name":"consensusFilter","type":"bytes"},{"internalType":"uint128","name":"gasPrice","type":"uint128"},{"internalType":"bytes","name":"memo","type":"bytes"}],"internalType":"struct SedaDataTypes.Request","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"getResult","outputs":[{"components":[{"internalType":"string","name":"version","type":"string"},{"internalType":"bytes32","name":"drId","type":"bytes32"},{"internalType":"bool","name":"consensus","type":"bool"},{"internalType":"uint8","name":"exitCode","type":"uint8"},{"internalType":"bytes","name":"result","type":"bytes"},{"internalType":"uint64","name":"blockHeight","type":"uint64"},{"internalType":"uint64","name":"blockTimestamp","type":"uint64"},{"internalType":"uint64","name":"gasUsed","type":"uint64"},{"internalType":"bytes","name":"paybackAddress","type":"bytes"},{"internalType":"bytes","name":"sedaPayload","type":"bytes"}],"internalType":"struct SedaDataTypes.Result","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSedaProver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sedaProverAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"execProgramId","type":"bytes32"},{"internalType":"bytes","name":"execInputs","type":"bytes"},{"internalType":"uint64","name":"execGasLimit","type":"uint64"},{"internalType":"bytes32","name":"tallyProgramId","type":"bytes32"},{"internalType":"bytes","name":"tallyInputs","type":"bytes"},{"internalType":"uint64","name":"tallyGasLimit","type":"uint64"},{"internalType":"uint16","name":"replicationFactor","type":"uint16"},{"internalType":"bytes","name":"consensusFilter","type":"bytes"},{"internalType":"uint128","name":"gasPrice","type":"uint128"},{"internalType":"bytes","name":"memo","type":"bytes"}],"internalType":"struct SedaDataTypes.RequestInputs","name":"inputs","type":"tuple"}],"name":"postRequest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"version","type":"string"},{"internalType":"bytes32","name":"drId","type":"bytes32"},{"internalType":"bool","name":"consensus","type":"bool"},{"internalType":"uint8","name":"exitCode","type":"uint8"},{"internalType":"bytes","name":"result","type":"bytes"},{"internalType":"uint64","name":"blockHeight","type":"uint64"},{"internalType":"uint64","name":"blockTimestamp","type":"uint64"},{"internalType":"uint64","name":"gasUsed","type":"uint64"},{"internalType":"bytes","name":"paybackAddress","type":"bytes"},{"internalType":"bytes","name":"sedaPayload","type":"bytes"}],"internalType":"struct SedaDataTypes.Result","name":"result","type":"tuple"},{"internalType":"uint64","name":"batchHeight","type":"uint64"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"postResult","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"version","type":"string"},{"internalType":"bytes32","name":"drId","type":"bytes32"},{"internalType":"bool","name":"consensus","type":"bool"},{"internalType":"uint8","name":"exitCode","type":"uint8"},{"internalType":"bytes","name":"result","type":"bytes"},{"internalType":"uint64","name":"blockHeight","type":"uint64"},{"internalType":"uint64","name":"blockTimestamp","type":"uint64"},{"internalType":"uint64","name":"gasUsed","type":"uint64"},{"internalType":"bytes","name":"paybackAddress","type":"bytes"},{"internalType":"bytes","name":"sedaPayload","type":"bytes"}],"internalType":"struct SedaDataTypes.Result","name":"result","type":"tuple"},{"internalType":"uint64","name":"batchHeight","type":"uint64"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"verifyResult","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]

60a0604052306080523480156200001557600080fd5b506200002062000030565b6200002a62000030565b620000e4565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000815760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000e15780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60805161315e6200010e600039600081816115520152818161157b01526116aa015261315e6000f3fe6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063c4d66de811610059578063c4d66de8146102cc578063f2fde38b146102ec578063fb1e61ca1461030c578063fc6e21da1461033957600080fd5b80638da5cb5b14610204578063a027200c14610241578063ad3cb1cc14610261578063add4c7841461029f57600080fd5b80636532bb62116100c65780636532bb6214610182578063715018a6146101a257806379e041f2146101b75780637d49749d146101e457600080fd5b80632d321b28146100f85780634f1ef2861461012a57806352d1902d1461013f578063591fbf9214610162575b600080fd5b34801561010457600080fd5b5061010d610359565b6040516001600160a01b0390911681526020015b60405180910390f35b61013d6101383660046124b7565b610372565b005b34801561014b57600080fd5b50610154610391565b604051908152602001610121565b34801561016e57600080fd5b5061015461017d36600461253d565b6103ae565b34801561018e57600080fd5b5061015461019d3660046125e5565b610486565b3480156101ae57600080fd5b5061013d6104bf565b3480156101c357600080fd5b506101d76101d2366004612621565b6104d3565b604051610121919061279b565b3480156101f057600080fd5b506101546101ff3660046125e5565b610609565b34801561021057600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031661010d565b34801561024d57600080fd5b5061015461025c36600461253d565b61061c565b34801561026d57600080fd5b50610292604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161012191906127ff565b3480156102ab57600080fd5b506102bf6102ba366004612812565b6106d8565b604051610121919061282b565b3480156102d857600080fd5b5061013d6102e7366004612920565b610cfb565b3480156102f857600080fd5b5061013d610307366004612920565b610e1a565b34801561031857600080fd5b5061032c610327366004612812565b610e58565b604051610121919061293b565b34801561034557600080fd5b506101546103543660046125e5565b6114d7565b60006103636114e5565b546001600160a01b0316919050565b61037a611547565b610383826115d5565b61038d82826115dd565b5050565b600061039b61169f565b5060008051602061310983398151915290565b6000806103b96116e8565b6020808801356000908152600292909201905260409020549050806103e460e0880160c0890161294e565b6001600160401b03161161043e57602086013561040760e0880160c0890161294e565b60405163e3bf412560e01b815260048101929092526001600160401b03166024820152604481018290526064015b60405180910390fd5b600061044c87878787611719565b905061045b876020013561186e565b6104636116e8565b602080890135600090815260029290920190526040812055915050949350505050565b60008061049283611880565b905061049d81611c27565b426104a66116e8565b6000838152600291909101602052604090205592915050565b6104c7611c39565b6104d16000611c94565b565b606060006104e76104e26116e8565b611d05565b905080841061052a576040805160008082526020820190925290610521565b61050e612372565b8152602001906001900390816105065790505b50915050610603565b6000816105378587612981565b11610542578361054c565b61054c8583612994565b90506000816001600160401b03811115610568576105686123ec565b6040519080825280602002602001820160405280156105a157816020015b61058e612372565b8152602001906001900390816105865790505b50905060005b828110156105fd5760006105cc6105be838a612981565b6105c66116e8565b90611d0f565b90506105d781610e58565b8383815181106105e9576105e96129a7565b6020908102919091010152506001016105a7565b50925050505b92915050565b6000610603610617836129e6565b611d22565b60008061063061062b87612b30565b611e47565b905061063a6114e5565b54604051635a01e0ab60e01b81526001600160a01b0390911690635a01e0ab9061066e908490899089908990600401612c31565b602060405180830381865afa15801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af9190612c82565b6106cf5760405163a03374c560e01b815260048101829052602401610435565b95945050505050565b604080516101408101825260608082526000602083018190529282018390528082018390526080820181905260a0820183905260c0820183905260e082018390526101008201819052610120820152906107306114e5565b60010160008481526020019081526020016000206040518061014001604052908160008201805461076090612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461078c90612c9f565b80156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b505050918352505060018201546020820152600282015460ff8082161515604084015261010090910416606082015260038201805460809092019161081d90612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461084990612c9f565b80156108965780601f1061086b57610100808354040283529160200191610896565b820191906000526020600020905b81548152906001019060200180831161087957829003601f168201915b505050918352505060048201546001600160401b038082166020840152600160401b820481166040840152600160801b9091041660608201526005820180546080909201916108e490612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461091090612c9f565b801561095d5780601f106109325761010080835404028352916020019161095d565b820191906000526020600020905b81548152906001019060200180831161094057829003601f168201915b5050505050815260200160068201805461097690612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546109a290612c9f565b80156109ef5780601f106109c4576101008083540402835291602001916109ef565b820191906000526020600020905b8154815290600101906020018083116109d257829003601f168201915b5050505050815250509050806000015151600003610a23576040516372fceee960e01b815260048101849052602401610435565b610a2b6114e5565b600101600084815260200190815260200160002060405180610140016040529081600082018054610a5b90612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8790612c9f565b8015610ad45780601f10610aa957610100808354040283529160200191610ad4565b820191906000526020600020905b815481529060010190602001808311610ab757829003601f168201915b505050918352505060018201546020820152600282015460ff80821615156040840152610100909104166060820152600382018054608090920191610b1890612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4490612c9f565b8015610b915780601f10610b6657610100808354040283529160200191610b91565b820191906000526020600020905b815481529060010190602001808311610b7457829003601f168201915b505050918352505060048201546001600160401b038082166020840152600160401b820481166040840152600160801b909104166060820152600582018054608090920191610bdf90612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c0b90612c9f565b8015610c585780601f10610c2d57610100808354040283529160200191610c58565b820191906000526020600020905b815481529060010190602001808311610c3b57829003601f168201915b50505050508152602001600682018054610c7190612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9d90612c9f565b8015610cea5780601f10610cbf57610100808354040283529160200191610cea565b820191906000526020600020905b815481529060010190602001808311610ccd57829003601f168201915b505050505081525050915050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610d405750825b90506000826001600160401b03166001148015610d5c5750303b155b905081158015610d6a575080155b15610d885760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610db257845460ff60401b1916600160401b1785555b610dbb86611f59565b610dc433611f8b565b610dcc611f9c565b8315610e1257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b610e22611c39565b6001600160a01b038116610e4c57604051631e4fbdf760e01b815260006004820152602401610435565b610e5581611c94565b50565b610e60612372565b6000610e6a611fa4565b600084815260209190915260409081902081516101608101909252805482908290610e9490612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec090612c9f565b8015610f0d5780601f10610ee257610100808354040283529160200191610f0d565b820191906000526020600020905b815481529060010190602001808311610ef057829003601f168201915b5050505050815260200160018201548152602001600282018054610f3090612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c90612c9f565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050918352505060038201546001600160401b0316602082015260048201546040820152600582018054606090920191610fe390612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461100f90612c9f565b801561105c5780601f106110315761010080835404028352916020019161105c565b820191906000526020600020905b81548152906001019060200180831161103f57829003601f168201915b505050918352505060068201546001600160401b0381166020830152600160401b900461ffff16604082015260078201805460609092019161109d90612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546110c990612c9f565b80156111165780601f106110eb57610100808354040283529160200191611116565b820191906000526020600020905b8154815290600101906020018083116110f957829003601f168201915b505050918352505060088201546001600160801b0316602082015260098201805460409092019161114690612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461117290612c9f565b80156111bf5780601f10611194576101008083540402835291602001916111bf565b820191906000526020600020905b8154815290600101906020018083116111a257829003601f168201915b50505050508152505090508060000151516000036111f357604051630d1c383160e11b815260048101849052602401610435565b6111fb611fa4565b60008481526020919091526040908190208151610160810190925280548290829061122590612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461125190612c9f565b801561129e5780601f106112735761010080835404028352916020019161129e565b820191906000526020600020905b81548152906001019060200180831161128157829003601f168201915b50505050508152602001600182015481526020016002820180546112c190612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546112ed90612c9f565b801561133a5780601f1061130f5761010080835404028352916020019161133a565b820191906000526020600020905b81548152906001019060200180831161131d57829003601f168201915b505050918352505060038201546001600160401b031660208201526004820154604082015260058201805460609092019161137490612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546113a090612c9f565b80156113ed5780601f106113c2576101008083540402835291602001916113ed565b820191906000526020600020905b8154815290600101906020018083116113d057829003601f168201915b505050918352505060068201546001600160401b0381166020830152600160401b900461ffff16604082015260078201805460609092019161142e90612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461145a90612c9f565b80156114a75780601f1061147c576101008083540402835291602001916114a7565b820191906000526020600020905b81548152906001019060200180831161148a57829003601f168201915b505050918352505060088201546001600160801b03166020820152600982018054604090920191610c7190612c9f565b600061060361062b83612b30565b60008060ff1961151660017fc6615bff908872cc0bd80dcc616c0d42beb2d17521bf5a6e4f8d19a3b3cd0fb3612994565b60405160200161152891815260200190565b60408051601f1981840301815291905280516020909101201692915050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806115b757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115ab611fd5565b6001600160a01b031614155b156104d15760405163703e46dd60e11b815260040160405180910390fd5b610e55611c39565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611637575060408051601f3d908101601f1916820190925261163491810190612cd3565b60015b61165f57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610435565b600080516020613109833981519152811461169057604051632a87526960e21b815260048101829052602401610435565b61169a8383611feb565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104d15760405163703e46dd60e11b815260040160405180910390fd5b60008060ff1961151660017f122b98a62ebc3d7472f97caad9665737c60fdd5c274c93d70314bc6eb3ad65b8612994565b60008061172861062b87612b30565b905060006117346114e5565b60010160008860200135815260200190815260200160002060010154146117715760405163a588189160e01b815260048101829052602401610435565b6117796114e5565b54604051635a01e0ab60e01b81526001600160a01b0390911690635a01e0ab906117ad908490899089908990600401612c31565b602060405180830381865afa1580156117ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ee9190612c82565b61180e5760405163a03374c560e01b815260048101829052602401610435565b856118176114e5565b60208089013560009081526001929092019052604090206118388282612e68565b505060405181907f81e789a770fdc2e6e009e9be246fc51402584f3d45c9111826004247c3ac5f7190600090a295945050505050565b61038d8161187a6116e8565b90612041565b600061189260e0830160c08401612fe1565b61ffff166000036118b65760405163691dcbf960e11b815260040160405180910390fd5b60006118c4610617846129e6565b90506118ce611fa4565b60008281526020919091526040902080546118e890612c9f565b15905061190b576040516376f74a2d60e11b815260048101829052602401610435565b604080516101a0810182526005610160820190815264302e302e3160d81b61018083015281528435602080830191909152909182019061194d90860186612cec565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611997606086016040870161294e565b6001600160401b03168152606085013560208201526040016119bc6080860186612cec565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611a0660c0860160a0870161294e565b6001600160401b03168152602001611a2460e0860160c08701612fe1565b61ffff168152602001611a3a60e0860186612cec565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611a8661012086016101008701612ffc565b6001600160801b03168152602001611aa2610120860186612cec565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250611ae0611fa4565b60008381526020919091526040902081518190611afd9082613017565b506020820151600182015560408201516002820190611b1c9082613017565b50606082015160038201805467ffffffffffffffff19166001600160401b039092169190911790556080820151600482015560a08201516005820190611b629082613017565b5060c082015160068201805460e085015161ffff16600160401b0269ffffffffffffffffffff199091166001600160401b03909316929092179190911790556101008201516007820190611bb69082613017565b506101208201516008820180546001600160801b0319166001600160801b039092169190911790556101408201516009820190611bf39082613017565b50506040518291507f38fa0f6e31e569a333afb42b9f7334a9f0e1229c21d08aeb588cd204d50d7e1f90600090a292915050565b61038d81611c336116e8565b9061204d565b33611c6b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146104d15760405163118cdaa760e01b8152336004820152602401610435565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000610603825490565b6000611d1b8383612059565b9392505050565b6040805180820182526005815264302e302e3160d81b6020918201528251838201518051908301208484015160608087015160808089015180519088012060a08a015160c0808c015160e08d01518051908c01206101008e01516101208f01518051908e01208e517fae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc1991638118859e81019e909e529d8d019b909b52968b019890985295861b6001600160c01b03199081168a85015260888a019490945260a889019190915290931b1660c886015260f09290921b6001600160f01b03191660d085015260d28401919091521b6001600160801b03191660f2820152610102810191909152600090610122015b604051602081830303815290604052805190602001209050919050565b6040805180820182526005815264302e302e3160d81b602091820152820151908201516000917fae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc19916381188591611e9a576000611ea0565b600160f81b5b846060015160f81b8560800151805190602001208660a0015160c01b8760c0015160c01b8860e0015160c01b896101000151805190602001208a610120015180519060200120604051602001611e2a9a99989796959493929190998a5260208a01989098526001600160f81b031996871660408a015294909516604188015260428701929092526001600160c01b03199081166062870152908116606a860152919091166072840152607a830152609a82015260ba0190565b611f61612083565b80611f6a6114e5565b80546001600160a01b0319166001600160a01b039290921691909117905550565b611f93612083565b610e55816120cc565b6104d1612083565b60008060ff1961151660017f12e9c4cc22831c4121abc64356dbc053781d5c177d921daeff3c78903ed333a3612994565b6000600080516020613109833981519152610363565b611ff4826120d4565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156120395761169a828261211f565b61038d61218c565b6000611d1b83836121ab565b6000611d1b838361229e565b6000826000018281548110612070576120706129a7565b9060005260206000200154905092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166104d157604051631afcd79f60e31b815260040160405180910390fd5b610e22612083565b806001600160a01b03163b60000361210a57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610435565b80600080516020613109833981519152611f6a565b6060600080846001600160a01b03168460405161213c91906130d6565b600060405180830381855af49150503d8060008114612177576040519150601f19603f3d011682016040523d82523d6000602084013e61217c565b606091505b50915091506106cf8583836122ed565b34156104d15760405163b398979f60e01b815260040160405180910390fd5b600081815260018301602052604081205480156122945760006121cf600183612994565b85549091506000906121e390600190612994565b9050808214612248576000866000018281548110612203576122036129a7565b9060005260206000200154905080876000018481548110612226576122266129a7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612259576122596130f2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610603565b6000915050610603565b60008181526001830160205260408120546122e557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610603565b506000610603565b606082612302576122fd82612349565b611d1b565b815115801561231957506001600160a01b0384163b155b1561234257604051639996b31560e01b81526001600160a01b0385166004820152602401610435565b5092915050565b8051156123595780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b604080516101608101825260608082526000602083018190529282018190528082018390526080820183905260a0820181905260c0820183905260e08201839052610100820181905261012082019290925261014081019190915290565b80356001600160a01b03811681146123e757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715612425576124256123ec565b60405290565b600082601f83011261243c57600080fd5b81356001600160401b0380821115612456576124566123ec565b604051601f8301601f19908116603f0116810190828211818310171561247e5761247e6123ec565b8160405283815286602085880101111561249757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156124ca57600080fd5b6124d3836123d0565b915060208301356001600160401b038111156124ee57600080fd5b6124fa8582860161242b565b9150509250929050565b6000610140828403121561251757600080fd5b50919050565b6001600160401b0381168114610e5557600080fd5b80356123e78161251d565b6000806000806060858703121561255357600080fd5b84356001600160401b038082111561256a57600080fd5b61257688838901612504565b9550602087013591506125888261251d565b9093506040860135908082111561259e57600080fd5b818701915087601f8301126125b257600080fd5b8135818111156125c157600080fd5b8860208260051b85010111156125d657600080fd5b95989497505060200194505050565b6000602082840312156125f757600080fd5b81356001600160401b0381111561260d57600080fd5b61261984828501612504565b949350505050565b6000806040838503121561263457600080fd5b50508035926020909101359150565b60005b8381101561265e578181015183820152602001612646565b50506000910152565b6000815180845261267f816020860160208601612643565b601f01601f19169290920160200192915050565b600061016082518185526126a982860182612667565b91505060208301516020850152604083015184820360408601526126cd8282612667565b91505060608301516126ea60608601826001600160401b03169052565b506080830151608085015260a083015184820360a086015261270c8282612667565b91505060c083015161272960c08601826001600160401b03169052565b5060e083015161273f60e086018261ffff169052565b5061010080840151858303828701526127588382612667565b9250505061012080840151612777828701826001600160801b03169052565b505061014080840151858303828701526127918382612667565b9695505050505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156127f257603f198886030184526127e0858351612693565b945092850192908501906001016127c4565b5092979650505050505050565b602081526000611d1b6020830184612667565b60006020828403121561282457600080fd5b5035919050565b602081526000825161014080602085015261284a610160850183612667565b9150602085015160408501526040850151612869606086018215159052565b50606085015160ff81166080860152506080850151601f19808685030160a08701526128958483612667565b935060a087015191506128b360c08701836001600160401b03169052565b60c08701516001600160401b03811660e0880152915060e087015191506101006128e7818801846001600160401b03169052565b808801519250506101208187860301818801526129048584612667565b9088015187820390920184880152935090506127918382612667565b60006020828403121561293257600080fd5b611d1b826123d0565b602081526000611d1b6020830184612693565b60006020828403121561296057600080fd5b8135611d1b8161251d565b634e487b7160e01b600052601160045260246000fd5b808201808211156106035761060361296b565b818103818111156106035761060361296b565b634e487b7160e01b600052603260045260246000fd5b803561ffff811681146123e757600080fd5b80356001600160801b03811681146123e757600080fd5b600061014082360312156129f957600080fd5b612a01612402565b8235815260208301356001600160401b0380821115612a1f57600080fd5b612a2b3683870161242b565b6020840152612a3c60408601612532565b6040840152606085013560608401526080850135915080821115612a5f57600080fd5b612a6b3683870161242b565b6080840152612a7c60a08601612532565b60a0840152612a8d60c086016129bd565b60c084015260e0850135915080821115612aa657600080fd5b612ab23683870161242b565b60e08401526101009150612ac78286016129cf565b8284015261012091508185013581811115612ae157600080fd5b612aed3682880161242b565b8385015250505080915050919050565b8015158114610e5557600080fd5b80356123e781612afd565b60ff81168114610e5557600080fd5b80356123e781612b16565b60006101408236031215612b4357600080fd5b612b4b612402565b82356001600160401b0380821115612b6257600080fd5b612b6e3683870161242b565b835260208501356020840152612b8660408601612b0b565b6040840152612b9760608601612b25565b60608401526080850135915080821115612bb057600080fd5b612bbc3683870161242b565b6080840152612bcd60a08601612532565b60a0840152612bde60c08601612532565b60c0840152612bef60e08601612532565b60e084015261010091508185013581811115612c0a57600080fd5b612c163682880161242b565b838501525061012091508185013581811115612ae157600080fd5b8481526001600160401b0384166020820152606060408201819052810182905260006001600160fb1b03831115612c6757600080fd5b8260051b808560808501379190910160800195945050505050565b600060208284031215612c9457600080fd5b8151611d1b81612afd565b600181811c90821680612cb357607f821691505b60208210810361251757634e487b7160e01b600052602260045260246000fd5b600060208284031215612ce557600080fd5b5051919050565b6000808335601e19843603018112612d0357600080fd5b8301803591506001600160401b03821115612d1d57600080fd5b602001915036819003821315612d3257600080fd5b9250929050565b601f82111561169a576000816000526020600020601f850160051c81016020861015612d625750805b601f850160051c820191505b81811015610e1257828155600101612d6e565b6001600160401b03831115612d9857612d986123ec565b612dac83612da68354612c9f565b83612d39565b6000601f841160018114612de05760008515612dc85750838201355b600019600387901b1c1916600186901b178355612e3a565b600083815260209020601f19861690835b82811015612e115786850135825560209485019460019092019101612df1565b5086821015612e2e5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6000813561060381612afd565b6000813561060381612b16565b600081356106038161251d565b612e728283612cec565b612e7d818385612d81565b50506020820135600182015560028101612eb0612e9c60408501612e41565b825490151560ff1660ff1991909116178255565b612ed5612ebf60608501612e4e565b825461ff00191660089190911b61ff0016178255565b50612ee36080830183612cec565b612ef1818360038601612d81565b505060048101612f24612f0660a08501612e5b565b825467ffffffffffffffff19166001600160401b0391909116178255565b612f65612f3360c08501612e5b565b82546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff000000000000000016178255565b612fa0612f7460e08501612e5b565b82805467ffffffffffffffff60801b191660809290921b67ffffffffffffffff60801b16919091179055565b50612faf610100830183612cec565b612fbd818360058601612d81565b5050612fcd610120830183612cec565b612fdb818360068601612d81565b50505050565b600060208284031215612ff357600080fd5b611d1b826129bd565b60006020828403121561300e57600080fd5b611d1b826129cf565b81516001600160401b03811115613030576130306123ec565b6130448161303e8454612c9f565b84612d39565b602080601f83116001811461307957600084156130615750858301515b600019600386901b1c1916600185901b178555610e12565b600085815260208120601f198616915b828110156130a857888601518255948401946001909101908401613089565b50858210156130c65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516130e8818460208701612643565b9190910192915050565b634e487b7160e01b600052603160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220016858eb0f0611b144b808feb47913fd1b722d3be6924825816178856cce541964736f6c63430008180033

Deployed Bytecode

0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063c4d66de811610059578063c4d66de8146102cc578063f2fde38b146102ec578063fb1e61ca1461030c578063fc6e21da1461033957600080fd5b80638da5cb5b14610204578063a027200c14610241578063ad3cb1cc14610261578063add4c7841461029f57600080fd5b80636532bb62116100c65780636532bb6214610182578063715018a6146101a257806379e041f2146101b75780637d49749d146101e457600080fd5b80632d321b28146100f85780634f1ef2861461012a57806352d1902d1461013f578063591fbf9214610162575b600080fd5b34801561010457600080fd5b5061010d610359565b6040516001600160a01b0390911681526020015b60405180910390f35b61013d6101383660046124b7565b610372565b005b34801561014b57600080fd5b50610154610391565b604051908152602001610121565b34801561016e57600080fd5b5061015461017d36600461253d565b6103ae565b34801561018e57600080fd5b5061015461019d3660046125e5565b610486565b3480156101ae57600080fd5b5061013d6104bf565b3480156101c357600080fd5b506101d76101d2366004612621565b6104d3565b604051610121919061279b565b3480156101f057600080fd5b506101546101ff3660046125e5565b610609565b34801561021057600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031661010d565b34801561024d57600080fd5b5061015461025c36600461253d565b61061c565b34801561026d57600080fd5b50610292604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161012191906127ff565b3480156102ab57600080fd5b506102bf6102ba366004612812565b6106d8565b604051610121919061282b565b3480156102d857600080fd5b5061013d6102e7366004612920565b610cfb565b3480156102f857600080fd5b5061013d610307366004612920565b610e1a565b34801561031857600080fd5b5061032c610327366004612812565b610e58565b604051610121919061293b565b34801561034557600080fd5b506101546103543660046125e5565b6114d7565b60006103636114e5565b546001600160a01b0316919050565b61037a611547565b610383826115d5565b61038d82826115dd565b5050565b600061039b61169f565b5060008051602061310983398151915290565b6000806103b96116e8565b6020808801356000908152600292909201905260409020549050806103e460e0880160c0890161294e565b6001600160401b03161161043e57602086013561040760e0880160c0890161294e565b60405163e3bf412560e01b815260048101929092526001600160401b03166024820152604481018290526064015b60405180910390fd5b600061044c87878787611719565b905061045b876020013561186e565b6104636116e8565b602080890135600090815260029290920190526040812055915050949350505050565b60008061049283611880565b905061049d81611c27565b426104a66116e8565b6000838152600291909101602052604090205592915050565b6104c7611c39565b6104d16000611c94565b565b606060006104e76104e26116e8565b611d05565b905080841061052a576040805160008082526020820190925290610521565b61050e612372565b8152602001906001900390816105065790505b50915050610603565b6000816105378587612981565b11610542578361054c565b61054c8583612994565b90506000816001600160401b03811115610568576105686123ec565b6040519080825280602002602001820160405280156105a157816020015b61058e612372565b8152602001906001900390816105865790505b50905060005b828110156105fd5760006105cc6105be838a612981565b6105c66116e8565b90611d0f565b90506105d781610e58565b8383815181106105e9576105e96129a7565b6020908102919091010152506001016105a7565b50925050505b92915050565b6000610603610617836129e6565b611d22565b60008061063061062b87612b30565b611e47565b905061063a6114e5565b54604051635a01e0ab60e01b81526001600160a01b0390911690635a01e0ab9061066e908490899089908990600401612c31565b602060405180830381865afa15801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af9190612c82565b6106cf5760405163a03374c560e01b815260048101829052602401610435565b95945050505050565b604080516101408101825260608082526000602083018190529282018390528082018390526080820181905260a0820183905260c0820183905260e082018390526101008201819052610120820152906107306114e5565b60010160008481526020019081526020016000206040518061014001604052908160008201805461076090612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461078c90612c9f565b80156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b505050918352505060018201546020820152600282015460ff8082161515604084015261010090910416606082015260038201805460809092019161081d90612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461084990612c9f565b80156108965780601f1061086b57610100808354040283529160200191610896565b820191906000526020600020905b81548152906001019060200180831161087957829003601f168201915b505050918352505060048201546001600160401b038082166020840152600160401b820481166040840152600160801b9091041660608201526005820180546080909201916108e490612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461091090612c9f565b801561095d5780601f106109325761010080835404028352916020019161095d565b820191906000526020600020905b81548152906001019060200180831161094057829003601f168201915b5050505050815260200160068201805461097690612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546109a290612c9f565b80156109ef5780601f106109c4576101008083540402835291602001916109ef565b820191906000526020600020905b8154815290600101906020018083116109d257829003601f168201915b5050505050815250509050806000015151600003610a23576040516372fceee960e01b815260048101849052602401610435565b610a2b6114e5565b600101600084815260200190815260200160002060405180610140016040529081600082018054610a5b90612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8790612c9f565b8015610ad45780601f10610aa957610100808354040283529160200191610ad4565b820191906000526020600020905b815481529060010190602001808311610ab757829003601f168201915b505050918352505060018201546020820152600282015460ff80821615156040840152610100909104166060820152600382018054608090920191610b1890612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4490612c9f565b8015610b915780601f10610b6657610100808354040283529160200191610b91565b820191906000526020600020905b815481529060010190602001808311610b7457829003601f168201915b505050918352505060048201546001600160401b038082166020840152600160401b820481166040840152600160801b909104166060820152600582018054608090920191610bdf90612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c0b90612c9f565b8015610c585780601f10610c2d57610100808354040283529160200191610c58565b820191906000526020600020905b815481529060010190602001808311610c3b57829003601f168201915b50505050508152602001600682018054610c7190612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9d90612c9f565b8015610cea5780601f10610cbf57610100808354040283529160200191610cea565b820191906000526020600020905b815481529060010190602001808311610ccd57829003601f168201915b505050505081525050915050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610d405750825b90506000826001600160401b03166001148015610d5c5750303b155b905081158015610d6a575080155b15610d885760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610db257845460ff60401b1916600160401b1785555b610dbb86611f59565b610dc433611f8b565b610dcc611f9c565b8315610e1257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b610e22611c39565b6001600160a01b038116610e4c57604051631e4fbdf760e01b815260006004820152602401610435565b610e5581611c94565b50565b610e60612372565b6000610e6a611fa4565b600084815260209190915260409081902081516101608101909252805482908290610e9490612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec090612c9f565b8015610f0d5780601f10610ee257610100808354040283529160200191610f0d565b820191906000526020600020905b815481529060010190602001808311610ef057829003601f168201915b5050505050815260200160018201548152602001600282018054610f3090612c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5c90612c9f565b8015610fa95780601f10610f7e57610100808354040283529160200191610fa9565b820191906000526020600020905b815481529060010190602001808311610f8c57829003601f168201915b505050918352505060038201546001600160401b0316602082015260048201546040820152600582018054606090920191610fe390612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461100f90612c9f565b801561105c5780601f106110315761010080835404028352916020019161105c565b820191906000526020600020905b81548152906001019060200180831161103f57829003601f168201915b505050918352505060068201546001600160401b0381166020830152600160401b900461ffff16604082015260078201805460609092019161109d90612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546110c990612c9f565b80156111165780601f106110eb57610100808354040283529160200191611116565b820191906000526020600020905b8154815290600101906020018083116110f957829003601f168201915b505050918352505060088201546001600160801b0316602082015260098201805460409092019161114690612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461117290612c9f565b80156111bf5780601f10611194576101008083540402835291602001916111bf565b820191906000526020600020905b8154815290600101906020018083116111a257829003601f168201915b50505050508152505090508060000151516000036111f357604051630d1c383160e11b815260048101849052602401610435565b6111fb611fa4565b60008481526020919091526040908190208151610160810190925280548290829061122590612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461125190612c9f565b801561129e5780601f106112735761010080835404028352916020019161129e565b820191906000526020600020905b81548152906001019060200180831161128157829003601f168201915b50505050508152602001600182015481526020016002820180546112c190612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546112ed90612c9f565b801561133a5780601f1061130f5761010080835404028352916020019161133a565b820191906000526020600020905b81548152906001019060200180831161131d57829003601f168201915b505050918352505060038201546001600160401b031660208201526004820154604082015260058201805460609092019161137490612c9f565b80601f01602080910402602001604051908101604052809291908181526020018280546113a090612c9f565b80156113ed5780601f106113c2576101008083540402835291602001916113ed565b820191906000526020600020905b8154815290600101906020018083116113d057829003601f168201915b505050918352505060068201546001600160401b0381166020830152600160401b900461ffff16604082015260078201805460609092019161142e90612c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461145a90612c9f565b80156114a75780601f1061147c576101008083540402835291602001916114a7565b820191906000526020600020905b81548152906001019060200180831161148a57829003601f168201915b505050918352505060088201546001600160801b03166020820152600982018054604090920191610c7190612c9f565b600061060361062b83612b30565b60008060ff1961151660017fc6615bff908872cc0bd80dcc616c0d42beb2d17521bf5a6e4f8d19a3b3cd0fb3612994565b60405160200161152891815260200190565b60408051601f1981840301815291905280516020909101201692915050565b306001600160a01b037f00000000000000000000000093eae6368b56383485645d2eebdce4ff9f77d72c1614806115b757507f00000000000000000000000093eae6368b56383485645d2eebdce4ff9f77d72c6001600160a01b03166115ab611fd5565b6001600160a01b031614155b156104d15760405163703e46dd60e11b815260040160405180910390fd5b610e55611c39565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611637575060408051601f3d908101601f1916820190925261163491810190612cd3565b60015b61165f57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610435565b600080516020613109833981519152811461169057604051632a87526960e21b815260048101829052602401610435565b61169a8383611feb565b505050565b306001600160a01b037f00000000000000000000000093eae6368b56383485645d2eebdce4ff9f77d72c16146104d15760405163703e46dd60e11b815260040160405180910390fd5b60008060ff1961151660017f122b98a62ebc3d7472f97caad9665737c60fdd5c274c93d70314bc6eb3ad65b8612994565b60008061172861062b87612b30565b905060006117346114e5565b60010160008860200135815260200190815260200160002060010154146117715760405163a588189160e01b815260048101829052602401610435565b6117796114e5565b54604051635a01e0ab60e01b81526001600160a01b0390911690635a01e0ab906117ad908490899089908990600401612c31565b602060405180830381865afa1580156117ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ee9190612c82565b61180e5760405163a03374c560e01b815260048101829052602401610435565b856118176114e5565b60208089013560009081526001929092019052604090206118388282612e68565b505060405181907f81e789a770fdc2e6e009e9be246fc51402584f3d45c9111826004247c3ac5f7190600090a295945050505050565b61038d8161187a6116e8565b90612041565b600061189260e0830160c08401612fe1565b61ffff166000036118b65760405163691dcbf960e11b815260040160405180910390fd5b60006118c4610617846129e6565b90506118ce611fa4565b60008281526020919091526040902080546118e890612c9f565b15905061190b576040516376f74a2d60e11b815260048101829052602401610435565b604080516101a0810182526005610160820190815264302e302e3160d81b61018083015281528435602080830191909152909182019061194d90860186612cec565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611997606086016040870161294e565b6001600160401b03168152606085013560208201526040016119bc6080860186612cec565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611a0660c0860160a0870161294e565b6001600160401b03168152602001611a2460e0860160c08701612fe1565b61ffff168152602001611a3a60e0860186612cec565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611a8661012086016101008701612ffc565b6001600160801b03168152602001611aa2610120860186612cec565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250611ae0611fa4565b60008381526020919091526040902081518190611afd9082613017565b506020820151600182015560408201516002820190611b1c9082613017565b50606082015160038201805467ffffffffffffffff19166001600160401b039092169190911790556080820151600482015560a08201516005820190611b629082613017565b5060c082015160068201805460e085015161ffff16600160401b0269ffffffffffffffffffff199091166001600160401b03909316929092179190911790556101008201516007820190611bb69082613017565b506101208201516008820180546001600160801b0319166001600160801b039092169190911790556101408201516009820190611bf39082613017565b50506040518291507f38fa0f6e31e569a333afb42b9f7334a9f0e1229c21d08aeb588cd204d50d7e1f90600090a292915050565b61038d81611c336116e8565b9061204d565b33611c6b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146104d15760405163118cdaa760e01b8152336004820152602401610435565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000610603825490565b6000611d1b8383612059565b9392505050565b6040805180820182526005815264302e302e3160d81b6020918201528251838201518051908301208484015160608087015160808089015180519088012060a08a015160c0808c015160e08d01518051908c01206101008e01516101208f01518051908e01208e517fae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc1991638118859e81019e909e529d8d019b909b52968b019890985295861b6001600160c01b03199081168a85015260888a019490945260a889019190915290931b1660c886015260f09290921b6001600160f01b03191660d085015260d28401919091521b6001600160801b03191660f2820152610102810191909152600090610122015b604051602081830303815290604052805190602001209050919050565b6040805180820182526005815264302e302e3160d81b602091820152820151908201516000917fae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc19916381188591611e9a576000611ea0565b600160f81b5b846060015160f81b8560800151805190602001208660a0015160c01b8760c0015160c01b8860e0015160c01b896101000151805190602001208a610120015180519060200120604051602001611e2a9a99989796959493929190998a5260208a01989098526001600160f81b031996871660408a015294909516604188015260428701929092526001600160c01b03199081166062870152908116606a860152919091166072840152607a830152609a82015260ba0190565b611f61612083565b80611f6a6114e5565b80546001600160a01b0319166001600160a01b039290921691909117905550565b611f93612083565b610e55816120cc565b6104d1612083565b60008060ff1961151660017f12e9c4cc22831c4121abc64356dbc053781d5c177d921daeff3c78903ed333a3612994565b6000600080516020613109833981519152610363565b611ff4826120d4565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156120395761169a828261211f565b61038d61218c565b6000611d1b83836121ab565b6000611d1b838361229e565b6000826000018281548110612070576120706129a7565b9060005260206000200154905092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166104d157604051631afcd79f60e31b815260040160405180910390fd5b610e22612083565b806001600160a01b03163b60000361210a57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610435565b80600080516020613109833981519152611f6a565b6060600080846001600160a01b03168460405161213c91906130d6565b600060405180830381855af49150503d8060008114612177576040519150601f19603f3d011682016040523d82523d6000602084013e61217c565b606091505b50915091506106cf8583836122ed565b34156104d15760405163b398979f60e01b815260040160405180910390fd5b600081815260018301602052604081205480156122945760006121cf600183612994565b85549091506000906121e390600190612994565b9050808214612248576000866000018281548110612203576122036129a7565b9060005260206000200154905080876000018481548110612226576122266129a7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612259576122596130f2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610603565b6000915050610603565b60008181526001830160205260408120546122e557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610603565b506000610603565b606082612302576122fd82612349565b611d1b565b815115801561231957506001600160a01b0384163b155b1561234257604051639996b31560e01b81526001600160a01b0385166004820152602401610435565b5092915050565b8051156123595780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b604080516101608101825260608082526000602083018190529282018190528082018390526080820183905260a0820181905260c0820183905260e08201839052610100820181905261012082019290925261014081019190915290565b80356001600160a01b03811681146123e757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715612425576124256123ec565b60405290565b600082601f83011261243c57600080fd5b81356001600160401b0380821115612456576124566123ec565b604051601f8301601f19908116603f0116810190828211818310171561247e5761247e6123ec565b8160405283815286602085880101111561249757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156124ca57600080fd5b6124d3836123d0565b915060208301356001600160401b038111156124ee57600080fd5b6124fa8582860161242b565b9150509250929050565b6000610140828403121561251757600080fd5b50919050565b6001600160401b0381168114610e5557600080fd5b80356123e78161251d565b6000806000806060858703121561255357600080fd5b84356001600160401b038082111561256a57600080fd5b61257688838901612504565b9550602087013591506125888261251d565b9093506040860135908082111561259e57600080fd5b818701915087601f8301126125b257600080fd5b8135818111156125c157600080fd5b8860208260051b85010111156125d657600080fd5b95989497505060200194505050565b6000602082840312156125f757600080fd5b81356001600160401b0381111561260d57600080fd5b61261984828501612504565b949350505050565b6000806040838503121561263457600080fd5b50508035926020909101359150565b60005b8381101561265e578181015183820152602001612646565b50506000910152565b6000815180845261267f816020860160208601612643565b601f01601f19169290920160200192915050565b600061016082518185526126a982860182612667565b91505060208301516020850152604083015184820360408601526126cd8282612667565b91505060608301516126ea60608601826001600160401b03169052565b506080830151608085015260a083015184820360a086015261270c8282612667565b91505060c083015161272960c08601826001600160401b03169052565b5060e083015161273f60e086018261ffff169052565b5061010080840151858303828701526127588382612667565b9250505061012080840151612777828701826001600160801b03169052565b505061014080840151858303828701526127918382612667565b9695505050505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156127f257603f198886030184526127e0858351612693565b945092850192908501906001016127c4565b5092979650505050505050565b602081526000611d1b6020830184612667565b60006020828403121561282457600080fd5b5035919050565b602081526000825161014080602085015261284a610160850183612667565b9150602085015160408501526040850151612869606086018215159052565b50606085015160ff81166080860152506080850151601f19808685030160a08701526128958483612667565b935060a087015191506128b360c08701836001600160401b03169052565b60c08701516001600160401b03811660e0880152915060e087015191506101006128e7818801846001600160401b03169052565b808801519250506101208187860301818801526129048584612667565b9088015187820390920184880152935090506127918382612667565b60006020828403121561293257600080fd5b611d1b826123d0565b602081526000611d1b6020830184612693565b60006020828403121561296057600080fd5b8135611d1b8161251d565b634e487b7160e01b600052601160045260246000fd5b808201808211156106035761060361296b565b818103818111156106035761060361296b565b634e487b7160e01b600052603260045260246000fd5b803561ffff811681146123e757600080fd5b80356001600160801b03811681146123e757600080fd5b600061014082360312156129f957600080fd5b612a01612402565b8235815260208301356001600160401b0380821115612a1f57600080fd5b612a2b3683870161242b565b6020840152612a3c60408601612532565b6040840152606085013560608401526080850135915080821115612a5f57600080fd5b612a6b3683870161242b565b6080840152612a7c60a08601612532565b60a0840152612a8d60c086016129bd565b60c084015260e0850135915080821115612aa657600080fd5b612ab23683870161242b565b60e08401526101009150612ac78286016129cf565b8284015261012091508185013581811115612ae157600080fd5b612aed3682880161242b565b8385015250505080915050919050565b8015158114610e5557600080fd5b80356123e781612afd565b60ff81168114610e5557600080fd5b80356123e781612b16565b60006101408236031215612b4357600080fd5b612b4b612402565b82356001600160401b0380821115612b6257600080fd5b612b6e3683870161242b565b835260208501356020840152612b8660408601612b0b565b6040840152612b9760608601612b25565b60608401526080850135915080821115612bb057600080fd5b612bbc3683870161242b565b6080840152612bcd60a08601612532565b60a0840152612bde60c08601612532565b60c0840152612bef60e08601612532565b60e084015261010091508185013581811115612c0a57600080fd5b612c163682880161242b565b838501525061012091508185013581811115612ae157600080fd5b8481526001600160401b0384166020820152606060408201819052810182905260006001600160fb1b03831115612c6757600080fd5b8260051b808560808501379190910160800195945050505050565b600060208284031215612c9457600080fd5b8151611d1b81612afd565b600181811c90821680612cb357607f821691505b60208210810361251757634e487b7160e01b600052602260045260246000fd5b600060208284031215612ce557600080fd5b5051919050565b6000808335601e19843603018112612d0357600080fd5b8301803591506001600160401b03821115612d1d57600080fd5b602001915036819003821315612d3257600080fd5b9250929050565b601f82111561169a576000816000526020600020601f850160051c81016020861015612d625750805b601f850160051c820191505b81811015610e1257828155600101612d6e565b6001600160401b03831115612d9857612d986123ec565b612dac83612da68354612c9f565b83612d39565b6000601f841160018114612de05760008515612dc85750838201355b600019600387901b1c1916600186901b178355612e3a565b600083815260209020601f19861690835b82811015612e115786850135825560209485019460019092019101612df1565b5086821015612e2e5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6000813561060381612afd565b6000813561060381612b16565b600081356106038161251d565b612e728283612cec565b612e7d818385612d81565b50506020820135600182015560028101612eb0612e9c60408501612e41565b825490151560ff1660ff1991909116178255565b612ed5612ebf60608501612e4e565b825461ff00191660089190911b61ff0016178255565b50612ee36080830183612cec565b612ef1818360038601612d81565b505060048101612f24612f0660a08501612e5b565b825467ffffffffffffffff19166001600160401b0391909116178255565b612f65612f3360c08501612e5b565b82546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff000000000000000016178255565b612fa0612f7460e08501612e5b565b82805467ffffffffffffffff60801b191660809290921b67ffffffffffffffff60801b16919091179055565b50612faf610100830183612cec565b612fbd818360058601612d81565b5050612fcd610120830183612cec565b612fdb818360068601612d81565b50505050565b600060208284031215612ff357600080fd5b611d1b826129bd565b60006020828403121561300e57600080fd5b611d1b826129cf565b81516001600160401b03811115613030576130306123ec565b6130448161303e8454612c9f565b84612d39565b602080601f83116001811461307957600084156130615750858301515b600019600386901b1c1916600185901b178555610e12565b600085815260208120601f198616915b828110156130a857888601518255948401946001909101908401613089565b50858210156130c65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516130e8818460208701612643565b9190910192915050565b634e487b7160e01b600052603160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220016858eb0f0611b144b808feb47913fd1b722d3be6924825816178856cce541964736f6c63430008180033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.