Contract 0x35cd31Ff71CeE837db602Da84d12d920D13C8fD6

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x3f2ab6f81c6664b8705f83cbd504340ac33be28469e0a6097ac69cf366822d520x60806040631117352023-05-26 9:48:527 days 23 hrs ago0x15051107651f3420144d3a2412d49402c2fac3c0 IN  Create: ZkBridgeOracle0 FTM0.118121929171
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x3f2ab6f81c6664b8705f83cbd504340ac33be28469e0a6097ac69cf366822d52631117352023-05-26 9:48:527 days 23 hrs ago 0x15051107651f3420144d3a2412d49402c2fac3c0  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZkBridgeOracle

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : ZkBridgeOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';
import "../interface/ILayerZeroOracleV2.sol";
import "../interface/IBlockUpdater.sol";
import "../interface/ILayerZeroEndpoint.sol";
import "../interface/ILayerZeroUltraLightNodeV2.sol";
import "../interface/IZKMptValidator.sol";


contract ZkBridgeOracle is ILayerZeroOracleV2, Initializable, OwnableUpgradeable {
    event OracleNotified(uint16 dstChainId, uint16 proofType, uint blockConfirmations, address uln, uint fee);
    event WithdrawFee(address receiver, uint256 amount);
    event SetFee(uint16 dstChainId, uint16 proofType, uint256 fee);
    event RemoveFee(uint16 dstChainId, uint16 proofType);
    event ModBlockUpdater(uint16 sourceChainId, address oldBlockUpdater, address newBlockUpdater);
    event ModZKMptValidator(address oldZKMptValidator, address newZKMptValidator);
    event ModLayerZeroEndpoint(address oldLayerZeroEndpoint, address newLayerZeroEndpoint);
    event EnableSupportedDstChain(uint16 _proofType, uint16 dstChainId);
    event DisableSupportedDstChain(uint16 _proofType, uint16 dstChainId);

    ILayerZeroEndpoint public layerZeroEndpoint;

    // proofType=>chainId=>price
    mapping(uint16 => mapping(uint16 => uint)) public chainPriceLookup;

    // proofType=>chainId=>bool
    mapping(uint16 => mapping(uint16 => bool)) public supportedDstChain;

    // chainId=>blockUpdater
    mapping(uint16 => IBlockUpdater) public blockUpdaters;

    IZKMptValidator public zkMptValidator;

    EnumerableSet.AddressSet private lzUln;

    function initialize(address _layerZeroEndpoint) public initializer {
        require(_layerZeroEndpoint != address(0), "ZkBridgeOracle:Zero address");
        layerZeroEndpoint = ILayerZeroEndpoint(_layerZeroEndpoint);
        __Ownable_init();
    }

    function updateMptHash(uint16 _sourceChainId, bytes32 _blockHash, bytes32 _receiptHash, address _userApplication) external {
        _updateHash(_sourceChainId, _blockHash, _receiptHash, _blockHash, _receiptHash, _userApplication);
    }

    function batchUpdateMptHash(uint16[] calldata _sourceChainIds, bytes32[] calldata _blockHashes, bytes32[] calldata _receiptHashes, address[] calldata _userApplications) external {
        require(_sourceChainIds.length == _blockHashes.length, "ZkBridgeOracle:Parameter lengths must be the same");
        require(_sourceChainIds.length == _receiptHashes.length, "ZkBridgeOracle:Parameter lengths must be the same");
        require(_sourceChainIds.length == _userApplications.length, "ZkBridgeOracle:Parameter lengths must be the same");
        for (uint256 i = 0; i < _sourceChainIds.length; i++) {
            _updateHash(_sourceChainIds[i], _blockHashes[i], _receiptHashes[i], _blockHashes[i], _receiptHashes[i], _userApplications[i]);
        }
    }

    function updateFpHash(uint16 _sourceChainId, bytes32 _blockHash, bytes calldata zkMptProof, address _userApplication) external {
        require(address(zkMptValidator)!=address(0),"ZkBridgeOracle:Not set zkMptValidator");
        IZKMptValidator.Receipt memory receipt = zkMptValidator.validateMPT(zkMptProof);
        _updateHash(_sourceChainId, _blockHash, receipt.receiptHash, receipt.logsHash, receipt.logsHash, _userApplication);
    }

    function batchUpdateFpHash(uint16[] calldata _sourceChainIds, bytes32[] calldata _blockHashes, bytes[] calldata zkMptProofs, address[] calldata _userApplications) external {
        require(address(zkMptValidator)!=address(0),"ZkBridgeOracle:Not set zkMptValidator");
        require(_sourceChainIds.length == _blockHashes.length, "ZkBridgeOracle:Parameter lengths must be the same");
        require(_sourceChainIds.length == zkMptProofs.length, "ZkBridgeOracle:Parameter lengths must be the same");
        require(_sourceChainIds.length == _userApplications.length, "ZkBridgeOracle:Parameter lengths must be the same");
        IZKMptValidator.Receipt memory receipt;
        for (uint256 i = 0; i < _sourceChainIds.length; i++) {
            receipt = zkMptValidator.validateMPT(zkMptProofs[i]);
            _updateHash(_sourceChainIds[i], _blockHashes[i], receipt.receiptHash, receipt.logsHash, receipt.logsHash, _userApplications[i]);
        }
    }

    function assignJob(uint16 _dstChainId, uint16 _proofType, uint64 _outboundBlockConfirmation, address _userApplication) external override returns (uint price){
        require(supportedDstChain[_proofType][_dstChainId], "ZkBridgeOracle:Unsupported dest chain");
        require(isSupportedUln(msg.sender), "ZkBridgeOracle:Unsupported user application uln");
        price = chainPriceLookup[_proofType][_dstChainId];
        emit OracleNotified(_dstChainId, _proofType, _outboundBlockConfirmation, msg.sender, price);
    }

    function getFee(uint16 _dstChainId, uint16 _proofType, uint64 _outboundBlockConfirmation, address _userApplication) external override view returns (uint price){
        price = chainPriceLookup[_proofType][_dstChainId];
    }

    function hashLookup(uint16 _srcChainId, bytes32 _blockHash, bytes32 _blockData, address _userApplication) external view returns (uint256 confirmation){
        address uln = layerZeroEndpoint.getReceiveLibraryAddress(_userApplication);
        confirmation = ILayerZeroUltraLightNodeV2(uln).hashLookup(address(this), _srcChainId, _blockHash, _blockData);
    }

    function feeBalance() public view returns (uint256 balance){
        for (uint256 i = 0; i < getLzUlnLength(); i++) {
            uint256 ulnBalance = ILayerZeroUltraLightNodeV2(getLzUln(i)).accruedNativeFee(address(this));
            balance += ulnBalance;
        }
    }

    function isSupportedUln(address _uln) public view returns (bool) {
        return EnumerableSet.contains(lzUln, _uln);
    }

    function getLzUlnLength() public view returns (uint256) {
        return EnumerableSet.length(lzUln);
    }

    function getLzUln(uint256 _index) public view returns (address){
        require(_index <= getLzUlnLength() - 1, "ZkBridgeOracle:index out of bounds");
        return EnumerableSet.at(lzUln, _index);
    }


    function _updateHash(uint16 _sourceChainId, bytes32 _blockHash, bytes32 _receiptHash, bytes32 _lookupHash, bytes32 _blockData, address _userApplication) internal {
        IBlockUpdater blockUpdater = blockUpdaters[_sourceChainId];
        require(address(blockUpdater) != address(0), "ZkBridgeOracle:Unsupported source chain");
        (bool exist,uint256 blockConfirmation) = blockUpdater.checkBlockConfirmation(_blockHash, _receiptHash);
        require(exist, "ZkBridgeOracle:Block Data is not set");
        address uln = layerZeroEndpoint.getReceiveLibraryAddress(_userApplication);
        ILayerZeroUltraLightNodeV2(uln).updateHash(_sourceChainId, _lookupHash, blockConfirmation, _blockData);
    }

    //----------------------------------------------------------------------------------
    // onlyOwner
    function enableSupportedDstChain(uint16 _proofType, uint16 _dstChainId) external onlyOwner {
        supportedDstChain[_proofType][_dstChainId] = true;
        emit EnableSupportedDstChain(_proofType, _dstChainId);
    }

    function disableSupportedDstChain(uint16 _proofType, uint16 _dstChainId) external onlyOwner {
        supportedDstChain[_proofType][_dstChainId] = false;
        emit DisableSupportedDstChain(_proofType, _dstChainId);
    }

    function addLzUln(address _lzUln) external onlyOwner {
        require(_lzUln != address(0), "ZkBridgeOracle:Zero address");
        require(!isSupportedUln(_lzUln), "ZkBridgeOracle:The uln is already exist");
        EnumerableSet.add(lzUln, _lzUln);
    }

    function removeLzUln(address _lzUln) external onlyOwner {
        require(_lzUln != address(0), "ZkBridgeOracle:Zero address");
        require(isSupportedUln(_lzUln), "ZkBridgeOracle:The uln is already remove");
        EnumerableSet.remove(lzUln, _lzUln);
    }

    function setFee(uint16 _dstChainId, uint16 _proofType, uint _price) external onlyOwner {
        require(_price > 0, "ZkBridgeOracle:Price must be greater than zero.");
        chainPriceLookup[_proofType][_dstChainId] = _price;
        emit SetFee(_proofType, _dstChainId, _price);
    }

    function removeFee(uint16 _dstChainId, uint16 _proofType) external onlyOwner {
        require(chainPriceLookup[_proofType][_dstChainId] > 0, "ZkBridgeOracle:The price is already 0.");
        chainPriceLookup[_proofType][_dstChainId] = 0;
        emit RemoveFee(_dstChainId, _proofType);
    }

    function withdrawFee(address payable _to, uint _amount) external override onlyOwner {
        require(feeBalance() >= _amount, "ZkBridgeOracle:Insufficient Balance");
        uint256 surplusAmount = _amount;
        for (uint256 i = 0; i < getLzUlnLength(); i++) {
            uint256 ulnBalance = ILayerZeroUltraLightNodeV2(getLzUln(i)).accruedNativeFee(address(this));
            if (ulnBalance > 0) {
                if (ulnBalance >= surplusAmount) {
                    ILayerZeroUltraLightNodeV2(getLzUln(i)).withdrawNative(_to, surplusAmount);
                    break;
                } else {
                    ILayerZeroUltraLightNodeV2(getLzUln(i)).withdrawNative(_to, ulnBalance);
                }
            }
            surplusAmount = surplusAmount - ulnBalance;
        }
        emit WithdrawFee(_to, _amount);
    }

    function setBlockUpdater(uint16 _sourceChainId, address _blockUpdater) external onlyOwner {
        require(_blockUpdater != address(0), "ZkBridgeOracle:Zero address");
        emit ModBlockUpdater(_sourceChainId, address(blockUpdaters[_sourceChainId]), _blockUpdater);
        blockUpdaters[_sourceChainId] = IBlockUpdater(_blockUpdater);
    }

    function setZKMptValidator(address _zkMptValidator) external onlyOwner {
        require(_zkMptValidator != address(0), "ZkBridgeOracle:Zero address");
        emit ModZKMptValidator(address(zkMptValidator), _zkMptValidator);
        zkMptValidator = IZKMptValidator(_zkMptValidator);
    }

    function setLayerZeroEndpoint(address _layerZeroEndpoint) external onlyOwner {
        require(_layerZeroEndpoint != address(0), "ZkBridgeOracle:Zero address");
        emit ModLayerZeroEndpoint(address(_layerZeroEndpoint), _layerZeroEndpoint);
        layerZeroEndpoint = ILayerZeroEndpoint(_layerZeroEndpoint);
    }

}

