Holesky Testnet

Contract

0xCE17B03d7901173Cbfa017B1ae3A9b8632f42c18

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Send Request25380872024-10-15 12:02:3660 days ago1728993756IN
0xCE17B03d...632f42c18
0 ETH0.000138461.44490121
Send Request19567012024-07-19 4:06:12148 days ago1721361972IN
0xCE17B03d...632f42c18
0 ETH0.000000040.0006176
Send Request19566902024-07-19 4:03:12148 days ago1721361792IN
0xCE17B03d...632f42c18
0 ETH0.000004670.06176
Send Request19566802024-07-19 4:00:48148 days ago1721361648IN
0xCE17B03d...632f42c18
0 ETH00.00001183
Send Request19566642024-07-19 3:57:00148 days ago1721361420IN
0xCE17B03d...632f42c18
0 ETH00.00000119
Send Request19566472024-07-19 3:53:36148 days ago1721361216IN
0xCE17B03d...632f42c18
0 ETH00.00001258
Send Request19566372024-07-19 3:51:00148 days ago1721361060IN
0xCE17B03d...632f42c18
0 ETH00.00001258
Send Request19566212024-07-19 3:47:24148 days ago1721360844IN
0xCE17B03d...632f42c18
0 ETH00.00001378
Send Request19566062024-07-19 3:44:00148 days ago1721360640IN
0xCE17B03d...632f42c18
0 ETH00.00001421
Send Request19565932024-07-19 3:40:48148 days ago1721360448IN
0xCE17B03d...632f42c18
0 ETH00.00001465
Send Request19565792024-07-19 3:37:48148 days ago1721360268IN
0xCE17B03d...632f42c18
0 ETH00.00001557
Send Request19565662024-07-19 3:34:24148 days ago1721360064IN
0xCE17B03d...632f42c18
0 ETH00.00001605
Send Request19565522024-07-19 3:31:24148 days ago1721359884IN
0xCE17B03d...632f42c18
0 ETH00.00001655
Send Request19565372024-07-19 3:28:12148 days ago1721359692IN
0xCE17B03d...632f42c18
0 ETH00.00001706
Send Request19565202024-07-19 3:24:48148 days ago1721359488IN
0xCE17B03d...632f42c18
0 ETH00.00001706
Send Request19565082024-07-19 3:22:00148 days ago1721359320IN
0xCE17B03d...632f42c18
0 ETH00.00001706
Send Request19564932024-07-19 3:18:36148 days ago1721359116IN
0xCE17B03d...632f42c18
0 ETH00.00001813
Send Request19564792024-07-19 3:15:24148 days ago1721358924IN
0xCE17B03d...632f42c18
0 ETH00.00001869
Send Request19564652024-07-19 3:12:12148 days ago1721358732IN
0xCE17B03d...632f42c18
0 ETH00.00001987
Send Request19564512024-07-19 3:09:12148 days ago1721358552IN
0xCE17B03d...632f42c18
0 ETH00.00001987
Send Request19564352024-07-19 3:05:48148 days ago1721358348IN
0xCE17B03d...632f42c18
0 ETH0.000000140.00192699
Send Request19564222024-07-19 3:02:36148 days ago1721358156IN
0xCE17B03d...632f42c18
0 ETH0.000000150.00198659
Send Request19564072024-07-19 2:59:24148 days ago1721357964IN
0xCE17B03d...632f42c18
0 ETH0.000015020.19865859
Send Request19563942024-07-19 2:56:12148 days ago1721357772IN
0xCE17B03d...632f42c18
0 ETH00.00000313
Send Request19563802024-07-19 2:53:12148 days ago1721357592IN
0xCE17B03d...632f42c18
0 ETH00.00000313
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BrevisRequest

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 800 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : BrevisRequest.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "./FeeVault.sol";
import "../interface/IBrevisProof.sol";
import "../interface/IBrevisApp.sol";
import "../lib/Lib.sol";

contract BrevisRequest is FeeVault {
    uint256 public requestTimeout;
    IBrevisProof public brevisProof;

    enum RequestStatus {
        Pending,
        ZkAttested,
        Refunded
    }

    struct Request {
        uint256 deadline;
        uint256 fee;
        address refundee;
        address callback;
        RequestStatus status;
    }
    mapping(bytes32 => Request) public requests; // TODO: store hash of request data to save gas cost

    event RequestTimeoutUpdated(uint256 from, uint256 to);
    event RequestSent(bytes32 requestId, address sender, uint256 fee, address callback);
    event RequestFulfilled(bytes32 requestId);
    event RequestsFulfilled(bytes32[] requestId);

    constructor(address _feeCollector, IBrevisProof _brevisProof) FeeVault(_feeCollector) {
        brevisProof = _brevisProof;
    }

    function sendRequest(bytes32 _requestId, address _refundee, address _callback) external payable {
        require(requests[_requestId].deadline == 0, "request already in queue");
        require(_refundee != address(0), "refundee not provided");
        requests[_requestId] = Request(
            block.timestamp + requestTimeout,
            msg.value,
            _refundee,
            _callback,
            RequestStatus.Pending
        );
        emit RequestSent(_requestId, msg.sender, msg.value, _callback);
    }

    function fulfillRequest(
        bytes32 _requestId,
        uint64 _chainId,
        bytes calldata _proof,
        bool _withAppProof,
        bytes calldata _appCircuitOutput
    ) external {
        require(!IBrevisProof(brevisProof).hasProof(_requestId), "proof already generated");

        bytes32 reqIdFromProof = IBrevisProof(brevisProof).submitProof(_chainId, _proof, _withAppProof); // will revert if proof is not valid
        require(_requestId == reqIdFromProof, "requestId and proof not match");
        requests[_requestId].status = RequestStatus.ZkAttested;

        emit RequestFulfilled(_requestId);

        address app = requests[_requestId].callback;
        if (app != address(0)) {
            // No matter if the call is success or not. The relayer should set correct gas limit.
            // If the call exceeds the gasleft(), as the proof data is saved ahead,
            // anyone can still call the app.callback directly to proceed
            app.call(abi.encodeWithSelector(IBrevisApp.brevisCallback.selector, _requestId, _appCircuitOutput));
        }
    }

    function fulfillAggRequests(
        uint64 _chainId,
        bytes32[] calldata _requestIds,
        bytes calldata _proof,
        Brevis.ProofData[] calldata _proofDataArray,
        bytes[] calldata _appCircuitOutputs,
        address _callback
    ) external {
        IBrevisProof(brevisProof).mustSubmitAggProof(_chainId, _requestIds, _proof);

        for (uint8 i = 1; i < _requestIds.length; i++) {
            bytes32 requestId = _requestIds[i];
            requests[requestId].status = RequestStatus.ZkAttested;
        }

        emit RequestsFulfilled(_requestIds);

        if (_callback != address(0)) {
            _callback.call(
                abi.encodeWithSelector(
                    IBrevisApp.brevisBatchCallback.selector,
                    _chainId,
                    _proofDataArray,
                    _appCircuitOutputs
                )
            );
        }
    }

    function refund(bytes32 _requestId) public {
        require(block.timestamp > requests[_requestId].deadline);
        require(!IBrevisProof(brevisProof).hasProof(_requestId), "proof already generated");
        require(requests[_requestId].deadline != 0, "request not in queue");
        requests[_requestId].deadline = 0; //reset deadline, then user is able to send request again
        (bool sent, ) = requests[_requestId].refundee.call{value: requests[_requestId].fee, gas: 50000}("");
        require(sent, "send native failed");
        requests[_requestId].status = RequestStatus.Refunded;
    }

    function setRequestTimeout(uint256 _timeout) external onlyOwner {
        uint256 oldTimeout = requestTimeout;
        requestTimeout = _timeout;
        emit RequestTimeoutUpdated(oldTimeout, _timeout);
    }

    function queryRequestStatus(bytes32 _requestId) external view returns (RequestStatus) {
        return requests[_requestId].status;
    }
}

File 2 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * 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 Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