File 2 of 11 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @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]
 * ```
 * 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 Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 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 functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _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 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _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() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @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 {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

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

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

File 3 of 11 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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 {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 11 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @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.
 *
 * ```
 * 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 of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @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._indexes[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 read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 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 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

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

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

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

            // Delete the index for the deleted slot
            delete set._indexes[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._indexes[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;

        /// @solidity memory-safe-assembly
        assembly {
            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;

        /// @solidity memory-safe-assembly
        assembly {
            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;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 5 of 11 : ILayerZeroOracleV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ILayerZeroOracleV2 {
    // @notice query price and assign jobs at the same time
    // @param _dstChainId - the destination endpoint identifier
    // @param _outboundProofType - the proof type identifier to specify proof to be relayed
    // @param _outboundBlockConfirmation - block confirmation delay before relaying blocks
    // @param _userApplication - the source sending contract address
    function assignJob(uint16 _dstChainId, uint16 _outboundProofType, uint64 _outboundBlockConfirmation, address _userApplication) external returns (uint price);

    // @notice query the oracle price for relaying block information to the destination chain
    // @param _dstChainId the destination endpoint identifier
    // @param _outboundProofType the proof type identifier to specify the data to be relayed
    // @param _outboundBlockConfirmation - block confirmation delay before relaying blocks
    // @param _userApplication - the source sending contract address
    function getFee(uint16 _dstChainId, uint16 _outboundProofType, uint64 _outboundBlockConfirmation, address _userApplication) external view returns (uint price);

    // @notice withdraw the accrued fee in ultra light node
    // @param _to - the fee receiver
    // @param _amount - the withdrawal amount
    function withdrawFee(address payable _to, uint _amount) external;
}

File 6 of 11 : IBlockUpdater.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBlockUpdater {
    event ImportBlock(uint256 identifier, bytes32 blockHash, bytes32 receiptHash);

    function importBlock(bytes calldata _proof) external;

    function checkBlock(bytes32 _blockHash, bytes32 _receiptsRoot) external view returns (bool);

    function checkBlockConfirmation(bytes32 _blockHash, bytes32 _receiptsRoot) external view returns (bool, uint256);
}

File 7 of 11 : ILayerZeroEndpoint.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;



interface ILayerZeroEndpoint {
    // @notice query if the _libraryAddress is valid for sending msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getSendLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the _libraryAddress is valid for receiving msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getReceiveLibraryAddress(address _userApplication) external view returns (address);
}

File 8 of 11 : ILayerZeroUltraLightNodeV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ILayerZeroUltraLightNodeV2 {
    // an Oracle delivers the block data using updateHash()
    function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external;

    // can only withdraw the receivable of the msg.sender
    function withdrawNative(address payable _to, uint _amount) external;

    function hashLookup(address _oracle, uint16 _srcChainId,bytes32 _blockHash,bytes32 _receiptsHash) external view returns(uint256);

    function accruedNativeFee(address _address) external view returns (uint);
}

File 9 of 11 : IZKMptValidator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IZKMptValidator {
    struct Receipt {
        bytes32 receiptHash;
        bytes32 logsHash;
    }

    function validateMPT(bytes calldata _proof) external view returns (Receipt memory receipt);
}

File 10 of 11 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

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

File 11 of 11 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_proofType","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"dstChainId","type":"uint16"}],"name":"DisableSupportedDstChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_proofType","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"dstChainId","type":"uint16"}],"name":"EnableSupportedDstChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"sourceChainId","type":"uint16"},{"indexed":false,"internalType":"address","name":"oldBlockUpdater","type":"address"},{"indexed":false,"internalType":"address","name":"newBlockUpdater","type":"address"}],"name":"ModBlockUpdater","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldLayerZeroEndpoint","type":"address"},{"indexed":false,"internalType":"address","name":"newLayerZeroEndpoint","type":"address"}],"name":"ModLayerZeroEndpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldZKMptValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newZKMptValidator","type":"address"}],"name":"ModZKMptValidator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"proofType","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"blockConfirmations","type":"uint256"},{"indexed":false,"internalType":"address","name":"uln","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"OracleNotified","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":false,"internalType":"uint16","name":"dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"proofType","type":"uint16"}],"name":"RemoveFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"proofType","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawFee","type":"event"},{"inputs":[{"internalType":"address","name":"_lzUln","type":"address"}],"name":"addLzUln","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"uint64","name":"_outboundBlockConfirmation","type":"uint64"},{"internalType":"address","name":"_userApplication","type":"address"}],"name":"assignJob","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_sourceChainIds","type":"uint16[]"},{"internalType":"bytes32[]","name":"_blockHashes","type":"bytes32[]"},{"internalType":"bytes[]","name":"zkMptProofs","type":"bytes[]"},{"internalType":"address[]","name":"_userApplications","type":"address[]"}],"name":"batchUpdateFpHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_sourceChainIds","type":"uint16[]"},{"internalType":"bytes32[]","name":"_blockHashes","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_receiptHashes","type":"bytes32[]"},{"internalType":"address[]","name":"_userApplications","type":"address[]"}],"name":"batchUpdateMptHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"blockUpdaters","outputs":[{"internalType":"contract IBlockUpdater","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"chainPriceLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"}],"name":"disableSupportedDstChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"}],"name":"enableSupportedDstChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"uint64","name":"_outboundBlockConfirmation","type":"uint64"},{"internalType":"address","name":"_userApplication","type":"address"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getLzUln","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLzUlnLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_blockData","type":"bytes32"},{"internalType":"address","name":"_userApplication","type":"address"}],"name":"hashLookup","outputs":[{"internalType":"uint256","name":"confirmation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_layerZeroEndpoint","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_uln","type":"address"}],"name":"isSupportedUln","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"layerZeroEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"}],"name":"removeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lzUln","type":"address"}],"name":"removeLzUln","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_sourceChainId","type":"uint16"},{"internalType":"address","name":"_blockUpdater","type":"address"}],"name":"setBlockUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_layerZeroEndpoint","type":"address"}],"name":"setLayerZeroEndpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_zkMptValidator","type":"address"}],"name":"setZKMptValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"supportedDstChain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_sourceChainId","type":"uint16"},{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes","name":"zkMptProof","type":"bytes"},{"internalType":"address","name":"_userApplication","type":"address"}],"name":"updateFpHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_sourceChainId","type":"uint16"},{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptHash","type":"bytes32"},{"internalType":"address","name":"_userApplication","type":"address"}],"name":"updateMptHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"zkMptValidator","outputs":[{"internalType":"contract IZKMptValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506121da806100206000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c5e193cd116100a2578063ee42a1d111610071578063ee42a1d114610454578063f2fde38b14610467578063f3afc7721461047a578063fd9be5221461048d57600080fd5b8063c5e193cd146103d5578063c758b017146103e8578063c98ec44114610413578063e74300491461044157600080fd5b806395b9783c116100de57806395b9783c1461037957806399675fb51461038c578063c2acc5b9146103af578063c4d66de8146103c257600080fd5b80638da5cb5b146103425780638e569cf114610353578063949fff5c1461036657600080fd5b806356d066da1161017c578063715018a61161014b578063715018a6146102eb57806372ee3f69146102f3578063813d31c91461031c57806388cc837e1461032f57600080fd5b806356d066da146102aa5780635704518f146102bd57806360b71d4e146102d057806369f5d386146102d857600080fd5b80631616e9ff116101b85780631616e9ff1461023757806318f1a1131461024a5780634112f0e8146102605780635553fb8e1461027357600080fd5b80630220ffd9146101df5780630673c8d3146101f457806307968db114610207575b600080fd5b6101f26101ed366004611b3a565b6104a0565b005b6101f2610202366004611bb9565b61050f565b60655461021a906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f2610245366004611b3a565b6106ec565b6102526107ca565b60405190815260200161022e565b6101f261026e366004611c7d565b6107db565b610252610281366004611cce565b505061ffff90811660009081526066602090815260408083209490931682529290925290205490565b6101f26102b8366004611bb9565b6108b6565b6101f26102cb366004611d33565b6109db565b610252610a97565b6101f26102e6366004611dd5565b610b45565b6101f2610bdc565b61021a610301366004611df2565b6068602052600090815260409020546001600160a01b031681565b6101f261032a366004611e0d565b610bf0565b6101f261033d366004611b3a565b610cb2565b6033546001600160a01b031661021a565b61021a610361366004611e44565b610d1c565b60695461021a906001600160a01b031681565b6101f2610387366004611dd5565b610d9d565b61039f61039a366004611dd5565b610e2e565b604051901515815260200161022e565b6101f26103bd366004611dd5565b610e3b565b6101f26103d0366004611dd5565b610ede565b6102526103e3366004611cce565b611029565b6102526103f6366004611b3a565b606660209081526000928352604080842090915290825290205481565b61039f610421366004611b3a565b606760209081526000928352604080842090915290825290205460ff1681565b6101f261044f366004611e5d565b61119a565b610252610462366004611e5d565b6111ae565b6101f2610475366004611dd5565b6112ad565b6101f2610488366004611dd5565b611326565b6101f261049b366004611e9a565b6113c5565b6104a8611608565b61ffff828116600081815260676020908152604080832094861680845294825291829020805460ff1916905581519283528201929092527fcb92f61b0a2eacdffd0b9e9643c8f4eec03973e9854811080d2991933202936191015b60405180910390a15050565b6069546001600160a01b03166105405760405162461bcd60e51b815260040161053790611ec6565b60405180910390fd5b86851461055f5760405162461bcd60e51b815260040161053790611f0b565b86831461057e5760405162461bcd60e51b815260040161053790611f0b565b86811461059d5760405162461bcd60e51b815260040161053790611f0b565b604080518082019091526000808252602082015260005b888110156106e0576069546001600160a01b0316630afb22da8787848181106105df576105df611f5c565b90506020028101906105f19190611f72565b6040518363ffffffff1660e01b815260040161060e929190611fb9565b6040805180830381865afa15801561062a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064e9190611fe8565b91506106ce8a8a8381811061066557610665611f5c565b905060200201602081019061067a9190611df2565b89898481811061068c5761068c611f5c565b905060200201358460000151856020015186602001518989888181106106b4576106b4611f5c565b90506020020160208101906106c99190611dd5565b611662565b806106d88161205b565b9150506105b4565b50505050505050505050565b6106f4611608565b61ffff8082166000908152606660209081526040808320938616835292905220546107705760405162461bcd60e51b815260206004820152602660248201527f5a6b4272696467654f7261636c653a54686520707269636520697320616c726560448201526530b23c90181760d11b6064820152608401610537565b61ffff81811660008181526066602090815260408083209487168084529482528083209290925581519384528301919091527f2fe8b99495ccc68fc1995374ef15e331f1d9f73995dafd0813b5cde8383d8d169101610503565b60006107d6606a61189d565b905090565b6107e3611608565b6000811161084b5760405162461bcd60e51b815260206004820152602f60248201527f5a6b4272696467654f7261636c653a5072696365206d7573742062652067726560448201526e30ba32b9103a3430b7103d32b9379760891b6064820152608401610537565b61ffff82811660008181526066602090815260408083209488168084529482529182902085905581519283528201929092529081018290527f6bd1ecba474b4539a7f4175c23e52de4e2ad70d374cba8c744609eb8c6bb0a27906060015b60405180910390a1505050565b8685146108d55760405162461bcd60e51b815260040161053790611f0b565b8683146108f45760405162461bcd60e51b815260040161053790611f0b565b8681146109135760405162461bcd60e51b815260040161053790611f0b565b60005b878110156109d0576109be89898381811061093357610933611f5c565b90506020020160208101906109489190611df2565b88888481811061095a5761095a611f5c565b9050602002013587878581811061097357610973611f5c565b905060200201358a8a8681811061098c5761098c611f5c565b905060200201358989878181106109a5576109a5611f5c565b905060200201358888888181106106b4576106b4611f5c565b806109c88161205b565b915050610916565b505050505050505050565b6069546001600160a01b0316610a035760405162461bcd60e51b815260040161053790611ec6565b60695460405163057d916d60e11b81526000916001600160a01b031690630afb22da90610a369087908790600401611fb9565b6040805180830381865afa158015610a52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a769190611fe8565b80516020820151919250610a8f91889188918087611662565b505050505050565b6000805b610aa36107ca565b811015610b41576000610ab582610d1c565b6040516334a095fd60e11b81523060048201526001600160a01b0391909116906369412bfa90602401602060405180830381865afa158015610afb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1f9190612074565b9050610b2b818461208d565b9250508080610b399061205b565b915050610a9b565b5090565b610b4d611608565b6001600160a01b038116610b735760405162461bcd60e51b8152600401610537906120a5565b606954604080516001600160a01b03928316815291831660208301527f7232a6669d25bc6d450f5c74c7cbc1e4ca02fa2386e736f19a83cd269baeb734910160405180910390a1606980546001600160a01b0319166001600160a01b0392909216919091179055565b610be4611608565b610bee60006118a7565b565b610bf8611608565b6001600160a01b038116610c1e5760405162461bcd60e51b8152600401610537906120a5565b61ffff82166000818152606860209081526040918290205482519384526001600160a01b0390811691840191909152831682820152517f25a1ae020d581a4676219671150e9a1518e6b2b0147a4e0b160a13d5612820589181900360600190a161ffff91909116600090815260686020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b610cba611608565b61ffff828116600081815260676020908152604080832094861680845294825291829020805460ff1916600117905581519283528201929092527fb7fadf96c12f12cde47625d532f5ac111781c8ca270be73c25434cfce3df01ec9101610503565b60006001610d286107ca565b610d3291906120dc565b821115610d8c5760405162461bcd60e51b815260206004820152602260248201527f5a6b4272696467654f7261636c653a696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401610537565b610d97606a836118f9565b92915050565b610da5611608565b6001600160a01b038116610dcb5760405162461bcd60e51b8152600401610537906120a5565b604080516001600160a01b03831680825260208201527f9bb1ee10df65f2ea6e9b6f1911afe80df0374a7e2fa65c7786fe98398e5eda9f910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d97606a8361190c565b610e43611608565b6001600160a01b038116610e695760405162461bcd60e51b8152600401610537906120a5565b610e7281610e2e565b15610ecf5760405162461bcd60e51b815260206004820152602760248201527f5a6b4272696467654f7261636c653a54686520756c6e20697320616c726561646044820152661e48195e1a5cdd60ca1b6064820152608401610537565b610eda606a8261192e565b5050565b600054610100900460ff1615808015610efe5750600054600160ff909116105b80610f185750303b158015610f18575060005460ff166001145b610f7b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610537565b6000805460ff191660011790558015610f9e576000805461ff0019166101001790555b6001600160a01b038216610fc45760405162461bcd60e51b8152600401610537906120a5565b606580546001600160a01b0319166001600160a01b038416179055610fe7611943565b8015610eda576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610503565b61ffff808416600090815260676020908152604080832093881683529290529081205460ff166110a95760405162461bcd60e51b815260206004820152602560248201527f5a6b4272696467654f7261636c653a556e737570706f7274656420646573742060448201526431b430b4b760d91b6064820152608401610537565b6110b233610e2e565b6111165760405162461bcd60e51b815260206004820152602f60248201527f5a6b4272696467654f7261636c653a556e737570706f7274656420757365722060448201526e30b8383634b1b0ba34b7b7103ab63760891b6064820152608401610537565b5061ffff8381166000818152606660209081526040808320948916808452948252918290205482519485529084019290925267ffffffffffffffff85169083015233606083015260808201819052907fdaebd99ba0f67a2d7a70d027ab177cad40ce040f65a9c4d98544a5463a172ebd9060a00160405180910390a1949350505050565b6111a8848484868686611662565b50505050565b6065546040516338dd17eb60e11b81526001600160a01b03838116600483015260009283929116906371ba2fd690602401602060405180830381865afa1580156111fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122091906120f3565b60405163759c5b3b60e01b815230600482015261ffff8816602482015260448101879052606481018690529091506001600160a01b0382169063759c5b3b90608401602060405180830381865afa15801561127f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a39190612074565b9695505050505050565b6112b5611608565b6001600160a01b03811661131a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610537565b611323816118a7565b50565b61132e611608565b6001600160a01b0381166113545760405162461bcd60e51b8152600401610537906120a5565b61135d81610e2e565b6113ba5760405162461bcd60e51b815260206004820152602860248201527f5a6b4272696467654f7261636c653a54686520756c6e20697320616c72656164604482015267792072656d6f766560c01b6064820152608401610537565b610eda606a82611972565b6113cd611608565b806113d6610a97565b10156114305760405162461bcd60e51b815260206004820152602360248201527f5a6b4272696467654f7261636c653a496e73756666696369656e742042616c616044820152626e636560e81b6064820152608401610537565b8060005b61143c6107ca565b8110156115c857600061144e82610d1c565b6040516334a095fd60e11b81523060048201526001600160a01b0391909116906369412bfa90602401602060405180830381865afa158015611494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b89190612074565b905080156115a85782811061153a576114d082610d1c565b6040516303d8c5ef60e11b81526001600160a01b0387811660048301526024820186905291909116906307b18bde90604401600060405180830381600087803b15801561151c57600080fd5b505af1158015611530573d6000803e3d6000fd5b50505050506115c8565b61154382610d1c565b6040516303d8c5ef60e11b81526001600160a01b0387811660048301526024820184905291909116906307b18bde90604401600060405180830381600087803b15801561158f57600080fd5b505af11580156115a3573d6000803e3d6000fd5b505050505b6115b281846120dc565b92505080806115c09061205b565b915050611434565b50604080516001600160a01b0385168152602081018490527f66bf9186b00db666fc37aaffbb95a050c66e599e000c785c1dff0467d868f1b191016108a9565b6033546001600160a01b03163314610bee5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610537565b61ffff86166000908152606860205260409020546001600160a01b0316806116dc5760405162461bcd60e51b815260206004820152602760248201527f5a6b4272696467654f7261636c653a556e737570706f7274656420736f757263604482015266329031b430b4b760c91b6064820152608401610537565b60405163254252af60e01b8152600481018790526024810186905260009081906001600160a01b0384169063254252af906044016040805180830381865afa15801561172c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117509190612110565b91509150816117ad5760405162461bcd60e51b8152602060048201526024808201527f5a6b4272696467654f7261636c653a426c6f636b2044617461206973206e6f74604482015263081cd95d60e21b6064820152608401610537565b6065546040516338dd17eb60e11b81526001600160a01b03868116600483015260009216906371ba2fd690602401602060405180830381865afa1580156117f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181c91906120f3565b60405163704316e560e01b815261ffff8c1660048201526024810189905260448101849052606481018890529091506001600160a01b0382169063704316e590608401600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b5050505050505050505050505050565b6000610d97825490565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006119058383611987565b9392505050565b6001600160a01b03811660009081526001830160205260408120541515611905565b6000611905836001600160a01b0384166119b1565b600054610100900460ff1661196a5760405162461bcd60e51b815260040161053790612143565b610bee611a00565b6000611905836001600160a01b038416611a30565b600082600001828154811061199e5761199e611f5c565b9060005260206000200154905092915050565b60008181526001830160205260408120546119f857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d97565b506000610d97565b600054610100900460ff16611a275760405162461bcd60e51b815260040161053790612143565b610bee336118a7565b60008181526001830160205260408120548015611b19576000611a546001836120dc565b8554909150600090611a68906001906120dc565b9050818114611acd576000866000018281548110611a8857611a88611f5c565b9060005260206000200154905080876000018481548110611aab57611aab611f5c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611ade57611ade61218e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d97565b6000915050610d97565b803561ffff81168114611b3557600080fd5b919050565b60008060408385031215611b4d57600080fd5b611b5683611b23565b9150611b6460208401611b23565b90509250929050565b60008083601f840112611b7f57600080fd5b50813567ffffffffffffffff811115611b9757600080fd5b6020830191508360208260051b8501011115611bb257600080fd5b9250929050565b6000806000806000806000806080898b031215611bd557600080fd5b883567ffffffffffffffff80821115611bed57600080fd5b611bf98c838d01611b6d565b909a50985060208b0135915080821115611c1257600080fd5b611c1e8c838d01611b6d565b909850965060408b0135915080821115611c3757600080fd5b611c438c838d01611b6d565b909650945060608b0135915080821115611c5c57600080fd5b50611c698b828c01611b6d565b999c989b5096995094979396929594505050565b600080600060608486031215611c9257600080fd5b611c9b84611b23565b9250611ca960208501611b23565b9150604084013590509250925092565b6001600160a01b038116811461132357600080fd5b60008060008060808587031215611ce457600080fd5b611ced85611b23565b9350611cfb60208601611b23565b9250604085013567ffffffffffffffff81168114611d1857600080fd5b91506060850135611d2881611cb9565b939692955090935050565b600080600080600060808688031215611d4b57600080fd5b611d5486611b23565b945060208601359350604086013567ffffffffffffffff80821115611d7857600080fd5b818801915088601f830112611d8c57600080fd5b813581811115611d9b57600080fd5b896020828501011115611dad57600080fd5b6020830195508094505050506060860135611dc781611cb9565b809150509295509295909350565b600060208284031215611de757600080fd5b813561190581611cb9565b600060208284031215611e0457600080fd5b61190582611b23565b60008060408385031215611e2057600080fd5b611e2983611b23565b91506020830135611e3981611cb9565b809150509250929050565b600060208284031215611e5657600080fd5b5035919050565b60008060008060808587031215611e7357600080fd5b611e7c85611b23565b935060208501359250604085013591506060850135611d2881611cb9565b60008060408385031215611ead57600080fd5b8235611eb881611cb9565b946020939093013593505050565b60208082526025908201527f5a6b4272696467654f7261636c653a4e6f7420736574207a6b4d707456616c696040820152643230ba37b960d91b606082015260800190565b60208082526031908201527f5a6b4272696467654f7261636c653a506172616d65746572206c656e67746873604082015270206d757374206265207468652073616d6560781b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611f8957600080fd5b83018035915067ffffffffffffffff821115611fa457600080fd5b602001915036819003821315611bb257600080fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600060408284031215611ffa57600080fd5b6040516040810181811067ffffffffffffffff8211171561202b57634e487b7160e01b600052604160045260246000fd5b604052825181526020928301519281019290925250919050565b634e487b7160e01b600052601160045260246000fd5b60006001820161206d5761206d612045565b5060010190565b60006020828403121561208657600080fd5b5051919050565b600082198211156120a0576120a0612045565b500190565b6020808252601b908201527f5a6b4272696467654f7261636c653a5a65726f20616464726573730000000000604082015260600190565b6000828210156120ee576120ee612045565b500390565b60006020828403121561210557600080fd5b815161190581611cb9565b6000806040838503121561212357600080fd5b8251801515811461213357600080fd5b6020939093015192949293505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220358f885b7583b6df01129b796bb8ce8f05d4342eebcee34d8a25572626cc6a5a64736f6c634300080e0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.