File 3 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 4 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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 {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

File 7 of 11 : FeeVault.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.18;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title Allows the owner to set fee collector and allows fee collectors to collect fees
 */
contract FeeVault is Ownable {
    using SafeERC20 for IERC20;

    address public feeCollector;

    event FeeCollectorUpdated(address from, address to);

    constructor(address _feeCollector) {
        feeCollector = _feeCollector;
    }

    modifier onlyFeeCollector() {
        require(msg.sender == feeCollector, "not fee collector");
        _;
    }

    function collectFee(uint256 _amount, address _to) external onlyFeeCollector {
        (bool sent, ) = _to.call{value: _amount, gas: 50000}("");
        require(sent, "send native failed");
    }

    function setFeeCollector(address _feeCollector) external onlyOwner {
        address oldFeeCollector = feeCollector;
        feeCollector = _feeCollector;
        emit FeeCollectorUpdated(oldFeeCollector, _feeCollector);
    }

    receive() external payable {}
}

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

import "../lib/Lib.sol";

interface IBrevisApp {
    function brevisCallback(bytes32 _requestId, bytes calldata _appCircuitOutput) external;

    function brevisBatchCallback(
        uint64 _chainId,
        Brevis.ProofData[] calldata _proofDataArray,
        bytes[] calldata _appCircuitOutputs
    ) external;
}

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

import "../lib/Lib.sol";

interface IBrevisProof {
    function submitProof(
        uint64 _chainId,
        bytes calldata _proofWithPubInputs,
        bool _withAppProof
    ) external returns (bytes32 _requestId);

    function hasProof(bytes32 _requestId) external view returns (bool);

    // used by contract app
    function validateRequest(bytes32 _requestId, uint64 _chainId, Brevis.ExtractInfos memory _info) external view;

    function getProofData(bytes32 _requestId) external view returns (Brevis.ProofData memory);

    // return appCommitHash and appVkHash
    function getProofAppData(bytes32 _requestId) external view returns (bytes32, bytes32);

    function mustValidateRequest(
        uint64 _chainId,
        Brevis.ProofData calldata _proofData,
        bytes32 _merkleRoot,
        bytes32[] calldata _merkleProof,
        uint8 _nodeIndex
    ) external view;

    function mustValidateRequests(uint64 _chainId, Brevis.ProofData[] calldata _proofDataArray) external view;

    function mustSubmitAggProof(
        uint64 _chainId,
        bytes32[] calldata _requestIds,
        bytes calldata _proofWithPubInputs
    ) external;
}

File 10 of 11 : Lib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "solidity-rlp/contracts/RLPReader.sol";

library Brevis {
    uint256 constant NumField = 5; // supports at most 5 fields per receipt log

    struct ReceiptInfo {
        uint64 blkNum;
        uint64 receiptIndex; // ReceiptIndex in the block
        LogInfo[NumField] logs;
    }

    struct LogInfo {
        LogExtraInfo logExtraInfo;
        uint64 logIndex; // LogIndex of the field
        bytes32 value;
    }

    struct LogExtraInfo {
        uint8 valueFromTopic;
        uint64 valueIndex; // index of the fields in topic or data
        address contractAddress;
        bytes32 logTopic0;
    }

    struct StorageInfo {
        bytes32 blockHash;
        address account;
        bytes32 slot;
        bytes32 slotValue;
        uint64 blockNumber;
    }

    struct TransactionInfo {
        bytes32 leafHash;
        bytes32 blockHash;
        uint64 blockNumber;
        uint64 blockTime;
        bytes leafRlpPrefix;
    }

    struct ExtractInfos {
        bytes32 smtRoot;
        ReceiptInfo[] receipts;
        StorageInfo[] stores;
        TransactionInfo[] txs;
    }

    // retrieved from proofData, to align the logs with circuit...
    struct ProofData {
        bytes32 commitHash;
        bytes32 vkHash;
        bytes32 appCommitHash; // zk-program computing circuit commit hash
        bytes32 appVkHash; // zk-program computing circuit Verify Key hash
        bytes32 smtRoot; // for zk-program computing proof only
    }
}

library Tx {
    using RLPReader for bytes;
    using RLPReader for uint;
    using RLPReader for RLPReader.RLPItem;

    struct TxInfo {
        uint64 chainId;
        uint64 nonce;
        uint256 gasTipCap;
        uint256 gasFeeCap;
        uint256 gas;
        address to;
        uint256 value;
        bytes data;
        address from; // calculate from V R S
    }

    // support DynamicFeeTxType for now
    function decodeTx(bytes calldata txRaw) public pure returns (TxInfo memory info) {
        uint8 txType = uint8(txRaw[0]);
        require(txType == 2, "not a DynamicFeeTxType");

        bytes memory rlpData = txRaw[1:];
        RLPReader.RLPItem[] memory values = rlpData.toRlpItem().toList();
        info.chainId = uint64(values[0].toUint());
        info.nonce = uint64(values[1].toUint());
        info.gasTipCap = values[2].toUint();
        info.gasFeeCap = values[3].toUint();
        info.gas = values[4].toUint();
        info.to = values[5].toAddress();
        info.value = values[6].toUint();
        info.data = values[7].toBytes();

        (uint8 v, bytes32 r, bytes32 s) = (
            uint8(values[9].toUint()),
            bytes32(values[10].toBytes()),
            bytes32(values[11].toBytes())
        );
        // remove r,s,v and adjust length field
        bytes memory unsignedTxRaw;
        uint16 unsignedTxRawDataLength;
        uint8 prefix = uint8(txRaw[1]);
        uint8 lenBytes = prefix - 0xf7; // assume lenBytes won't larger than 2, means the tx rlp data size won't exceed 2^16
        if (lenBytes == 1) {
            unsignedTxRawDataLength = uint8(bytes1(txRaw[2:3])) - 67; //67 is the bytes of r,s,v
        } else {
            unsignedTxRawDataLength = uint16(bytes2(txRaw[2:2 + lenBytes])) - 67;
        }
        if (unsignedTxRawDataLength <= 55) {
            unsignedTxRaw = abi.encodePacked(txRaw[:2], txRaw[3:txRaw.length - 67]);
            unsignedTxRaw[1] = bytes1(0xc0 + uint8(unsignedTxRawDataLength));
        } else {
            if (unsignedTxRawDataLength <= 255) {
                unsignedTxRaw = abi.encodePacked(
                    txRaw[0],
                    bytes1(0xf8),
                    bytes1(uint8(unsignedTxRawDataLength)),
                    txRaw[2 + lenBytes:txRaw.length - 67]
                );
            } else {
                unsignedTxRaw = abi.encodePacked(
                    txRaw[0],
                    bytes1(0xf9),
                    bytes2(unsignedTxRawDataLength),
                    txRaw[2 + lenBytes:txRaw.length - 67]
                );
            }
        }
        info.from = recover(keccak256(unsignedTxRaw), r, s, v);
    }

    function recover(bytes32 message, bytes32 r, bytes32 s, uint8 v) internal pure returns (address) {
        if (v < 27) {
            v += 27;
        }
        return ecrecover(message, v, r, s);
    }
}

File 11 of 11 : RLPReader.sol
// SPDX-License-Identifier: Apache-2.0

/*
 * @author Hamdi Allam [email protected]
 * Please reach out with any questions or concerns
 */
pragma solidity >=0.5.10 <0.9.0;

library RLPReader {
    uint8 constant STRING_SHORT_START = 0x80;
    uint8 constant STRING_LONG_START = 0xb8;
    uint8 constant LIST_SHORT_START = 0xc0;
    uint8 constant LIST_LONG_START = 0xf8;
    uint8 constant WORD_SIZE = 32;

    struct RLPItem {
        uint256 len;
        uint256 memPtr;
    }

    struct Iterator {
        RLPItem item; // Item that's being iterated over.
        uint256 nextPtr; // Position of the next item in the list.
    }

    /*
     * @dev Returns the next element in the iteration. Reverts if it has not next element.
     * @param self The iterator.
     * @return The next element in the iteration.
     */
    function next(Iterator memory self) internal pure returns (RLPItem memory) {
        require(hasNext(self));

        uint256 ptr = self.nextPtr;
        uint256 itemLength = _itemLength(ptr);
        self.nextPtr = ptr + itemLength;

        return RLPItem(itemLength, ptr);
    }

    /*
     * @dev Returns true if the iteration has more elements.
     * @param self The iterator.
     * @return true if the iteration has more elements.
     */
    function hasNext(Iterator memory self) internal pure returns (bool) {
        RLPItem memory item = self.item;
        return self.nextPtr < item.memPtr + item.len;
    }

    /*
     * @param item RLP encoded bytes
     */
    function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) {
        uint256 memPtr;
        assembly {
            memPtr := add(item, 0x20)
        }

        return RLPItem(item.length, memPtr);
    }

    /*
     * @dev Create an iterator. Reverts if item is not a list.
     * @param self The RLP item.
     * @return An 'Iterator' over the item.
     */
    function iterator(RLPItem memory self) internal pure returns (Iterator memory) {
        require(isList(self));

        uint256 ptr = self.memPtr + _payloadOffset(self.memPtr);
        return Iterator(self, ptr);
    }

    /*
     * @param the RLP item.
     */
    function rlpLen(RLPItem memory item) internal pure returns (uint256) {
        return item.len;
    }

    /*
     * @param the RLP item.
     * @return (memPtr, len) pair: location of the item's payload in memory.
     */
    function payloadLocation(RLPItem memory item) internal pure returns (uint256, uint256) {
        uint256 offset = _payloadOffset(item.memPtr);
        uint256 memPtr = item.memPtr + offset;
        uint256 len = item.len - offset; // data length
        return (memPtr, len);
    }

    /*
     * @param the RLP item.
     */
    function payloadLen(RLPItem memory item) internal pure returns (uint256) {
        (, uint256 len) = payloadLocation(item);
        return len;
    }

    /*
     * @param the RLP item containing the encoded list.
     */
    function toList(RLPItem memory item) internal pure returns (RLPItem[] memory) {
        require(isList(item));

        uint256 items = numItems(item);
        RLPItem[] memory result = new RLPItem[](items);

        uint256 memPtr = item.memPtr + _payloadOffset(item.memPtr);
        uint256 dataLen;
        for (uint256 i = 0; i < items; i++) {
            dataLen = _itemLength(memPtr);
            result[i] = RLPItem(dataLen, memPtr);
            memPtr = memPtr + dataLen;
        }

        return result;
    }

    // @return indicator whether encoded payload is a list. negate this function call for isData.
    function isList(RLPItem memory item) internal pure returns (bool) {
        if (item.len == 0) return false;

        uint8 byte0;
        uint256 memPtr = item.memPtr;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }

        if (byte0 < LIST_SHORT_START) return false;
        return true;
    }

    /*
     * @dev A cheaper version of keccak256(toRlpBytes(item)) that avoids copying memory.
     * @return keccak256 hash of RLP encoded bytes.
     */
    function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) {
        uint256 ptr = item.memPtr;
        uint256 len = item.len;
        bytes32 result;
        assembly {
            result := keccak256(ptr, len)
        }
        return result;
    }

    /*
     * @dev A cheaper version of keccak256(toBytes(item)) that avoids copying memory.
     * @return keccak256 hash of the item payload.
     */
    function payloadKeccak256(RLPItem memory item) internal pure returns (bytes32) {
        (uint256 memPtr, uint256 len) = payloadLocation(item);
        bytes32 result;
        assembly {
            result := keccak256(memPtr, len)
        }
        return result;
    }

    /** RLPItem conversions into data types **/

    // @returns raw rlp encoding in bytes
    function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) {
        bytes memory result = new bytes(item.len);
        if (result.length == 0) return result;

        uint256 ptr;
        assembly {
            ptr := add(0x20, result)
        }

        copy(item.memPtr, ptr, item.len);
        return result;
    }

    // any non-zero byte except "0x80" is considered true
    function toBoolean(RLPItem memory item) internal pure returns (bool) {
        require(item.len == 1);
        uint256 result;
        uint256 memPtr = item.memPtr;
        assembly {
            result := byte(0, mload(memPtr))
        }

        // SEE Github Issue #5.
        // Summary: Most commonly used RLP libraries (i.e Geth) will encode
        // "0" as "0x80" instead of as "0". We handle this edge case explicitly
        // here.
        if (result == 0 || result == STRING_SHORT_START) {
            return false;
        } else {
            return true;
        }
    }

    function toAddress(RLPItem memory item) internal pure returns (address) {
        // 1 byte for the length prefix
        require(item.len == 21);

        return address(uint160(toUint(item)));
    }

    function toUint(RLPItem memory item) internal pure returns (uint256) {
        require(item.len > 0 && item.len <= 33);

        (uint256 memPtr, uint256 len) = payloadLocation(item);

        uint256 result;
        assembly {
            result := mload(memPtr)

            // shift to the correct location if neccesary
            if lt(len, 32) {
                result := div(result, exp(256, sub(32, len)))
            }
        }

        return result;
    }

    // enforces 32 byte length
    function toUintStrict(RLPItem memory item) internal pure returns (uint256) {
        // one byte prefix
        require(item.len == 33);

        uint256 result;
        uint256 memPtr = item.memPtr + 1;
        assembly {
            result := mload(memPtr)
        }

        return result;
    }

    function toBytes(RLPItem memory item) internal pure returns (bytes memory) {
        require(item.len > 0);

        (uint256 memPtr, uint256 len) = payloadLocation(item);
        bytes memory result = new bytes(len);

        uint256 destPtr;
        assembly {
            destPtr := add(0x20, result)
        }

        copy(memPtr, destPtr, len);
        return result;
    }

    /*
     * Private Helpers
     */

    // @return number of payload items inside an encoded list.
    function numItems(RLPItem memory item) private pure returns (uint256) {
        if (item.len == 0) return 0;

        uint256 count = 0;
        uint256 currPtr = item.memPtr + _payloadOffset(item.memPtr);
        uint256 endPtr = item.memPtr + item.len;
        while (currPtr < endPtr) {
            currPtr = currPtr + _itemLength(currPtr); // skip over an item
            count++;
        }

        return count;
    }

    // @return entire rlp item byte length
    function _itemLength(uint256 memPtr) private pure returns (uint256) {
        uint256 itemLen;
        uint256 byte0;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }

        if (byte0 < STRING_SHORT_START) {
            itemLen = 1;
        } else if (byte0 < STRING_LONG_START) {
            itemLen = byte0 - STRING_SHORT_START + 1;
        } else if (byte0 < LIST_SHORT_START) {
            assembly {
                let byteLen := sub(byte0, 0xb7) // # of bytes the actual length is
                memPtr := add(memPtr, 1) // skip over the first byte

                /* 32 byte word size */
                let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to get the len
                itemLen := add(dataLen, add(byteLen, 1))
            }
        } else if (byte0 < LIST_LONG_START) {
            itemLen = byte0 - LIST_SHORT_START + 1;
        } else {
            assembly {
                let byteLen := sub(byte0, 0xf7)
                memPtr := add(memPtr, 1)

                let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to the correct length
                itemLen := add(dataLen, add(byteLen, 1))
            }
        }

        return itemLen;
    }

    // @return number of bytes until the data
    function _payloadOffset(uint256 memPtr) private pure returns (uint256) {
        uint256 byte0;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }

        if (byte0 < STRING_SHORT_START) {
            return 0;
        } else if (byte0 < STRING_LONG_START || (byte0 >= LIST_SHORT_START && byte0 < LIST_LONG_START)) {
            return 1;
        } else if (byte0 < LIST_SHORT_START) {
            // being explicit
            return byte0 - (STRING_LONG_START - 1) + 1;
        } else {
            return byte0 - (LIST_LONG_START - 1) + 1;
        }
    }

    /*
     * @param src Pointer to source
     * @param dest Pointer to destination
     * @param len Amount of memory to copy from the source
     */
    function copy(uint256 src, uint256 dest, uint256 len) private pure {
        if (len == 0) return;

        // copy as many word sizes as possible
        for (; len >= WORD_SIZE; len -= WORD_SIZE) {
            assembly {
                mstore(dest, mload(src))
            }

            src += WORD_SIZE;
            dest += WORD_SIZE;
        }

        if (len > 0) {
            // left over bytes. Mask is used to remove unwanted bytes from the word
            uint256 mask = 256**(WORD_SIZE - len) - 1;
            assembly {
                let srcpart := and(mload(src), not(mask)) // zero out src
                let destpart := and(mload(dest), mask) // retrieve the bytes
                mstore(dest, or(destpart, srcpart))
            }
        }
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"},{"internalType":"contract IBrevisProof","name":"_brevisProof","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"FeeCollectorUpdated","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":"bytes32","name":"requestId","type":"bytes32"}],"name":"RequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"callback","type":"address"}],"name":"RequestSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"from","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"to","type":"uint256"}],"name":"RequestTimeoutUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32[]","name":"requestId","type":"bytes32[]"}],"name":"RequestsFulfilled","type":"event"},{"inputs":[],"name":"brevisProof","outputs":[{"internalType":"contract IBrevisProof","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"collectFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_chainId","type":"uint64"},{"internalType":"bytes32[]","name":"_requestIds","type":"bytes32[]"},{"internalType":"bytes","name":"_proof","type":"bytes"},{"components":[{"internalType":"bytes32","name":"commitHash","type":"bytes32"},{"internalType":"bytes32","name":"vkHash","type":"bytes32"},{"internalType":"bytes32","name":"appCommitHash","type":"bytes32"},{"internalType":"bytes32","name":"appVkHash","type":"bytes32"},{"internalType":"bytes32","name":"smtRoot","type":"bytes32"}],"internalType":"struct Brevis.ProofData[]","name":"_proofDataArray","type":"tuple[]"},{"internalType":"bytes[]","name":"_appCircuitOutputs","type":"bytes[]"},{"internalType":"address","name":"_callback","type":"address"}],"name":"fulfillAggRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint64","name":"_chainId","type":"uint64"},{"internalType":"bytes","name":"_proof","type":"bytes"},{"internalType":"bool","name":"_withAppProof","type":"bool"},{"internalType":"bytes","name":"_appCircuitOutput","type":"bytes"}],"name":"fulfillRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"}],"name":"queryRequestStatus","outputs":[{"internalType":"enum BrevisRequest.RequestStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestTimeout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"requests","outputs":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"address","name":"refundee","type":"address"},{"internalType":"address","name":"callback","type":"address"},{"internalType":"enum BrevisRequest.RequestStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"address","name":"_refundee","type":"address"},{"internalType":"address","name":"_callback","type":"address"}],"name":"sendRequest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timeout","type":"uint256"}],"name":"setRequestTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080346100c057601f6111d238819003918201601f19168301916001600160401b038311848410176100c55780849260409485528339810103126100c05780516001600160a01b0391828216918290036100c05760200151908282168092036100c0576000549060018060a01b0319913383821617600055604051943391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a381600154161760015560035416176003556110f690816100dc8239f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001d575b50361561001b57600080fd5b005b600090813560e01c9081633f20b4c914610e2057508063622b6af414610dbd5780636a96173514610b50578063715018a614610af35780637249fbb61461099a5780637ff7b0d2146109085780638da5cb5b146108e25780639d86698514610878578063a42dce80146107ff578063b6979c3e146107c5578063c415b95c1461079e578063c7f5aaa014610777578063da47dc321461056c578063ecdafd46146101ae5763f2fde38b0361000f57346101ab5760203660031901126101ab576100e4610e85565b6001600160a01b0380916100fc828554163314610eef565b1690811561014057600054826001600160a01b0319821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b80fd5b50346101ab5760c03660031901126101ab5760043567ffffffffffffffff81168103610560578160243567ffffffffffffffff8111610560576101f5903690600401610ebe565b919060443567ffffffffffffffff811161055c57610217903690600401610e3c565b939067ffffffffffffffff60643511610568573660236064350112156105685767ffffffffffffffff60643560040135116105685736602460a060643560040135026064350101116105685760843567ffffffffffffffff811161056457610283903690600401610ebe565b9490956001600160a01b0360a4351660a43503610560576001600160a01b0360035416803b1561055c57604051633ab58d6f60e21b815267ffffffffffffffff8a166004820152606060248201529384928391859183916102fe916102ec606485018c8e611037565b84810360031901604486015291610fd6565b03925af1801561055157610521575b5060015b8160ff8216106104cf5750907fc9f9dbb4a40f26672580c28841452a59f824f5c0053e412183cfec77e76570ef91610356604051928392602084526020840191611037565b0390a16001600160a01b0360a4351661036d578380f35b83916040519363ed1fe83b60e01b602086015267ffffffffffffffff60848601911660248601526060604486015260643560040135905260a4840191602460643501845b60643560040135811061048e575050602319858403016064860152808352602083019060208160051b850101938386915b838310610421575050505050509161040481839403601f198101835282610f3a565b6020815191018260a4355af150610419610ff7565b503880808380f35b9193959092949650601f198282030186528635601e198436030181121561048a578301906020823592019167ffffffffffffffff8111610486578036038313610486576104746020928392600195610fd6565b980196019301909188969594926103e2565b8a80fd5b8980fd5b813585526020808301359086015260408083013590860152606080830135908601526080808301359086015287955060a094850194909101906001016103b1565b611fe08160051b168301358752600460205260036040882001600160a01b60ff60a01b1982541617905560ff80911690811461050d57600101610311565b634e487b7160e01b87526011600452602487fd5b67ffffffffffffffff819792971161053d57604052943861030d565b634e487b7160e01b82526041600452602482fd5b6040513d89823e3d90fd5b8280fd5b5080fd5b8480fd5b8380fd5b5060603660031901126101ab57600435610584610e6f565b604435906001600160a01b03808316809303610564578385526020916004835260408620546107325781169081156106ed5760025442019081421161050d576040519160a0830183811067ffffffffffffffff8211176106d957604052825260038483019234845260408101948552606081019487865260808201948a8652898b526004885260408b209251835551600183015583600283019151166001600160a01b0319825416179055019251168254915160038110156106c5579160809593917fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000007f4eede03ca33645529b4d82428b024149165298c901cf7453f68eb43bd3d3b65899979560a01b1692161717905560405192835233908301523460408301526060820152a180f35b634e487b7160e01b88526021600452602488fd5b634e487b7160e01b89526041600452602489fd5b60405162461bcd60e51b815260048101849052601560248201527f726566756e646565206e6f742070726f766964656400000000000000000000006044820152606490fd5b60405162461bcd60e51b815260048101849052601860248201527f7265717565737420616c726561647920696e20717565756500000000000000006044820152606490fd5b50346101ab57806003193601126101ab5760206001600160a01b0360035416604051908152f35b50346101ab57806003193601126101ab5760206001600160a01b0360015416604051908152f35b50346101ab5760203660031901126101ab5760ff6003604060209360043581526004855220015460a01c166107fd6040518092610e9b565bf35b50346101ab5760203660031901126101ab577f5d16ad41baeb009cd23eb8f6c7cde5c2e0cd5acf4a33926ab488875c37c37f38604061083c610e85565b6001600160a01b03610852818654163314610eef565b80600154921690816001600160a01b03198416176001558351921682526020820152a180f35b50346101ab5760203660031901126101ab57604060a09160043581526004602052206107fd8154916001810154906001600160a01b039060038260028301541691015492604051958652602086015260408501528116606084015260ff6080840191851c16610e9b565b50346101ab57806003193601126101ab576001600160a01b036020915416604051908152f35b50346101ab5760403660031901126101ab57610922610e6f565b6001600160a01b036001541633036109555781808080610952946004359061c350f161094c610ff7565b50611074565b80f35b60405162461bcd60e51b815260206004820152601160248201527f6e6f742066656520636f6c6c6563746f720000000000000000000000000000006044820152606490fd5b50346101ab576020806003193601126105605760043580835260048252604083205442111561055c576001600160a01b036024838260035416604051928380926371e8f36b60e11b82528760048301525afa8015610ae857610a04918691610abb575b5015610f8a565b81845260048352604084205415610a765790610a478480808060049796868252888852600160408320918383556002830154169101549061c350f161094c610ff7565b835252600360408220017402000000000000000000000000000000000000000060ff60a01b1982541617905580f35b60405162461bcd60e51b815260048101849052601460248201527f72657175657374206e6f7420696e2071756575650000000000000000000000006044820152606490fd5b610adb9150853d8711610ae1575b610ad38183610f3a565b810190610f72565b386109fd565b503d610ac9565b6040513d87823e3d90fd5b50346101ab57806003193601126101ab578080546001600160a01b03196001600160a01b03821691610b26338414610eef565b1682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101ab5760a03660031901126101ab576004359060243567ffffffffffffffff9283821680920361055c5760443584811161056857610b95903690600401610e3c565b60649291923595861515809703610d8557608435908111610d8557610bbe903690600401610e3c565b9390946001600160a01b0392836003541691604051996371e8f36b60e11b8b528660048c015260209a8b81602481885afa908115610db25792610c3c969492610c128d938f98968591610d9b575015610f8a565b60405197889687958694630979240d60e21b86526004860152606060248601526064850191610fd6565b90604483015203925af1908115610d90578691610d5f575b508203610d1a579484958286526004825260036040872001600160a01b60ff60a01b198254161790557f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e682604051858152a1828652600482526003604087200154169283610cc0578580f35b610d02869592610cf48794604051948593840197633ceb5b5160e11b89526024850152604060448501526064840191610fd6565b03601f198101835282610f3a565b51925af150610d0f610ff7565b508038808080808580f35b60405162461bcd60e51b815260048101879052601d60248201527f72657175657374496420616e642070726f6f66206e6f74206d617463680000006044820152606490fd5b90508681813d8311610d89575b610d768183610f3a565b81010312610d85575138610c54565b8580fd5b503d610d6c565b6040513d88823e3d90fd5b610adb9150893d8b11610ae157610ad38183610f3a565b6040513d8d823e3d90fd5b50346101ab5760203660031901126101ab577f87a73c061f18ffd513249d1d727921e40e348948b01e2979efb36ef4f5204a636040600435610e0a6001600160a01b038554163314610eef565b600254908060025582519182526020820152a180f35b9050346105605781600319360112610560576020906002548152f35b9181601f84011215610e6a5782359167ffffffffffffffff8311610e6a5760208381860195010111610e6a57565b600080fd5b602435906001600160a01b0382168203610e6a57565b600435906001600160a01b0382168203610e6a57565b906003821015610ea85752565b634e487b7160e01b600052602160045260246000fd5b9181601f84011215610e6a5782359167ffffffffffffffff8311610e6a576020808501948460051b010111610e6a57565b15610ef657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90601f8019910116810190811067ffffffffffffffff821117610f5c57604052565b634e487b7160e01b600052604160045260246000fd5b90816020910312610e6a57518015158103610e6a5790565b15610f9157565b60405162461bcd60e51b815260206004820152601760248201527f70726f6f6620616c72656164792067656e6572617465640000000000000000006044820152606490fd5b908060209392818452848401376000828201840152601f01601f1916010190565b3d15611032573d9067ffffffffffffffff8211610f5c5760405191611026601f8201601f191660200184610f3a565b82523d6000602084013e565b606090565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311610e6a5760209260051b809284830137010190565b1561107b57565b60405162461bcd60e51b815260206004820152601260248201527f73656e64206e6174697665206661696c656400000000000000000000000000006044820152606490fdfea26469706673582212209dd077b9c3be4587b2cf81bdb247c5c2c397f419c207eaef633fccca042b659764736f6c6343000814003300000000000000000000000058b529f9084d7eaa598eb3477fe36064c5b7bbc1000000000000000000000000728b3c4c8b88ad54b8118d4c6a65fac35e4cab6b

Deployed Bytecode

0x608080604052600436101561001d575b50361561001b57600080fd5b005b600090813560e01c9081633f20b4c914610e2057508063622b6af414610dbd5780636a96173514610b50578063715018a614610af35780637249fbb61461099a5780637ff7b0d2146109085780638da5cb5b146108e25780639d86698514610878578063a42dce80146107ff578063b6979c3e146107c5578063c415b95c1461079e578063c7f5aaa014610777578063da47dc321461056c578063ecdafd46146101ae5763f2fde38b0361000f57346101ab5760203660031901126101ab576100e4610e85565b6001600160a01b0380916100fc828554163314610eef565b1690811561014057600054826001600160a01b0319821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b80fd5b50346101ab5760c03660031901126101ab5760043567ffffffffffffffff81168103610560578160243567ffffffffffffffff8111610560576101f5903690600401610ebe565b919060443567ffffffffffffffff811161055c57610217903690600401610e3c565b939067ffffffffffffffff60643511610568573660236064350112156105685767ffffffffffffffff60643560040135116105685736602460a060643560040135026064350101116105685760843567ffffffffffffffff811161056457610283903690600401610ebe565b9490956001600160a01b0360a4351660a43503610560576001600160a01b0360035416803b1561055c57604051633ab58d6f60e21b815267ffffffffffffffff8a166004820152606060248201529384928391859183916102fe916102ec606485018c8e611037565b84810360031901604486015291610fd6565b03925af1801561055157610521575b5060015b8160ff8216106104cf5750907fc9f9dbb4a40f26672580c28841452a59f824f5c0053e412183cfec77e76570ef91610356604051928392602084526020840191611037565b0390a16001600160a01b0360a4351661036d578380f35b83916040519363ed1fe83b60e01b602086015267ffffffffffffffff60848601911660248601526060604486015260643560040135905260a4840191602460643501845b60643560040135811061048e575050602319858403016064860152808352602083019060208160051b850101938386915b838310610421575050505050509161040481839403601f198101835282610f3a565b6020815191018260a4355af150610419610ff7565b503880808380f35b9193959092949650601f198282030186528635601e198436030181121561048a578301906020823592019167ffffffffffffffff8111610486578036038313610486576104746020928392600195610fd6565b980196019301909188969594926103e2565b8a80fd5b8980fd5b813585526020808301359086015260408083013590860152606080830135908601526080808301359086015287955060a094850194909101906001016103b1565b611fe08160051b168301358752600460205260036040882001600160a01b60ff60a01b1982541617905560ff80911690811461050d57600101610311565b634e487b7160e01b87526011600452602487fd5b67ffffffffffffffff819792971161053d57604052943861030d565b634e487b7160e01b82526041600452602482fd5b6040513d89823e3d90fd5b8280fd5b5080fd5b8480fd5b8380fd5b5060603660031901126101ab57600435610584610e6f565b604435906001600160a01b03808316809303610564578385526020916004835260408620546107325781169081156106ed5760025442019081421161050d576040519160a0830183811067ffffffffffffffff8211176106d957604052825260038483019234845260408101948552606081019487865260808201948a8652898b526004885260408b209251835551600183015583600283019151166001600160a01b0319825416179055019251168254915160038110156106c5579160809593917fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000007f4eede03ca33645529b4d82428b024149165298c901cf7453f68eb43bd3d3b65899979560a01b1692161717905560405192835233908301523460408301526060820152a180f35b634e487b7160e01b88526021600452602488fd5b634e487b7160e01b89526041600452602489fd5b60405162461bcd60e51b815260048101849052601560248201527f726566756e646565206e6f742070726f766964656400000000000000000000006044820152606490fd5b60405162461bcd60e51b815260048101849052601860248201527f7265717565737420616c726561647920696e20717565756500000000000000006044820152606490fd5b50346101ab57806003193601126101ab5760206001600160a01b0360035416604051908152f35b50346101ab57806003193601126101ab5760206001600160a01b0360015416604051908152f35b50346101ab5760203660031901126101ab5760ff6003604060209360043581526004855220015460a01c166107fd6040518092610e9b565bf35b50346101ab5760203660031901126101ab577f5d16ad41baeb009cd23eb8f6c7cde5c2e0cd5acf4a33926ab488875c37c37f38604061083c610e85565b6001600160a01b03610852818654163314610eef565b80600154921690816001600160a01b03198416176001558351921682526020820152a180f35b50346101ab5760203660031901126101ab57604060a09160043581526004602052206107fd8154916001810154906001600160a01b039060038260028301541691015492604051958652602086015260408501528116606084015260ff6080840191851c16610e9b565b50346101ab57806003193601126101ab576001600160a01b036020915416604051908152f35b50346101ab5760403660031901126101ab57610922610e6f565b6001600160a01b036001541633036109555781808080610952946004359061c350f161094c610ff7565b50611074565b80f35b60405162461bcd60e51b815260206004820152601160248201527f6e6f742066656520636f6c6c6563746f720000000000000000000000000000006044820152606490fd5b50346101ab576020806003193601126105605760043580835260048252604083205442111561055c576001600160a01b036024838260035416604051928380926371e8f36b60e11b82528760048301525afa8015610ae857610a04918691610abb575b5015610f8a565b81845260048352604084205415610a765790610a478480808060049796868252888852600160408320918383556002830154169101549061c350f161094c610ff7565b835252600360408220017402000000000000000000000000000000000000000060ff60a01b1982541617905580f35b60405162461bcd60e51b815260048101849052601460248201527f72657175657374206e6f7420696e2071756575650000000000000000000000006044820152606490fd5b610adb9150853d8711610ae1575b610ad38183610f3a565b810190610f72565b386109fd565b503d610ac9565b6040513d87823e3d90fd5b50346101ab57806003193601126101ab578080546001600160a01b03196001600160a01b03821691610b26338414610eef565b1682557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101ab5760a03660031901126101ab576004359060243567ffffffffffffffff9283821680920361055c5760443584811161056857610b95903690600401610e3c565b60649291923595861515809703610d8557608435908111610d8557610bbe903690600401610e3c565b9390946001600160a01b0392836003541691604051996371e8f36b60e11b8b528660048c015260209a8b81602481885afa908115610db25792610c3c969492610c128d938f98968591610d9b575015610f8a565b60405197889687958694630979240d60e21b86526004860152606060248601526064850191610fd6565b90604483015203925af1908115610d90578691610d5f575b508203610d1a579484958286526004825260036040872001600160a01b60ff60a01b198254161790557f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e682604051858152a1828652600482526003604087200154169283610cc0578580f35b610d02869592610cf48794604051948593840197633ceb5b5160e11b89526024850152604060448501526064840191610fd6565b03601f198101835282610f3a565b51925af150610d0f610ff7565b508038808080808580f35b60405162461bcd60e51b815260048101879052601d60248201527f72657175657374496420616e642070726f6f66206e6f74206d617463680000006044820152606490fd5b90508681813d8311610d89575b610d768183610f3a565b81010312610d85575138610c54565b8580fd5b503d610d6c565b6040513d88823e3d90fd5b610adb9150893d8b11610ae157610ad38183610f3a565b6040513d8d823e3d90fd5b50346101ab5760203660031901126101ab577f87a73c061f18ffd513249d1d727921e40e348948b01e2979efb36ef4f5204a636040600435610e0a6001600160a01b038554163314610eef565b600254908060025582519182526020820152a180f35b9050346105605781600319360112610560576020906002548152f35b9181601f84011215610e6a5782359167ffffffffffffffff8311610e6a5760208381860195010111610e6a57565b600080fd5b602435906001600160a01b0382168203610e6a57565b600435906001600160a01b0382168203610e6a57565b906003821015610ea85752565b634e487b7160e01b600052602160045260246000fd5b9181601f84011215610e6a5782359167ffffffffffffffff8311610e6a576020808501948460051b010111610e6a57565b15610ef657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90601f8019910116810190811067ffffffffffffffff821117610f5c57604052565b634e487b7160e01b600052604160045260246000fd5b90816020910312610e6a57518015158103610e6a5790565b15610f9157565b60405162461bcd60e51b815260206004820152601760248201527f70726f6f6620616c72656164792067656e6572617465640000000000000000006044820152606490fd5b908060209392818452848401376000828201840152601f01601f1916010190565b3d15611032573d9067ffffffffffffffff8211610f5c5760405191611026601f8201601f191660200184610f3a565b82523d6000602084013e565b606090565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311610e6a5760209260051b809284830137010190565b1561107b57565b60405162461bcd60e51b815260206004820152601260248201527f73656e64206e6174697665206661696c656400000000000000000000000000006044820152606490fdfea26469706673582212209dd077b9c3be4587b2cf81bdb247c5c2c397f419c207eaef633fccca042b659764736f6c63430008140033

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

00000000000000000000000058b529f9084d7eaa598eb3477fe36064c5b7bbc1000000000000000000000000728b3c4c8b88ad54b8118d4c6a65fac35e4cab6b

-----Decoded View---------------
Arg [0] : _feeCollector (address): 0x58b529F9084D7eAA598EB3477Fe36064C5B7bbC1
Arg [1] : _brevisProof (address): 0x728b3C4C8b88AD54B8118D4c6a65fAC35e4CAb6B

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000058b529f9084d7eaa598eb3477fe36064c5b7bbc1
Arg [1] : 000000000000000000000000728b3c4c8b88ad54b8118d4c6a65fac35e4cab6b


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
[ Download: CSV Export  ]

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