ETH Price: $2,436.17 (-9.55%)

Contract

0x5cD66C034214A9958E55178A728452D4FA752Af7

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Settle3584655712025-07-16 23:54:27199 days ago1752710067IN
0x5cD66C03...4FA752Af7
0 ETH0.000001460.01
Settle3584636092025-07-16 23:46:16199 days ago1752709576IN
0x5cD66C03...4FA752Af7
0 ETH0.000000360.01
Submit Initial R...3584631302025-07-16 23:44:16199 days ago1752709456IN
0x5cD66C03...4FA752Af7
0 ETH0.000003110.01
Settle3584624952025-07-16 23:41:38199 days ago1752709298IN
0x5cD66C03...4FA752Af7
0 ETH0.000001690.01
Submit Initial R...3584624132025-07-16 23:41:18199 days ago1752709278IN
0x5cD66C03...4FA752Af7
0 ETH0.000003060.01
Settle3584623762025-07-16 23:41:08199 days ago1752709268IN
0x5cD66C03...4FA752Af7
0 ETH0.000001690.01
Submit Initial R...3584622222025-07-16 23:40:30199 days ago1752709230IN
0x5cD66C03...4FA752Af7
0 ETH0.000003060.01
Settle3584616052025-07-16 23:37:55199 days ago1752709075IN
0x5cD66C03...4FA752Af7
0 ETH0.000001690.01
Submit Initial R...3584613942025-07-16 23:37:02199 days ago1752709022IN
0x5cD66C03...4FA752Af7
0 ETH0.000003060.01
Settle3584554572025-07-16 23:12:21199 days ago1752707541IN
0x5cD66C03...4FA752Af7
0 ETH0.00000180.01
Submit Initial R...3584553962025-07-16 23:12:05199 days ago1752707525IN
0x5cD66C03...4FA752Af7
0 ETH0.000003210.01
Settle3584553582025-07-16 23:11:56199 days ago1752707516IN
0x5cD66C03...4FA752Af7
0 ETH0.00000180.01
Submit Initial R...3584552932025-07-16 23:11:39199 days ago1752707499IN
0x5cD66C03...4FA752Af7
0 ETH0.000003210.01
Settle3584552512025-07-16 23:11:29199 days ago1752707489IN
0x5cD66C03...4FA752Af7
0 ETH0.00000180.01
Submit Initial R...3584551002025-07-16 23:10:51199 days ago1752707451IN
0x5cD66C03...4FA752Af7
0 ETH0.000003210.01
Dispute And Swap3584526992025-07-16 23:00:54199 days ago1752706854IN
0x5cD66C03...4FA752Af7
0 ETH0.000000660.01
Submit Initial R...3584525722025-07-16 23:00:22199 days ago1752706822IN
0x5cD66C03...4FA752Af7
0 ETH0.000000550.01
Dispute And Swap3584525592025-07-16 23:00:19199 days ago1752706819IN
0x5cD66C03...4FA752Af7
0 ETH0.000003190.01
Dispute And Swap3584522472025-07-16 22:59:01199 days ago1752706741IN
0x5cD66C03...4FA752Af7
0 ETH0.000001720.01
Dispute And Swap3584510592025-07-16 22:54:05199 days ago1752706445IN
0x5cD66C03...4FA752Af7
0 ETH0.000001110.014349
Submit Initial R...3584510582025-07-16 22:54:05199 days ago1752706445IN
0x5cD66C03...4FA752Af7
0 ETH0.000000710.014475
Dispute And Swap3584510572025-07-16 22:54:04199 days ago1752706444IN
0x5cD66C03...4FA752Af7
0 ETH0.000004430.014436
Dispute And Swap3584493392025-07-16 22:46:56199 days ago1752706016IN
0x5cD66C03...4FA752Af7
0 ETH0.000004570.015178
Dispute And Swap3584492212025-07-16 22:46:27199 days ago1752705987IN
0x5cD66C03...4FA752Af7
0 ETH0.000001470.014894
Submit Initial R...3584492062025-07-16 22:46:23199 days ago1752705983IN
0x5cD66C03...4FA752Af7
0 ETH0.000005770.014683
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
3584655712025-07-16 23:54:27199 days ago1752710067
0x5cD66C03...4FA752Af7
0.000072 ETH
3584655712025-07-16 23:54:27199 days ago1752710067
0x5cD66C03...4FA752Af7
0.000014 ETH
3584624952025-07-16 23:41:38199 days ago1752709298
0x5cD66C03...4FA752Af7
0.000012 ETH
3584624952025-07-16 23:41:38199 days ago1752709298
0x5cD66C03...4FA752Af7
0.0000018 ETH
3584623762025-07-16 23:41:08199 days ago1752709268
0x5cD66C03...4FA752Af7
0.000012 ETH
3584623762025-07-16 23:41:08199 days ago1752709268
0x5cD66C03...4FA752Af7
0.0000018 ETH
3584616052025-07-16 23:37:55199 days ago1752709075
0x5cD66C03...4FA752Af7
0.000012 ETH
3584616052025-07-16 23:37:55199 days ago1752709075
0x5cD66C03...4FA752Af7
0.0000018 ETH
3584554572025-07-16 23:12:21199 days ago1752707541
0x5cD66C03...4FA752Af7
0.000012 ETH
3584554572025-07-16 23:12:21199 days ago1752707541
0x5cD66C03...4FA752Af7
0.0000018 ETH
3584553582025-07-16 23:11:56199 days ago1752707516
0x5cD66C03...4FA752Af7
0.000012 ETH
3584553582025-07-16 23:11:56199 days ago1752707516
0x5cD66C03...4FA752Af7
0.0000018 ETH
3584552512025-07-16 23:11:29199 days ago1752707489
0x5cD66C03...4FA752Af7
0.000012 ETH
3584552512025-07-16 23:11:29199 days ago1752707489
0x5cD66C03...4FA752Af7
0.0000018 ETH
3584525772025-07-16 23:00:24199 days ago1752706824
0x5cD66C03...4FA752Af7
1 wei
3584525772025-07-16 23:00:24199 days ago1752706824
0x5cD66C03...4FA752Af7
0.00000299 ETH
3584525562025-07-16 23:00:18199 days ago1752706818
0x5cD66C03...4FA752Af7
0.000003 ETH
3584522622025-07-16 22:59:05199 days ago1752706745
0x5cD66C03...4FA752Af7
1 wei
3584522622025-07-16 22:59:05199 days ago1752706745
0x5cD66C03...4FA752Af7
0.00000299 ETH
3584522442025-07-16 22:59:00199 days ago1752706740
0x5cD66C03...4FA752Af7
0.000003 ETH
3584510732025-07-16 22:54:08199 days ago1752706448
0x5cD66C03...4FA752Af7
1 wei
3584510732025-07-16 22:54:08199 days ago1752706448
0x5cD66C03...4FA752Af7
0.00000299 ETH
3584510542025-07-16 22:54:04199 days ago1752706444
0x5cD66C03...4FA752Af7
0.000003 ETH
3584493582025-07-16 22:47:01199 days ago1752706021
0x5cD66C03...4FA752Af7
1 wei
3584493582025-07-16 22:47:01199 days ago1752706021
0x5cD66C03...4FA752Af7
0.00000299 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OpenOracle

Compiler Version
v0.8.30+commit.73712a01

Optimization Enabled:
Yes with 190 runs

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

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

/**
 * @title OpenOracle
 * @notice A trust-free price oracle that uses an escalating auction mechanism
 * @dev This contract enables price discovery through economic incentives where
 *      expiration serves as evidence of a good price with appropriate parameters
 * @author OpenOracle Team
 * @custom:version 0.1.6
 * @custom:documentation https://openprices.gitbook.io/openoracle-docs
 */
contract OpenOracle is ReentrancyGuard, Ownable {
    using SafeERC20 for IERC20;

    // Custom errors for gas optimization
    error InvalidInput(string parameter);
    error InsufficientAmount(string resource);
    error AlreadyProcessed(string action);
    error InvalidTiming(string action);
    error OutOfBounds(string parameter);
    error TokensCannotBeSame();
    error NoReportToDispute();
    error DisputeAlreadyInBlock();
    error EthTransferFailed();
    error CallToArbSysFailed();

    // Constants
    uint256 public constant PRICE_PRECISION = 1e18;
    uint256 public constant PERCENTAGE_PRECISION = 1e7;
    uint256 public constant MULTIPLIER_PRECISION = 100;
    uint256 public constant SETTLEMENT_WINDOW = 60; // 60 seconds for testing
    uint256 public constant SETTLEMENT_WINDOW_BLOCKS = 1350; // 5 minutes @ 4.5 blocks per second on Arbitrum

    // State variables
    uint256 public nextReportId = 1;
    address public protocolFeeRecipient;

    mapping(uint256 => ReportMeta) public reportMeta;
    mapping(uint256 => ReportStatus) public reportStatus;
    mapping(address => uint256) public protocolFees;
    mapping(uint256 => extraReportData) public extraData;
    mapping(uint256 => mapping(uint256 => disputeRecord)) public disputeHistory;

    struct disputeRecord{
        uint256 amount1;
        uint256 amount2;
        uint256 reportTimestamp;
    }

    struct extraReportData {
        address creator;
        uint256 requestTrueTime;
        address callbackContract;
        bytes4 callbackSelector;
        bool trackDisputes;
        uint256 numReports;
        uint256 callbackGasLimit;
        bool keepFee;
    }

    // Type declarations
    struct ReportMeta {
        address token1;
        address token2;
        uint256 feePercentage;
        uint256 multiplier;
        uint256 settlementTime;
        uint256 exactToken1Report;
        uint256 fee;
        uint256 escalationHalt;
        uint256 disputeDelay;
        uint256 protocolFee;
        uint256 settlerReward;
        uint256 requestBlock;
        bool timeType;
    }

    struct ReportStatus {
        uint256 currentAmount1;
        uint256 currentAmount2;
        address payable currentReporter;
        address payable initialReporter;
        uint256 reportTimestamp;
        uint256 settlementTimestamp;
        uint256 price;
        uint256 lastDisputeBlock;
        bool isSettled;
        bool disputeOccurred;
        bool isDistributed;
        uint256 initialReportTimestamp;
        uint256 lastReportTrueTime; //always wall time independent of timeType
    }

    struct CreateReportParams {
        address token1Address;
        address token2Address;
        uint256 exactToken1Report;
        uint256 feePercentage;
        uint256 multiplier;
        uint256 settlementTime;
        uint256 escalationHalt;
        uint256 disputeDelay;
        uint256 protocolFee;
        uint256 settlerReward;
        bool timeType;
        address callbackContract;
        bytes4 callbackSelector;
        bool trackDisputes;
        uint256 callbackGasLimit;
        bool keepFee;
    }

    // Events
    event ReportInstanceCreated(
        uint256 indexed reportId,
        address indexed token1Address,
        address indexed token2Address,
        uint256 feePercentage,
        uint256 multiplier,
        uint256 exactToken1Report,
        uint256 ethFee,
        address creator,
        uint256 settlementTime,
        uint256 escalationHalt,
        uint256 disputeDelay,
        uint256 protocolFee,
        uint256 settlerReward,
        bool timeType,
        address callbackContract,
        bytes4 callbackSelector,
        bool trackDisputes,
        uint256 callbackGasLimit,
        bool keepFee // if initial reporter loses reward when swapped against
    );

    event InitialReportSubmitted(
        uint256 indexed reportId,
        address reporter,
        uint256 amount1,
        uint256 amount2,
        address indexed token1Address,
        address indexed token2Address,
        uint256 swapFee,
        uint256 protocolFee,
        uint256 settlementTime,
        uint256 disputeDelay,
        uint256 escalationHalt,
        bool timeType,
        address callbackContract,
        bytes4 callbackSelector,
        bool trackDisputes,
        uint256 callbackGasLimit
    );

    event ReportDisputed(
        uint256 indexed reportId,
        address disputer,
        uint256 newAmount1,
        uint256 newAmount2,
        address indexed token1Address,
        address indexed token2Address,
        uint256 swapFee,
        uint256 protocolFee,
        uint256 settlementTime,
        uint256 disputeDelay,
        uint256 escalationHalt,
        bool timeType,
        address callbackContract,
        bytes4 callbackSelector,
        bool trackDisputes,
        uint256 callbackGasLimit
    );

    event ReportSettled(uint256 indexed reportId, uint256 price, uint256 settlementTimestamp);

    event ProtocolFeeRecipientUpdated(address indexed oldRecipient, address indexed newRecipient);

    event SettlementCallbackExecuted(uint256 indexed reportId, address indexed callbackContract, bool success);

    constructor() ReentrancyGuard() Ownable(msg.sender) {
        protocolFeeRecipient = 0x043c740dB5d907aa7604c2E8E9E0fffF435fa0e4;
    }

    /**
     * @notice Updates the protocol fee recipient address
     * @param newRecipient The new protocol fee recipient address
     */
    function updateProtocolFeeRecipient(address newRecipient) external onlyOwner {
        require(newRecipient != address(0), "Invalid recipient address");
        address oldRecipient = protocolFeeRecipient;
        protocolFeeRecipient = newRecipient;
        emit ProtocolFeeRecipientUpdated(oldRecipient, newRecipient);
    }

    /**
     * @notice Withdraws accumulated protocol fees for a specific token
     * @param tokenToGet The token address to withdraw fees for
     */
    function getProtocolFees(address tokenToGet) external nonReentrant {
        uint256 amount = protocolFees[tokenToGet];
        if (amount > 0) {
            protocolFees[tokenToGet] = 0;
            _transferTokens(tokenToGet, address(this), payable(protocolFeeRecipient), amount);
        }
    }

    /**
     * @notice Settles a report after the settlement time has elapsed
     * @param reportId The unique identifier for the report to settle
     * @return price The final settled price
     * @return settlementTimestamp The timestamp when the report was settled
     */
    function settle(uint256 reportId) external nonReentrant returns (uint256 price, uint256 settlementTimestamp) {
        ReportStatus storage status = reportStatus[reportId];
        ReportMeta storage meta = reportMeta[reportId];

        if (status.isSettled || status.isDistributed) {
            return status.isSettled ? (status.price, status.settlementTimestamp) : (0, 0);
        }

        if(meta.timeType == true){
            if (block.timestamp < status.reportTimestamp + meta.settlementTime) {
                revert InvalidTiming("settlement");
            }
        }else{
            if (_getBlockNumber() < status.reportTimestamp + meta.settlementTime) {
                revert InvalidTiming("settlement");
            }
        }

        uint256 settlerReward = meta.settlerReward;
        uint256 reporterReward = meta.fee;
        bool isWithinWindow;

        if(meta.timeType == true){
            isWithinWindow = block.timestamp <= status.reportTimestamp + meta.settlementTime + SETTLEMENT_WINDOW;
        }else{
            isWithinWindow = _getBlockNumber() <= status.reportTimestamp + meta.settlementTime + SETTLEMENT_WINDOW_BLOCKS;
        }

        if (isWithinWindow) {
            status.isSettled = true;
            status.settlementTimestamp = meta.timeType ? block.timestamp : _getBlockNumber();
            emit ReportSettled(reportId, status.price, status.settlementTimestamp);
        }

        _sendEth(payable(msg.sender), settlerReward);

        if (status.disputeOccurred) {
            if (extraData[reportId].keepFee){
            _sendEth(status.initialReporter, reporterReward);
            }else{
            _sendEth(payable(protocolFeeRecipient), reporterReward);
            }
        } else {
            _sendEth(status.initialReporter, reporterReward);
        }

        _transferTokens(meta.token1, address(this), status.currentReporter, status.currentAmount1);
        _transferTokens(meta.token2, address(this), status.currentReporter, status.currentAmount2);

        status.isDistributed = true;

    // NEW: Execute callback if configured
    extraReportData storage extra = extraData[reportId];
    if (extra.callbackContract != address(0) && extra.callbackSelector != bytes4(0)) {
        // Prepare callback data
        bytes memory callbackData = abi.encodeWithSelector(
            extra.callbackSelector,
            reportId,
            status.price,
            status.settlementTimestamp,
            meta.token1,
            meta.token2
        );
        
        // Execute callback with gas limit
        // Using low-level call to handle failures gracefully
        (bool success, ) = extra.callbackContract.call{gas: extra.callbackGasLimit}(callbackData);
        
        // Emit event regardless of success
        emit SettlementCallbackExecuted(reportId, extra.callbackContract, success);
    }


        return status.isSettled ? (status.price, status.settlementTimestamp) : (0, 0);
    }

    /**
     * @notice Gets the settlement data for a settled report
     * @param reportId The unique identifier for the report
     * @return price The settled price
     * @return settlementTimestamp The timestamp when the report was settled
     */
    function getSettlementData(uint256 reportId) external view returns (uint256 price, uint256 settlementTimestamp) {
        ReportStatus storage status = reportStatus[reportId];
        if (!status.isSettled) revert AlreadyProcessed("not settled");
        return (status.price, status.settlementTimestamp);
    }

    /**
     * @notice Creates a new report instance for price discovery. Backwards-compatible (timeType true)
     * @param token1Address Address of the first token
     * @param token2Address Address of the second token
     * @param exactToken1Report Exact amount of token1 required for reports
     * @param feePercentage Fee in thousandths of basis points (3000 = 3bps)
     * @param multiplier Multiplier in percentage points (110 = 1.1x)
     * @param settlementTime Time in seconds before report can be settled
     * @param escalationHalt Threshold where multiplier drops to 100
     * @param disputeDelay Delay in seconds before disputes are allowed
     * @param protocolFee Protocol fee in thousandths of basis points
     * @param settlerReward Reward for settling the report in wei
     * @return reportId The unique identifier for the created report
     */
    function createReportInstance(
        address token1Address,
        address token2Address,
        uint256 exactToken1Report,
        uint256 feePercentage,
        uint256 multiplier,
        uint256 settlementTime,
        uint256 escalationHalt,
        uint256 disputeDelay,
        uint256 protocolFee,
        uint256 settlerReward
    ) external payable returns (uint256 reportId) {
        CreateReportParams memory params = CreateReportParams({
            token1Address: token1Address,
            token2Address: token2Address,
            exactToken1Report: exactToken1Report,
            feePercentage: feePercentage,
            multiplier: multiplier,
            settlementTime: settlementTime,
            escalationHalt: escalationHalt,
            disputeDelay: disputeDelay,
            protocolFee: protocolFee,
            settlerReward: settlerReward,
            timeType: true,
            callbackContract: address(0),
            callbackSelector: bytes4(0),
            trackDisputes: false,
            callbackGasLimit: 0,
            keepFee: false
        });
        return _createReportInstance(params);
    }

//new function. full control over timeType. true = seconds, false = blocks
    function createReportInstance(
        address token1Address,
        address token2Address,
        uint256 exactToken1Report,
        uint256 feePercentage,
        uint256 multiplier,
        uint256 settlementTime,
        uint256 escalationHalt,
        uint256 disputeDelay,
        uint256 protocolFee,
        uint256 settlerReward,
        bool timeType,
        address callbackContract,
        bytes4 callbackSelector,
        bool trackDisputes,
        uint256 callbackGasLimit,
        bool keepFee
    ) external payable returns (uint256 reportId) {
        CreateReportParams memory params = CreateReportParams({
            token1Address: token1Address,
            token2Address: token2Address,
            exactToken1Report: exactToken1Report,
            feePercentage: feePercentage,
            multiplier: multiplier,
            settlementTime: settlementTime,
            escalationHalt: escalationHalt,
            disputeDelay: disputeDelay,
            protocolFee: protocolFee,
            settlerReward: settlerReward,
            timeType: timeType,
            callbackContract: callbackContract,
            callbackSelector: callbackSelector,
            trackDisputes: trackDisputes,
            callbackGasLimit: callbackGasLimit,
            keepFee: keepFee
        });
        return _createReportInstance(params);
    }

    function _createReportInstance(
    CreateReportParams memory params
    ) internal returns (uint256 reportId) {
        if (msg.value <= 100) revert InsufficientAmount("fee");
        if (params.exactToken1Report == 0) revert InvalidInput("token amount");
        if (params.token1Address == params.token2Address) revert TokensCannotBeSame();
        if (params.settlementTime <= params.disputeDelay) revert InvalidTiming("settlement vs dispute delay");
        if (msg.value <= params.settlerReward) revert InsufficientAmount("settler reward fee");

        reportId = nextReportId++;

        ReportMeta storage meta = reportMeta[reportId];
        meta.token1 = params.token1Address;
        meta.token2 = params.token2Address;
        meta.exactToken1Report = params.exactToken1Report;
        meta.feePercentage = params.feePercentage;
        meta.multiplier = params.multiplier;
        meta.settlementTime = params.settlementTime;
        meta.fee = msg.value - params.settlerReward;
        meta.escalationHalt = params.escalationHalt;
        meta.disputeDelay = params.disputeDelay;
        meta.protocolFee = params.protocolFee;
        meta.settlerReward = params.settlerReward;
        meta.requestBlock = _getBlockNumber();
        meta.timeType = params.timeType;
        extraData[reportId].creator = msg.sender;
        extraData[reportId].requestTrueTime = block.timestamp;
        extraData[reportId].callbackContract = params.callbackContract;
        extraData[reportId].callbackSelector = params.callbackSelector;
        extraData[reportId].trackDisputes = params.trackDisputes;
        extraData[reportId].callbackGasLimit = params.callbackGasLimit;
        extraData[reportId].keepFee = params.keepFee;

    {
        address token1 = params.token1Address;
        address token2 = params.token2Address;
        uint256 feePercentage = params.feePercentage;
        uint256 multiplier = params.multiplier;
        uint256 exactToken1Report = params.exactToken1Report;
        
        {
            uint256 settlementTime = params.settlementTime;
            uint256 escalationHalt = params.escalationHalt;
            uint256 disputeDelay = params.disputeDelay;
            uint256 protocolFee = params.protocolFee;
            uint256 settlerReward = params.settlerReward;
            bool timeType = params.timeType;
            
            emit ReportInstanceCreated(
                reportId,
                token1,
                token2,
                feePercentage,
                multiplier,
                exactToken1Report,
                msg.value,
                msg.sender,
                settlementTime,
                escalationHalt,
                disputeDelay,
                protocolFee,
                settlerReward,
                timeType,
                params.callbackContract,
                params.callbackSelector,
                params.trackDisputes,
                params.callbackGasLimit,
                params.keepFee
            );
        }
    }

    }

    /**
     * @notice Submits the initial price report for a given report ID
     * @param reportId The unique identifier for the report
     * @param amount1 Amount of token1 (must equal exactToken1Report)
     * @param amount2 Amount of token2 for the price ratio
     * @dev Tokens are pulled from msg.sender and will be returned to msg.sender when settled
     */
    function submitInitialReport(uint256 reportId, uint256 amount1, uint256 amount2) external nonReentrant {
        _submitInitialReport(reportId, amount1, amount2, msg.sender);
    }

    /**
     * @notice Submits the initial price report with a custom reporter address
     * @param reportId The unique identifier for the report
     * @param amount1 Amount of token1 (must equal exactToken1Report)
     * @param amount2 Amount of token2 for the price ratio
     * @param reporter The address that will receive tokens back when settled
     * @dev Tokens are pulled from msg.sender but will be returned to reporter address
     * @dev This overload enables contracts to submit reports on behalf of users
     */
    function submitInitialReport(uint256 reportId, uint256 amount1, uint256 amount2, address reporter) external nonReentrant {
        _submitInitialReport(reportId, amount1, amount2, reporter);
    }

    /**
     * @notice Submits the initial price report for a given report ID
     * @param reportId The unique identifier for the report
     * @param amount1 Amount of token1 (must equal exactToken1Report)
     * @param amount2 Amount of token2 for the price ratio
     * @param reporter The address that will receive tokens back when settled
     */
    function _submitInitialReport(uint256 reportId, uint256 amount1, uint256 amount2, address reporter) internal {
        ReportMeta storage meta = reportMeta[reportId];
        ReportStatus storage status = reportStatus[reportId];

        if (reportId > nextReportId) revert InvalidInput("report id");
        if (status.currentReporter != address(0)) revert AlreadyProcessed("report submitted");
        if (amount1 != meta.exactToken1Report) revert InvalidInput("token1 amount");
        if (amount2 == 0) revert InvalidInput("token2 amount");

        _transferTokens(meta.token1, msg.sender, address(this), amount1);
        _transferTokens(meta.token2, msg.sender, address(this), amount2);

        status.currentAmount1 = amount1;
        status.currentAmount2 = amount2;
        status.currentReporter = payable(reporter);
        status.initialReporter = payable(reporter);
        status.reportTimestamp = meta.timeType ? block.timestamp : _getBlockNumber();
        status.initialReportTimestamp = status.reportTimestamp;
        status.price = (amount1 * PRICE_PRECISION) / amount2;
        status.lastReportTrueTime = block.timestamp;

        if (extraData[reportId].trackDisputes) {
            disputeHistory[reportId][0].amount1 = amount1;
            disputeHistory[reportId][0].amount2 = amount2;
            disputeHistory[reportId][0].reportTimestamp = status.reportTimestamp;
            extraData[reportId].numReports = 1;
        }

        emit InitialReportSubmitted(
            reportId,
            reporter,
            amount1,
            amount2,
            meta.token1,
            meta.token2,
            meta.feePercentage,
            meta.protocolFee,
            meta.settlementTime,
            meta.disputeDelay,
            meta.escalationHalt,
            meta.timeType,
            extraData[reportId].callbackContract,
            extraData[reportId].callbackSelector,
            extraData[reportId].trackDisputes,
            extraData[reportId].callbackGasLimit
        );
    }

//backwards-compatible function
function disputeAndSwap(uint256 reportId, address tokenToSwap, uint256 newAmount1, uint256 newAmount2)
    external
    nonReentrant
{
    _disputeAndSwap(reportId, tokenToSwap, newAmount1, newAmount2, msg.sender);
}

//new function. disputer address receives the money back, so you can call dispute with your own tokens through insurance smart contracts or other smart contracts if necessary.
function disputeAndSwap(uint256 reportId, address tokenToSwap, uint256 newAmount1, uint256 newAmount2, address disputer)
    external
    nonReentrant
{
    _disputeAndSwap(reportId, tokenToSwap, newAmount1, newAmount2, disputer);
}

    /**
     * @notice Disputes an existing report and swaps tokens to update the price
     * @param reportId The unique identifier for the report to dispute
     * @param tokenToSwap The token being swapped (token1 or token2)
     * @param newAmount1 New amount of token1 after the dispute
     * @param newAmount2 New amount of token2 after the dispute
     */
    function _disputeAndSwap(uint256 reportId, address tokenToSwap, uint256 newAmount1, uint256 newAmount2, address disputer)
        internal
    {
        ReportMeta storage meta = reportMeta[reportId];
        ReportStatus storage status = reportStatus[reportId];

        _validateDispute(reportId, tokenToSwap, newAmount1, newAmount2, meta, status);

        if (tokenToSwap == meta.token1) {
            _handleToken1Swap(meta, status, newAmount2);
        } else if (tokenToSwap == meta.token2) {
            _handleToken2Swap(meta, status, newAmount2);
        } else {
            revert InvalidInput("token to swap");
        }

        // Update the report status after the dispute and swap
        status.currentAmount1 = newAmount1;
        status.currentAmount2 = newAmount2;
        status.currentReporter = payable(disputer);
        status.reportTimestamp = meta.timeType ? block.timestamp : _getBlockNumber();
        status.price = (newAmount1 * PRICE_PRECISION) / newAmount2;
        status.disputeOccurred = true;
        status.lastDisputeBlock = _getBlockNumber();
        status.lastReportTrueTime = block.timestamp;

        if (extraData[reportId].trackDisputes) {
            uint256 nextIndex = extraData[reportId].numReports;
            disputeHistory[reportId][nextIndex].amount1 = newAmount1;
            disputeHistory[reportId][nextIndex].amount2 = newAmount2;
            disputeHistory[reportId][nextIndex].reportTimestamp = status.reportTimestamp;
            extraData[reportId].numReports = nextIndex + 1;
        }

        emit ReportDisputed(
            reportId,
            disputer,
            newAmount1,
            newAmount2,
            meta.token1,
            meta.token2,
            meta.feePercentage,
            meta.protocolFee,
            meta.settlementTime,
            meta.disputeDelay,
            meta.escalationHalt,
            meta.timeType,
            extraData[reportId].callbackContract,
            extraData[reportId].callbackSelector,
            extraData[reportId].trackDisputes,
            extraData[reportId].callbackGasLimit
        );
    }

    /**
     * @dev Validates that a dispute is valid according to the oracle rules
     */
    function _validateDispute(
        uint256 reportId,
        address tokenToSwap,
        uint256 newAmount1,
        uint256 newAmount2,
        ReportMeta storage meta,
        ReportStatus storage status
    ) internal view {
        if (reportId > nextReportId) revert InvalidInput("report id");
        if (newAmount1 == 0 || newAmount2 == 0) revert InvalidInput("token amounts");
        if (status.currentReporter == address(0)) revert NoReportToDispute();
        if(meta.timeType == true){
            if (block.timestamp > status.reportTimestamp + meta.settlementTime) {
                revert InvalidTiming("dispute period expired");
            }
        }else{
            if (_getBlockNumber() > status.reportTimestamp + meta.settlementTime) {
                revert InvalidTiming("dispute period expired");
            }
        }
        if (status.isSettled) revert AlreadyProcessed("report settled");
        if (status.isDistributed) revert AlreadyProcessed("report distributed");
        if (tokenToSwap != meta.token1 && tokenToSwap != meta.token2) revert InvalidInput("token to swap");
        if (status.lastDisputeBlock == _getBlockNumber()) revert DisputeAlreadyInBlock();
        if(meta.timeType == true){
            if (block.timestamp < status.reportTimestamp + meta.disputeDelay) revert InvalidTiming("dispute too early");
        }else{
            if (_getBlockNumber() < status.reportTimestamp + meta.disputeDelay) revert InvalidTiming("dispute too early");
        }

        uint256 oldAmount1 = status.currentAmount1;
        uint256 expectedAmount1;

        if (meta.escalationHalt > oldAmount1) {
            expectedAmount1 = (oldAmount1 * meta.multiplier) / MULTIPLIER_PRECISION;
        } else {
            expectedAmount1 = oldAmount1 + 1;
        }

        if (newAmount1 != expectedAmount1) {
            if (meta.escalationHalt <= oldAmount1) {
                revert OutOfBounds("escalation halted");
            } else {
                revert InvalidInput("new amount");
            }
        }

        uint256 oldPrice = (oldAmount1 * PRICE_PRECISION) / status.currentAmount2;
        uint256 feeBoundary = (oldPrice * meta.feePercentage) / PERCENTAGE_PRECISION;
        uint256 lowerBoundary = oldPrice > feeBoundary ? oldPrice - feeBoundary : 0;
        uint256 upperBoundary = oldPrice + feeBoundary;
        uint256 newPrice = (newAmount1 * PRICE_PRECISION) / newAmount2;

        if (newPrice >= lowerBoundary && newPrice <= upperBoundary) {
            revert OutOfBounds("price within boundaries");
        }
    }

    /**
     * @dev Handles token swaps when token1 is being swapped during a dispute
     */
    function _handleToken1Swap(ReportMeta storage meta, ReportStatus storage status, uint256 newAmount2) internal {
        uint256 oldAmount1 = status.currentAmount1;
        uint256 oldAmount2 = status.currentAmount2;
        uint256 fee = (oldAmount1 * meta.feePercentage) / PERCENTAGE_PRECISION;
        uint256 protocolFee = (oldAmount1 * meta.protocolFee) / PERCENTAGE_PRECISION;

        protocolFees[meta.token1] += protocolFee;

        IERC20(meta.token1).safeTransferFrom(msg.sender, address(this), oldAmount1 + fee + protocolFee);
        IERC20(meta.token1).safeTransfer(status.currentReporter, 2 * oldAmount1 + fee);

        uint256 requiredToken1Contribution =
            meta.escalationHalt > oldAmount1 ? (oldAmount1 * meta.multiplier) / MULTIPLIER_PRECISION : oldAmount1 + 1;

        uint256 netToken2Contribution = newAmount2 >= oldAmount2 ? newAmount2 - oldAmount2 : 0;
        uint256 netToken2Receive = newAmount2 < oldAmount2 ? oldAmount2 - newAmount2 : 0;

        if (netToken2Contribution > 0) {
            IERC20(meta.token2).safeTransferFrom(msg.sender, address(this), netToken2Contribution);
        }

        if (netToken2Receive > 0) {
            IERC20(meta.token2).safeTransfer(msg.sender, netToken2Receive);
        }

        IERC20(meta.token1).safeTransferFrom(msg.sender, address(this), requiredToken1Contribution);
    }

    /**
     * @dev Handles token swaps when token2 is being swapped during a dispute
     */
    function _handleToken2Swap(ReportMeta storage meta, ReportStatus storage status, uint256 newAmount2) internal {
        uint256 oldAmount1 = status.currentAmount1;
        uint256 oldAmount2 = status.currentAmount2;
        uint256 fee = (oldAmount2 * meta.feePercentage) / PERCENTAGE_PRECISION;
        uint256 protocolFee = (oldAmount2 * meta.protocolFee) / PERCENTAGE_PRECISION;

        protocolFees[meta.token2] += protocolFee;

        IERC20(meta.token2).safeTransferFrom(msg.sender, address(this), oldAmount2 + fee + protocolFee);
        IERC20(meta.token2).safeTransfer(status.currentReporter, 2 * oldAmount2 + fee);

        uint256 requiredToken1Contribution =
            meta.escalationHalt > oldAmount1 ? (oldAmount1 * meta.multiplier) / MULTIPLIER_PRECISION : oldAmount1 +1;

        uint256 netToken1Contribution =
            requiredToken1Contribution > (oldAmount1) ? requiredToken1Contribution - (oldAmount1) : 0;

        if (netToken1Contribution > 0) {
            IERC20(meta.token1).safeTransferFrom(msg.sender, address(this), netToken1Contribution);
        }

        IERC20(meta.token2).safeTransferFrom(msg.sender, address(this), newAmount2);
    }

    /**
     * @dev Internal function to handle token transfers
     */
    function _transferTokens(address token, address from, address to, uint256 amount) internal {
        if (from == address(this)) {
            IERC20(token).safeTransfer(to, amount);
        } else {
            IERC20(token).safeTransferFrom(from, to, amount);
        }
    }

    /**
     * @dev Internal function to send ETH to a recipient
     */
    function _sendEth(address payable recipient, uint256 amount) internal {
        (bool success,) = recipient.call{value: amount}("");
        if (!success){
            (bool success2,) = payable(address(0)).call{value: amount}("");
            if(!success2){
                //do nothing so at least erc20 can move
            }
        }
    }

    /**
     * @dev Gets the current block number (returns L1 block number for L1 deployment)
     */
    function _getBlockNumber() internal view returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }

        if (
            id == 0xa4b1 // Arbitrum One chain ID
        ) {
            address ARB_SYS_ADDRESS = 0x0000000000000000000000000000000000000064;
            (bool success, bytes memory data) = ARB_SYS_ADDRESS.staticcall(abi.encodeWithSignature("arbBlockNumber()"));
            if (!success) revert CallToArbSysFailed();
            return abi.decode(data, (uint256));
        }

        return block.number;
    }

}

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

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

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

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

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

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

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

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

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

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

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

    /**
     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

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

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

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

pragma solidity ^0.8.20;

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

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

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

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

pragma solidity ^0.8.20;

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

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 8 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 9 of 10 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

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

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"string","name":"action","type":"string"}],"name":"AlreadyProcessed","type":"error"},{"inputs":[],"name":"CallToArbSysFailed","type":"error"},{"inputs":[],"name":"DisputeAlreadyInBlock","type":"error"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[{"internalType":"string","name":"resource","type":"string"}],"name":"InsufficientAmount","type":"error"},{"inputs":[{"internalType":"string","name":"parameter","type":"string"}],"name":"InvalidInput","type":"error"},{"inputs":[{"internalType":"string","name":"action","type":"string"}],"name":"InvalidTiming","type":"error"},{"inputs":[],"name":"NoReportToDispute","type":"error"},{"inputs":[{"internalType":"string","name":"parameter","type":"string"}],"name":"OutOfBounds","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"TokensCannotBeSame","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"reportId","type":"uint256"},{"indexed":false,"internalType":"address","name":"reporter","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount2","type":"uint256"},{"indexed":true,"internalType":"address","name":"token1Address","type":"address"},{"indexed":true,"internalType":"address","name":"token2Address","type":"address"},{"indexed":false,"internalType":"uint256","name":"swapFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settlementTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"disputeDelay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"escalationHalt","type":"uint256"},{"indexed":false,"internalType":"bool","name":"timeType","type":"bool"},{"indexed":false,"internalType":"address","name":"callbackContract","type":"address"},{"indexed":false,"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"indexed":false,"internalType":"bool","name":"trackDisputes","type":"bool"},{"indexed":false,"internalType":"uint256","name":"callbackGasLimit","type":"uint256"}],"name":"InitialReportSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldRecipient","type":"address"},{"indexed":true,"internalType":"address","name":"newRecipient","type":"address"}],"name":"ProtocolFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"reportId","type":"uint256"},{"indexed":false,"internalType":"address","name":"disputer","type":"address"},{"indexed":false,"internalType":"uint256","name":"newAmount1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount2","type":"uint256"},{"indexed":true,"internalType":"address","name":"token1Address","type":"address"},{"indexed":true,"internalType":"address","name":"token2Address","type":"address"},{"indexed":false,"internalType":"uint256","name":"swapFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settlementTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"disputeDelay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"escalationHalt","type":"uint256"},{"indexed":false,"internalType":"bool","name":"timeType","type":"bool"},{"indexed":false,"internalType":"address","name":"callbackContract","type":"address"},{"indexed":false,"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"indexed":false,"internalType":"bool","name":"trackDisputes","type":"bool"},{"indexed":false,"internalType":"uint256","name":"callbackGasLimit","type":"uint256"}],"name":"ReportDisputed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"reportId","type":"uint256"},{"indexed":true,"internalType":"address","name":"token1Address","type":"address"},{"indexed":true,"internalType":"address","name":"token2Address","type":"address"},{"indexed":false,"internalType":"uint256","name":"feePercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"multiplier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exactToken1Report","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethFee","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256","name":"settlementTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"escalationHalt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"disputeDelay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settlerReward","type":"uint256"},{"indexed":false,"internalType":"bool","name":"timeType","type":"bool"},{"indexed":false,"internalType":"address","name":"callbackContract","type":"address"},{"indexed":false,"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"indexed":false,"internalType":"bool","name":"trackDisputes","type":"bool"},{"indexed":false,"internalType":"uint256","name":"callbackGasLimit","type":"uint256"},{"indexed":false,"internalType":"bool","name":"keepFee","type":"bool"}],"name":"ReportInstanceCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"reportId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settlementTimestamp","type":"uint256"}],"name":"ReportSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"reportId","type":"uint256"},{"indexed":true,"internalType":"address","name":"callbackContract","type":"address"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"}],"name":"SettlementCallbackExecuted","type":"event"},{"inputs":[],"name":"MULTIPLIER_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENTAGE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTLEMENT_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTLEMENT_WINDOW_BLOCKS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token1Address","type":"address"},{"internalType":"address","name":"token2Address","type":"address"},{"internalType":"uint256","name":"exactToken1Report","type":"uint256"},{"internalType":"uint256","name":"feePercentage","type":"uint256"},{"internalType":"uint256","name":"multiplier","type":"uint256"},{"internalType":"uint256","name":"settlementTime","type":"uint256"},{"internalType":"uint256","name":"escalationHalt","type":"uint256"},{"internalType":"uint256","name":"disputeDelay","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"settlerReward","type":"uint256"}],"name":"createReportInstance","outputs":[{"internalType":"uint256","name":"reportId","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token1Address","type":"address"},{"internalType":"address","name":"token2Address","type":"address"},{"internalType":"uint256","name":"exactToken1Report","type":"uint256"},{"internalType":"uint256","name":"feePercentage","type":"uint256"},{"internalType":"uint256","name":"multiplier","type":"uint256"},{"internalType":"uint256","name":"settlementTime","type":"uint256"},{"internalType":"uint256","name":"escalationHalt","type":"uint256"},{"internalType":"uint256","name":"disputeDelay","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"settlerReward","type":"uint256"},{"internalType":"bool","name":"timeType","type":"bool"},{"internalType":"address","name":"callbackContract","type":"address"},{"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"internalType":"bool","name":"trackDisputes","type":"bool"},{"internalType":"uint256","name":"callbackGasLimit","type":"uint256"},{"internalType":"bool","name":"keepFee","type":"bool"}],"name":"createReportInstance","outputs":[{"internalType":"uint256","name":"reportId","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reportId","type":"uint256"},{"internalType":"address","name":"tokenToSwap","type":"address"},{"internalType":"uint256","name":"newAmount1","type":"uint256"},{"internalType":"uint256","name":"newAmount2","type":"uint256"}],"name":"disputeAndSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reportId","type":"uint256"},{"internalType":"address","name":"tokenToSwap","type":"address"},{"internalType":"uint256","name":"newAmount1","type":"uint256"},{"internalType":"uint256","name":"newAmount2","type":"uint256"},{"internalType":"address","name":"disputer","type":"address"}],"name":"disputeAndSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"disputeHistory","outputs":[{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint256","name":"amount2","type":"uint256"},{"internalType":"uint256","name":"reportTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"extraData","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"requestTrueTime","type":"uint256"},{"internalType":"address","name":"callbackContract","type":"address"},{"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"internalType":"bool","name":"trackDisputes","type":"bool"},{"internalType":"uint256","name":"numReports","type":"uint256"},{"internalType":"uint256","name":"callbackGasLimit","type":"uint256"},{"internalType":"bool","name":"keepFee","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenToGet","type":"address"}],"name":"getProtocolFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reportId","type":"uint256"}],"name":"getSettlementData","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"settlementTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextReportId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"protocolFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"reportMeta","outputs":[{"internalType":"address","name":"token1","type":"address"},{"internalType":"address","name":"token2","type":"address"},{"internalType":"uint256","name":"feePercentage","type":"uint256"},{"internalType":"uint256","name":"multiplier","type":"uint256"},{"internalType":"uint256","name":"settlementTime","type":"uint256"},{"internalType":"uint256","name":"exactToken1Report","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"escalationHalt","type":"uint256"},{"internalType":"uint256","name":"disputeDelay","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"settlerReward","type":"uint256"},{"internalType":"uint256","name":"requestBlock","type":"uint256"},{"internalType":"bool","name":"timeType","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"reportStatus","outputs":[{"internalType":"uint256","name":"currentAmount1","type":"uint256"},{"internalType":"uint256","name":"currentAmount2","type":"uint256"},{"internalType":"address payable","name":"currentReporter","type":"address"},{"internalType":"address payable","name":"initialReporter","type":"address"},{"internalType":"uint256","name":"reportTimestamp","type":"uint256"},{"internalType":"uint256","name":"settlementTimestamp","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"lastDisputeBlock","type":"uint256"},{"internalType":"bool","name":"isSettled","type":"bool"},{"internalType":"bool","name":"disputeOccurred","type":"bool"},{"internalType":"bool","name":"isDistributed","type":"bool"},{"internalType":"uint256","name":"initialReportTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastReportTrueTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reportId","type":"uint256"}],"name":"settle","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"settlementTimestamp","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reportId","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint256","name":"amount2","type":"uint256"}],"name":"submitInitialReport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reportId","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint256","name":"amount2","type":"uint256"},{"internalType":"address","name":"reporter","type":"address"}],"name":"submitInitialReport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecipient","type":"address"}],"name":"updateProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60808060405234609e5760015f553315608b5760018054336001600160a01b0319821681179092556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a36001600255600380546001600160a01b03191673043c740db5d907aa7604c2e8e9e0ffff435fa0e41790556122ae90816100a38239f35b631e4fbdf760e01b5f525f60045260245ffd5b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c90816308e927fe14610990575080631df47f80146108d8578063307120d8146108ad5780633deb6cae14610892578063634d1f891461084557806364df049e1461081d5780636cb294ee146107095780636e79bbf6146106ec578063715018a61461069157806378025ec4146105fb5780637e0124ea146105c557806388f7ca63146105a95780638da5cb5b146105815780638df828001461054b57806395082d2514610529578063b309483a1461050e578063bbbea05214610444578063dcf844a71461040c578063dd012046146103ce578063e256888f146103b1578063eb7c825614610369578063ee1c113b146102f1578063f27dd8ab1461027e578063f2fde38b146101f85763ff57143b1461012f575f80fd5b346101f45760203660031901126101f4576004355f5260046020526101a060405f2060018060a01b038154169060018060a01b036001820154169060028101546003820154600483015460058401546006850154600786015491600887015493600988015495600a8901549760ff600c600b8c01549b0154169a6040519c8d5260208d015260408c015260608b015260808a015260a089015260c088015260e08701526101008601526101208501526101408401526101608301521515610180820152f35b5f80fd5b346101f45760203660031901126101f457610211610a47565b61021961131f565b6001600160a01b0316801561026b57600180546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b631e4fbdf760e01b5f525f60045260245ffd5b346101f45760203660031901126101f457610297610a47565b61029f611346565b6001600160a01b0381165f818152600660205260409020549091816102c5575b60015f55005b6102e9925f5260066020525f604081205560018060a01b036003541690309061215b565b8080806102bf565b346101f45760203660031901126101f4576004355f52600560205260405f2060ff60088201541615610336578060056006604093015491015482519182526020820152f35b604051627ef01b60e91b815260206004820152600b60248201526a1b9bdd081cd95d1d1b195960aa1b6044820152606490fd5b346101f45760a03660031901126101f457610382610a5d565b6084356001600160a01b03811681036101f4576102bf916103a1611346565b6064359060443590600435611726565b346101f4575f3660031901126101f4576020604051629896808152f35b346101f45760803660031901126101f4576064356001600160a01b03811681036101f4576102bf906103fe611346565b60443560243560043561140a565b346101f45760203660031901126101f4576001600160a01b0361042d610a47565b165f526006602052602060405f2054604051908152f35b346101f45760203660031901126101f4576004355f5260056020526101a060405f2080549060018101549060ff60018060a01b0360028301541660018060a01b0360038401541660048401546005850154600686015491600787015493600888015495600a60098a0154990154996040519b8c5260208c015260408b015260608a0152608089015260a088015260c087015260e08601528181161515610100860152818160081c16151561012086015260101c161515610140840152610160830152610180820152f35b346101f4575f3660031901126101f457602060405160648152f35b346101f4575f3660031901126101f4576020604051670de0b6b3a76400008152f35b346101f45760203660031901126101f457610564611346565b6040610571600435610b26565b60015f5582519182526020820152f35b346101f4575f3660031901126101f4576001546040516001600160a01b039091168152602090f35b346101f4575f3660031901126101f45760206040516105468152f35b346101f45760803660031901126101f4576102bf6105e1610a5d565b6105e9611346565b33906064359060443590600435611726565b346101f45760203660031901126101f4576004355f52600760205261010060405f2060018060a01b0381541690600181015490600281015460ff60038301549181600560048601549501541694604051968752602087015260018060a01b038116604087015263ffffffff60e01b8160401b16606087015260c01c161515608085015260a084015260c0830152151560e0820152f35b346101f4575f3660031901126101f4576106a961131f565b600180546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101f4575f3660031901126101f4576020600254604051908152f35b6102003660031901126101f45761071e610a47565b610726610a5d565b61014435918215158093036101f457610164356001600160a01b038116908190036101f4576101843563ffffffff60e01b81168091036101f4576101a435908115158092036101f4576101e435928315158094036101f457602096610815966040519661079288610a73565b6001600160a01b039081168852168887015260443560408701526064356060870152608435608087015260a43560a087015260c43560c087015260e43560e087015261010435610100870152610124356101208701526101408601526101608501526101808401526101a08301526101c4356101c08301526101e0820152610f45565b604051908152f35b346101f4575f3660031901126101f4576003546040516001600160a01b039091168152602090f35b346101f45760403660031901126101f4576004355f52600860205260405f206024355f52602052606060405f20805490600260018201549101549060405192835260208301526040820152f35b346101f4575f3660031901126101f4576020604051603c8152f35b346101f45760603660031901126101f4576108c6611346565b6102bf3360443560243560043561140a565b346101f45760203660031901126101f4576108f1610a47565b6108f961131f565b6001600160a01b0316801561094b57600380546001600160a01b0319811683179091556001600160a01b03167fd3890fc76afcfc31cba1dcf2c27b50e2541e4d75039c981855b5b5e03682aea05f80a3005b60405162461bcd60e51b815260206004820152601960248201527f496e76616c696420726563697069656e742061646472657373000000000000006044820152606490fd5b6101403660031901126101f4576108156020916109ab610a47565b6109b3610a5d565b906109bd83610a73565b6001600160a01b039081168352168382015260443560408201526064356060820152608435608082015260a43560a082015260c43560c082015260e43560e0820152610104356101008201526101243561012082015260016101408201525f610160820181905261018082018190526101a082018190526101c082018190526101e0820152610f45565b600435906001600160a01b03821682036101f457565b602435906001600160a01b03821682036101f457565b610200810190811067ffffffffffffffff821117610a9057604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff821117610a9057604052565b91908201809211610ad357565b634e487b7160e01b5f52601160045260245ffd5b3d15610b21573d9067ffffffffffffffff8211610a905760405191610b16601f8201601f191660200184610aa4565b82523d5f602084013e565b606090565b90815f52600560205260405f2091805f52600460205260405f20600884019081549260ff8416808015610f2b575b610f135750600c820193600160ff86541615151490815f14610ebf57610b836004890154600486015490610ac6565b4210610e8c575b600a84015460068501549215610e5557610bad60048a0154600487015490610ac6565b91603c8301809311610ad35760ff97610bd1934211155b610dc8575b505033612126565b835460081c851615610db057815f52600760205284600560405f200154165f14610d95576003870154610c0d91906001600160a01b0316612126565b815460028701805488549192610c3292916001600160a01b039081169130911661215b565b600183810180549254918901549092610c59926001600160a01b039081169130911661215b565b835462ff00001916620100001784555f82815260076020526040902060028101805490946001600160a01b0382169290918a9084151580610d7e575b610cbe575b505050505050505054165f14610cb7576005600683015492015490565b5f91508190565b5f6020956004829695857f63c05bab316b954c37258e1fcd2f871b8270022922505b50f9ab4d61a58067129a8598600560068f9a01549301549060018060a01b039054169160018060a01b0390541692604051998d8b019963ffffffff60e01b9060401b168a5260248b015260448a01526064890152608488015260a487015260a48652610d4d60c487610aa4565b0154935193f193610d5c610ae7565b505460405194151585526001600160a01b031693a35f80808080808981610c9a565b50604081901b6001600160e01b0319161515610c95565b600354610dab91906001600160a01b0316612126565b610c0d565b6003870154610dab91906001600160a01b0316612126565b6001899283191617885554165f14610e1e57837fd5b9393f882c79c94e843b15763c6d0fc949d6834236ac4a8421dfd11fb05fe36040428060058e5b015560068d01549082519182526020820152a25f80610bc9565b837fd5b9393f882c79c94e843b15763c6d0fc949d6834236ac4a8421dfd11fb05fe3604060058c610e4d6120bf565b918291610e04565b610e5d6120bf565b91610e7160048b0154600488015490610ac6565b976105468901809911610ad35760ff98610bd1941115610bc4565b60405163b2fe248560e01b815260206004820152600a6024820152691cd95d1d1b195b595b9d60b21b6044820152606490fd5b610ec76120bf565b610eda60048a0154600487015490610ac6565b1115610b8a5760405163b2fe248560e01b815260206004820152600a6024820152691cd95d1d1b195b595b9d60b21b6044820152606490fd5b93505050505f14610cb7576005600683015492015490565b5060ff8560101c16610b54565b91908203918211610ad357565b9060643411156112f357604082018051156112be57825160208401805190916001600160a01b039182169116146112af5760a084019384519260e08201938451101561126957610120820190815134111561122e57600254925f198414610ad3578390600182016002558198825f52600460205260405f2094600160a01b60019003600160a01b60019003845116166bffffffffffffffffffffffff60a01b875416178655600160a01b600190038851166001870190600160a01b60019003166bffffffffffffffffffffffff60a01b82541617905584516005870155606083019889516002880155608084019687516003820155835160048201558251349061104e91610f38565b600682015560c085019283516007830155825160088301556101008601805160098401558151600a8401556110816120bf565b600b8401556101408701928351151590600c01906110aa919060ff801983541691151516179055565b5f978852600760205260409788902080546001600160a01b03191633178155426001820155610160880180516002830180546101808c0180516101a08e0180516001600160c81b03199094166001600160a01b0396909616959095179e1c63ffffffff60a01b169d909d1790151560c01b60ff60c01b161790556101c08a01805160048501556101e08b0180516005909501805495151560ff1660ff199690961695909517909455929a92999098929791969290519e519f519c519b5190519151925193519451955196519751985199519a51604080519e8f5260208f019d909d529b8d01523460608d01523360808d015260a08c015260c08b015260e08a015261010089015261012088015215156101408701526001600160a01b039081166101608701526001600160e01b03199091166101808601529015156101a08501526101c08401919091529015156101e083015293841693909216917f0f0e8024fe7a06dd3f780d79377f081ce31c0ee34cdf4b92933a6f22d0462acc9061020090a4565b60405163240bf61760e11b8152602060048201526012602482015271736574746c6572207265776172642066656560701b6044820152606490fd5b60405163b2fe248560e01b815260206004820152601b60248201527f736574746c656d656e7420767320646973707574652064656c617900000000006044820152606490fd5b6340ccdec360e11b5f5260045ffd5b60405163d647364f60e01b815260206004820152600c60248201526b1d1bdad95b88185b5bdd5b9d60a21b6044820152606490fd5b60405163240bf61760e11b815260206004820152600360248201526266656560e81b6044820152606490fd5b6001546001600160a01b0316330361133357565b63118cdaa760e01b5f523360045260245ffd5b60025f54146113555760025f55565b633ee5aeb560e01b5f5260045ffd5b81810292918115918404141715610ad357565b8115611381570490565b634e487b7160e01b5f52601260045260245ffd5b999693909d9c9b9895926101809b9895926101a08c019f60018060a01b03168c5260208c015260408b015260608a0152608089015260a088015260c087015260e0860152151561010085015260018060a01b031661012084015263ffffffff60e01b1661014083015215156101608201520152565b90929192815f52600460205260405f2090825f52600560205260405f209360025484116116f4576002850180549095906001600160a01b03166116bc5760058401548303611686578615611650578354611472908490309033906001600160a01b031661215b565b600184019561148c88303360018060a01b038b541661215b565b8382556001820188905580546001600160a01b0384166001600160a01b031991821681179092556003830180549091169091179055600c8401805490979060ff16156116425742945b60048301958087556009840155670de0b6b3a7640000850290858204670de0b6b3a76400001486151715610ad3577f9abd89d36a953e96813ed32753d87b54aa5d9e7fa53b238907b4ab4cdd4f3212966115fc94611534858b95611377565b6006820155600a42910155825f52600760205260ff600260405f20015460c01c16611601575b5060018060a01b038154169860018060a01b039054169960028201549160098101549160048201549160ff6007600883015492015492541692865f52600760205260018060a01b03600260405f2001541694875f52600760205263ffffffff60e01b600260405f20015460401b1696885f52600760205260ff600260405f20015460c01c16985f526007602052600460405f200154996040519d8e9d8e611395565b0390a4565b5f83815260086020908152604080832083805282528083208a815560018082018990559454600290910155858352600790915281206003019190915561155a565b61164a6120bf565b946114d5565b60405163d647364f60e01b815260206004820152600d60248201526c1d1bdad95b8c88185b5bdd5b9d609a1b6044820152606490fd5b60405163d647364f60e01b815260206004820152600d60248201526c1d1bdad95b8c48185b5bdd5b9d609a1b6044820152606490fd5b604051627ef01b60e91b815260206004820152601060248201526f1c995c1bdc9d081cdd589b5a5d1d195960821b6044820152606490fd5b60405163d647364f60e01b81526020600482015260096024820152681c995c1bdc9d081a5960ba1b6044820152606490fd5b91825f52600460205260405f2094835f52600560205260405f209260025485116116f4578215908180156120b7575b6120815760028501546001600160a01b03161561207257600c88015460ff161515600114801561201257611792600487015460048b015490610ac6565b4211611fd3575b600886015460ff8116611f9d5760101c60ff16611f635788546001600160a01b039081169190831682141580611f49575b611d8c5760078701546117db6120bf565b14611f3a5715611edf576117f8600487015460088b015490610ac6565b4210611ea5575b8554928360078b015411805f14611e8557606461182060038d015487611364565b045b8703611e145750670de0b6b3a7640000840291848304670de0b6b3a76400001485151715610ad35761185960018901548094611377565b60028c015492611889629896806118708685611364565b0480841115611e0d576118838185610f38565b93610ac6565b9089670de0b6b3a7640000810204670de0b6b3a7640000141715610ad3576118bb8c670de0b6b3a76400008b02611377565b918210159182611e02575b5050611dc2576001600160a01b03841603611c52575050505082546001840154629896806118f860028a015484611364565b0461195a6298968061190e60098c015486611364565b0460018060a01b038b54165f52600660205260405f2061192f828254610ac6565b90558a546001600160a01b0316906119509061194b8588610ac6565b610ac6565b9030903390612191565b885460028701546001600160a01b0391821691166001600160ff1b0385168503610ad35761198e611994938660011b610ac6565b916121da565b816007890154115f14611c3d5760646119b5611a009360038b015490611364565b04905b8088109081611c3557886119cc8282610f38565b925b15611c2c576119dc91610f38565b905b80611c0a575b5080611bea575b508754309033906001600160a01b0316612191565b818355600183018590556002830180546001600160a01b0319166001600160a01b038316179055600c86015460ff1615611bdc5742925b60048101938455611a5286670de0b6b3a76400008502611377565b600682015560088101805461ff001916610100179055611a706120bf565b6007820155600a42910155835f52600760205260ff600260405f20015460c01c16611b64575b7f6533bf6e94916177a87b88f205d30240e2659226ca9898d9932c8c71ee43b59292506115fc60018060a01b03875416958560018060a01b0360018a01541698600281015490600981015490600481015490600881015460ff600c60078401549301541692865f52600760205260018060a01b03600260405f2001541694875f52600760205263ffffffff60e01b600260405f20015460401b1696885f52600760205260ff600260405f20015460c01c16985f526007602052600460405f200154996040519d8e9d8e611395565b5f848152600760209081526040808320600301546008835281842081855290925290912083815560018082018890559454600290910155928301928310610ad3577f6533bf6e94916177a87b88f205d30240e2659226ca9898d9932c8c71ee43b59292845f526007602052600360405f200155611a96565b611be46120bf565b92611a37565b6001890154611c04919033906001600160a01b03166121da565b5f6119eb565b60018a0154611c269190309033906001600160a01b0316612191565b5f6119e4565b50505f906119de565b885f926119ce565b60018201809211610ad357611a0091906119b8565b60018a01546001600160a01b0390811693168303611d8c5762989680611c7b611cc69284611364565b049262989680611c8f60098d015485611364565b04905f52600660205260405f20611ca7828254610ac6565b905560018b01546001600160a01b0316906119509061194b8686610ac6565b600189015460028701546001600160a01b03918216929116906001600160ff1b0381168103610ad357611cff9361198e9160011b610ac6565b806007880154115f14611d7b576064611d1c600389015483611364565b04905b80821115611d7357611d3091610f38565b80611d54575b50611d4f85303360018060a01b0360018b015416612191565b611a00565b8654611d6d9190309033906001600160a01b0316612191565b5f611d36565b50505f611d30565b60018101808211610ad35790611d1f565b60405163d647364f60e01b815260206004820152600d60248201526c0746f6b656e20746f207377617609c1b6044820152606490fd5b604051637a72dbcd60e11b815260206004820152601760248201527670726963652077697468696e20626f756e64617269657360481b6044820152606490fd5b111590505f806118c6565b5f93610ac6565b611e5257604051637a72dbcd60e11b8152602060048201526011602482015270195cd8d85b185d1a5bdb881a185b1d1959607a1b6044820152606490fd5b60405163d647364f60e01b815260206004820152600a6024820152691b995dc8185b5bdd5b9d60b21b6044820152606490fd5b600185018086111561182257634e487b7160e01b5f52601160045260245ffd5b60405163b2fe248560e01b81526020600482015260116024820152706469737075746520746f6f206561726c7960781b6044820152606490fd5b611ee76120bf565b611efa600488015460088c015490610ac6565b11156117ff5760405163b2fe248560e01b81526020600482015260116024820152706469737075746520746f6f206561726c7960781b6044820152606490fd5b6304c70d1160e11b5f5260045ffd5b5060018a01546001600160a01b03848116911614156117ca565b604051627ef01b60e91b81526020600482015260126024820152711c995c1bdc9d08191a5cdd1c9a589d5d195960721b6044820152606490fd5b604051627ef01b60e91b815260206004820152600e60248201526d1c995c1bdc9d081cd95d1d1b195960921b6044820152606490fd5b60405163b2fe248560e01b8152602060048201526016602482015275191a5cdc1d5d19481c195c9a5bd908195e1c1a5c995960521b6044820152606490fd5b61201a6120bf565b61202d600488015460048c015490610ac6565b10156117995760405163b2fe248560e01b8152602060048201526016602482015275191a5cdc1d5d19481c195c9a5bd908195e1c1a5c995960521b6044820152606490fd5b63419dba4b60e11b5f5260045ffd5b60405163d647364f60e01b815260206004820152600d60248201526c746f6b656e20616d6f756e747360981b6044820152606490fd5b508615611755565b61a4b146146120cc574390565b5f80604051602081019063a3b1b31d60e01b8252600481526120ef602482610aa4565b519060645afa6120fd610ae7565b9015612117576020818051810103126101f4576020015190565b633fa9d32f60e01b5f5260045ffd5b5f808084819460018060a01b03165af161213e610ae7565b50156121475750565b5f80808093815af150612158610ae7565b50565b9291906001600160a01b03811630036121835750612181926001600160a01b03166121da565b565b612181936001600160a01b03165b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152612181916121d5608483610aa4565b612215565b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604480830193909352918152612181916121d5606483610aa4565b905f602091828151910182855af11561226d575f513d61226457506001600160a01b0381163b155b6122445750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b6001141561223d565b6040513d5f823e3d90fdfea26469706673582212200a6c9f9a41130ab09df4a6b738ed3c9eb2e47d7d00ad3eefc51b9d0e9875848a64736f6c634300081e0033

Deployed Bytecode

0x6080806040526004361015610012575f80fd5b5f3560e01c90816308e927fe14610990575080631df47f80146108d8578063307120d8146108ad5780633deb6cae14610892578063634d1f891461084557806364df049e1461081d5780636cb294ee146107095780636e79bbf6146106ec578063715018a61461069157806378025ec4146105fb5780637e0124ea146105c557806388f7ca63146105a95780638da5cb5b146105815780638df828001461054b57806395082d2514610529578063b309483a1461050e578063bbbea05214610444578063dcf844a71461040c578063dd012046146103ce578063e256888f146103b1578063eb7c825614610369578063ee1c113b146102f1578063f27dd8ab1461027e578063f2fde38b146101f85763ff57143b1461012f575f80fd5b346101f45760203660031901126101f4576004355f5260046020526101a060405f2060018060a01b038154169060018060a01b036001820154169060028101546003820154600483015460058401546006850154600786015491600887015493600988015495600a8901549760ff600c600b8c01549b0154169a6040519c8d5260208d015260408c015260608b015260808a015260a089015260c088015260e08701526101008601526101208501526101408401526101608301521515610180820152f35b5f80fd5b346101f45760203660031901126101f457610211610a47565b61021961131f565b6001600160a01b0316801561026b57600180546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b631e4fbdf760e01b5f525f60045260245ffd5b346101f45760203660031901126101f457610297610a47565b61029f611346565b6001600160a01b0381165f818152600660205260409020549091816102c5575b60015f55005b6102e9925f5260066020525f604081205560018060a01b036003541690309061215b565b8080806102bf565b346101f45760203660031901126101f4576004355f52600560205260405f2060ff60088201541615610336578060056006604093015491015482519182526020820152f35b604051627ef01b60e91b815260206004820152600b60248201526a1b9bdd081cd95d1d1b195960aa1b6044820152606490fd5b346101f45760a03660031901126101f457610382610a5d565b6084356001600160a01b03811681036101f4576102bf916103a1611346565b6064359060443590600435611726565b346101f4575f3660031901126101f4576020604051629896808152f35b346101f45760803660031901126101f4576064356001600160a01b03811681036101f4576102bf906103fe611346565b60443560243560043561140a565b346101f45760203660031901126101f4576001600160a01b0361042d610a47565b165f526006602052602060405f2054604051908152f35b346101f45760203660031901126101f4576004355f5260056020526101a060405f2080549060018101549060ff60018060a01b0360028301541660018060a01b0360038401541660048401546005850154600686015491600787015493600888015495600a60098a0154990154996040519b8c5260208c015260408b015260608a0152608089015260a088015260c087015260e08601528181161515610100860152818160081c16151561012086015260101c161515610140840152610160830152610180820152f35b346101f4575f3660031901126101f457602060405160648152f35b346101f4575f3660031901126101f4576020604051670de0b6b3a76400008152f35b346101f45760203660031901126101f457610564611346565b6040610571600435610b26565b60015f5582519182526020820152f35b346101f4575f3660031901126101f4576001546040516001600160a01b039091168152602090f35b346101f4575f3660031901126101f45760206040516105468152f35b346101f45760803660031901126101f4576102bf6105e1610a5d565b6105e9611346565b33906064359060443590600435611726565b346101f45760203660031901126101f4576004355f52600760205261010060405f2060018060a01b0381541690600181015490600281015460ff60038301549181600560048601549501541694604051968752602087015260018060a01b038116604087015263ffffffff60e01b8160401b16606087015260c01c161515608085015260a084015260c0830152151560e0820152f35b346101f4575f3660031901126101f4576106a961131f565b600180546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101f4575f3660031901126101f4576020600254604051908152f35b6102003660031901126101f45761071e610a47565b610726610a5d565b61014435918215158093036101f457610164356001600160a01b038116908190036101f4576101843563ffffffff60e01b81168091036101f4576101a435908115158092036101f4576101e435928315158094036101f457602096610815966040519661079288610a73565b6001600160a01b039081168852168887015260443560408701526064356060870152608435608087015260a43560a087015260c43560c087015260e43560e087015261010435610100870152610124356101208701526101408601526101608501526101808401526101a08301526101c4356101c08301526101e0820152610f45565b604051908152f35b346101f4575f3660031901126101f4576003546040516001600160a01b039091168152602090f35b346101f45760403660031901126101f4576004355f52600860205260405f206024355f52602052606060405f20805490600260018201549101549060405192835260208301526040820152f35b346101f4575f3660031901126101f4576020604051603c8152f35b346101f45760603660031901126101f4576108c6611346565b6102bf3360443560243560043561140a565b346101f45760203660031901126101f4576108f1610a47565b6108f961131f565b6001600160a01b0316801561094b57600380546001600160a01b0319811683179091556001600160a01b03167fd3890fc76afcfc31cba1dcf2c27b50e2541e4d75039c981855b5b5e03682aea05f80a3005b60405162461bcd60e51b815260206004820152601960248201527f496e76616c696420726563697069656e742061646472657373000000000000006044820152606490fd5b6101403660031901126101f4576108156020916109ab610a47565b6109b3610a5d565b906109bd83610a73565b6001600160a01b039081168352168382015260443560408201526064356060820152608435608082015260a43560a082015260c43560c082015260e43560e0820152610104356101008201526101243561012082015260016101408201525f610160820181905261018082018190526101a082018190526101c082018190526101e0820152610f45565b600435906001600160a01b03821682036101f457565b602435906001600160a01b03821682036101f457565b610200810190811067ffffffffffffffff821117610a9057604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff821117610a9057604052565b91908201809211610ad357565b634e487b7160e01b5f52601160045260245ffd5b3d15610b21573d9067ffffffffffffffff8211610a905760405191610b16601f8201601f191660200184610aa4565b82523d5f602084013e565b606090565b90815f52600560205260405f2091805f52600460205260405f20600884019081549260ff8416808015610f2b575b610f135750600c820193600160ff86541615151490815f14610ebf57610b836004890154600486015490610ac6565b4210610e8c575b600a84015460068501549215610e5557610bad60048a0154600487015490610ac6565b91603c8301809311610ad35760ff97610bd1934211155b610dc8575b505033612126565b835460081c851615610db057815f52600760205284600560405f200154165f14610d95576003870154610c0d91906001600160a01b0316612126565b815460028701805488549192610c3292916001600160a01b039081169130911661215b565b600183810180549254918901549092610c59926001600160a01b039081169130911661215b565b835462ff00001916620100001784555f82815260076020526040902060028101805490946001600160a01b0382169290918a9084151580610d7e575b610cbe575b505050505050505054165f14610cb7576005600683015492015490565b5f91508190565b5f6020956004829695857f63c05bab316b954c37258e1fcd2f871b8270022922505b50f9ab4d61a58067129a8598600560068f9a01549301549060018060a01b039054169160018060a01b0390541692604051998d8b019963ffffffff60e01b9060401b168a5260248b015260448a01526064890152608488015260a487015260a48652610d4d60c487610aa4565b0154935193f193610d5c610ae7565b505460405194151585526001600160a01b031693a35f80808080808981610c9a565b50604081901b6001600160e01b0319161515610c95565b600354610dab91906001600160a01b0316612126565b610c0d565b6003870154610dab91906001600160a01b0316612126565b6001899283191617885554165f14610e1e57837fd5b9393f882c79c94e843b15763c6d0fc949d6834236ac4a8421dfd11fb05fe36040428060058e5b015560068d01549082519182526020820152a25f80610bc9565b837fd5b9393f882c79c94e843b15763c6d0fc949d6834236ac4a8421dfd11fb05fe3604060058c610e4d6120bf565b918291610e04565b610e5d6120bf565b91610e7160048b0154600488015490610ac6565b976105468901809911610ad35760ff98610bd1941115610bc4565b60405163b2fe248560e01b815260206004820152600a6024820152691cd95d1d1b195b595b9d60b21b6044820152606490fd5b610ec76120bf565b610eda60048a0154600487015490610ac6565b1115610b8a5760405163b2fe248560e01b815260206004820152600a6024820152691cd95d1d1b195b595b9d60b21b6044820152606490fd5b93505050505f14610cb7576005600683015492015490565b5060ff8560101c16610b54565b91908203918211610ad357565b9060643411156112f357604082018051156112be57825160208401805190916001600160a01b039182169116146112af5760a084019384519260e08201938451101561126957610120820190815134111561122e57600254925f198414610ad3578390600182016002558198825f52600460205260405f2094600160a01b60019003600160a01b60019003845116166bffffffffffffffffffffffff60a01b875416178655600160a01b600190038851166001870190600160a01b60019003166bffffffffffffffffffffffff60a01b82541617905584516005870155606083019889516002880155608084019687516003820155835160048201558251349061104e91610f38565b600682015560c085019283516007830155825160088301556101008601805160098401558151600a8401556110816120bf565b600b8401556101408701928351151590600c01906110aa919060ff801983541691151516179055565b5f978852600760205260409788902080546001600160a01b03191633178155426001820155610160880180516002830180546101808c0180516101a08e0180516001600160c81b03199094166001600160a01b0396909616959095179e1c63ffffffff60a01b169d909d1790151560c01b60ff60c01b161790556101c08a01805160048501556101e08b0180516005909501805495151560ff1660ff199690961695909517909455929a92999098929791969290519e519f519c519b5190519151925193519451955196519751985199519a51604080519e8f5260208f019d909d529b8d01523460608d01523360808d015260a08c015260c08b015260e08a015261010089015261012088015215156101408701526001600160a01b039081166101608701526001600160e01b03199091166101808601529015156101a08501526101c08401919091529015156101e083015293841693909216917f0f0e8024fe7a06dd3f780d79377f081ce31c0ee34cdf4b92933a6f22d0462acc9061020090a4565b60405163240bf61760e11b8152602060048201526012602482015271736574746c6572207265776172642066656560701b6044820152606490fd5b60405163b2fe248560e01b815260206004820152601b60248201527f736574746c656d656e7420767320646973707574652064656c617900000000006044820152606490fd5b6340ccdec360e11b5f5260045ffd5b60405163d647364f60e01b815260206004820152600c60248201526b1d1bdad95b88185b5bdd5b9d60a21b6044820152606490fd5b60405163240bf61760e11b815260206004820152600360248201526266656560e81b6044820152606490fd5b6001546001600160a01b0316330361133357565b63118cdaa760e01b5f523360045260245ffd5b60025f54146113555760025f55565b633ee5aeb560e01b5f5260045ffd5b81810292918115918404141715610ad357565b8115611381570490565b634e487b7160e01b5f52601260045260245ffd5b999693909d9c9b9895926101809b9895926101a08c019f60018060a01b03168c5260208c015260408b015260608a0152608089015260a088015260c087015260e0860152151561010085015260018060a01b031661012084015263ffffffff60e01b1661014083015215156101608201520152565b90929192815f52600460205260405f2090825f52600560205260405f209360025484116116f4576002850180549095906001600160a01b03166116bc5760058401548303611686578615611650578354611472908490309033906001600160a01b031661215b565b600184019561148c88303360018060a01b038b541661215b565b8382556001820188905580546001600160a01b0384166001600160a01b031991821681179092556003830180549091169091179055600c8401805490979060ff16156116425742945b60048301958087556009840155670de0b6b3a7640000850290858204670de0b6b3a76400001486151715610ad3577f9abd89d36a953e96813ed32753d87b54aa5d9e7fa53b238907b4ab4cdd4f3212966115fc94611534858b95611377565b6006820155600a42910155825f52600760205260ff600260405f20015460c01c16611601575b5060018060a01b038154169860018060a01b039054169960028201549160098101549160048201549160ff6007600883015492015492541692865f52600760205260018060a01b03600260405f2001541694875f52600760205263ffffffff60e01b600260405f20015460401b1696885f52600760205260ff600260405f20015460c01c16985f526007602052600460405f200154996040519d8e9d8e611395565b0390a4565b5f83815260086020908152604080832083805282528083208a815560018082018990559454600290910155858352600790915281206003019190915561155a565b61164a6120bf565b946114d5565b60405163d647364f60e01b815260206004820152600d60248201526c1d1bdad95b8c88185b5bdd5b9d609a1b6044820152606490fd5b60405163d647364f60e01b815260206004820152600d60248201526c1d1bdad95b8c48185b5bdd5b9d609a1b6044820152606490fd5b604051627ef01b60e91b815260206004820152601060248201526f1c995c1bdc9d081cdd589b5a5d1d195960821b6044820152606490fd5b60405163d647364f60e01b81526020600482015260096024820152681c995c1bdc9d081a5960ba1b6044820152606490fd5b91825f52600460205260405f2094835f52600560205260405f209260025485116116f4578215908180156120b7575b6120815760028501546001600160a01b03161561207257600c88015460ff161515600114801561201257611792600487015460048b015490610ac6565b4211611fd3575b600886015460ff8116611f9d5760101c60ff16611f635788546001600160a01b039081169190831682141580611f49575b611d8c5760078701546117db6120bf565b14611f3a5715611edf576117f8600487015460088b015490610ac6565b4210611ea5575b8554928360078b015411805f14611e8557606461182060038d015487611364565b045b8703611e145750670de0b6b3a7640000840291848304670de0b6b3a76400001485151715610ad35761185960018901548094611377565b60028c015492611889629896806118708685611364565b0480841115611e0d576118838185610f38565b93610ac6565b9089670de0b6b3a7640000810204670de0b6b3a7640000141715610ad3576118bb8c670de0b6b3a76400008b02611377565b918210159182611e02575b5050611dc2576001600160a01b03841603611c52575050505082546001840154629896806118f860028a015484611364565b0461195a6298968061190e60098c015486611364565b0460018060a01b038b54165f52600660205260405f2061192f828254610ac6565b90558a546001600160a01b0316906119509061194b8588610ac6565b610ac6565b9030903390612191565b885460028701546001600160a01b0391821691166001600160ff1b0385168503610ad35761198e611994938660011b610ac6565b916121da565b816007890154115f14611c3d5760646119b5611a009360038b015490611364565b04905b8088109081611c3557886119cc8282610f38565b925b15611c2c576119dc91610f38565b905b80611c0a575b5080611bea575b508754309033906001600160a01b0316612191565b818355600183018590556002830180546001600160a01b0319166001600160a01b038316179055600c86015460ff1615611bdc5742925b60048101938455611a5286670de0b6b3a76400008502611377565b600682015560088101805461ff001916610100179055611a706120bf565b6007820155600a42910155835f52600760205260ff600260405f20015460c01c16611b64575b7f6533bf6e94916177a87b88f205d30240e2659226ca9898d9932c8c71ee43b59292506115fc60018060a01b03875416958560018060a01b0360018a01541698600281015490600981015490600481015490600881015460ff600c60078401549301541692865f52600760205260018060a01b03600260405f2001541694875f52600760205263ffffffff60e01b600260405f20015460401b1696885f52600760205260ff600260405f20015460c01c16985f526007602052600460405f200154996040519d8e9d8e611395565b5f848152600760209081526040808320600301546008835281842081855290925290912083815560018082018890559454600290910155928301928310610ad3577f6533bf6e94916177a87b88f205d30240e2659226ca9898d9932c8c71ee43b59292845f526007602052600360405f200155611a96565b611be46120bf565b92611a37565b6001890154611c04919033906001600160a01b03166121da565b5f6119eb565b60018a0154611c269190309033906001600160a01b0316612191565b5f6119e4565b50505f906119de565b885f926119ce565b60018201809211610ad357611a0091906119b8565b60018a01546001600160a01b0390811693168303611d8c5762989680611c7b611cc69284611364565b049262989680611c8f60098d015485611364565b04905f52600660205260405f20611ca7828254610ac6565b905560018b01546001600160a01b0316906119509061194b8686610ac6565b600189015460028701546001600160a01b03918216929116906001600160ff1b0381168103610ad357611cff9361198e9160011b610ac6565b806007880154115f14611d7b576064611d1c600389015483611364565b04905b80821115611d7357611d3091610f38565b80611d54575b50611d4f85303360018060a01b0360018b015416612191565b611a00565b8654611d6d9190309033906001600160a01b0316612191565b5f611d36565b50505f611d30565b60018101808211610ad35790611d1f565b60405163d647364f60e01b815260206004820152600d60248201526c0746f6b656e20746f207377617609c1b6044820152606490fd5b604051637a72dbcd60e11b815260206004820152601760248201527670726963652077697468696e20626f756e64617269657360481b6044820152606490fd5b111590505f806118c6565b5f93610ac6565b611e5257604051637a72dbcd60e11b8152602060048201526011602482015270195cd8d85b185d1a5bdb881a185b1d1959607a1b6044820152606490fd5b60405163d647364f60e01b815260206004820152600a6024820152691b995dc8185b5bdd5b9d60b21b6044820152606490fd5b600185018086111561182257634e487b7160e01b5f52601160045260245ffd5b60405163b2fe248560e01b81526020600482015260116024820152706469737075746520746f6f206561726c7960781b6044820152606490fd5b611ee76120bf565b611efa600488015460088c015490610ac6565b11156117ff5760405163b2fe248560e01b81526020600482015260116024820152706469737075746520746f6f206561726c7960781b6044820152606490fd5b6304c70d1160e11b5f5260045ffd5b5060018a01546001600160a01b03848116911614156117ca565b604051627ef01b60e91b81526020600482015260126024820152711c995c1bdc9d08191a5cdd1c9a589d5d195960721b6044820152606490fd5b604051627ef01b60e91b815260206004820152600e60248201526d1c995c1bdc9d081cd95d1d1b195960921b6044820152606490fd5b60405163b2fe248560e01b8152602060048201526016602482015275191a5cdc1d5d19481c195c9a5bd908195e1c1a5c995960521b6044820152606490fd5b61201a6120bf565b61202d600488015460048c015490610ac6565b10156117995760405163b2fe248560e01b8152602060048201526016602482015275191a5cdc1d5d19481c195c9a5bd908195e1c1a5c995960521b6044820152606490fd5b63419dba4b60e11b5f5260045ffd5b60405163d647364f60e01b815260206004820152600d60248201526c746f6b656e20616d6f756e747360981b6044820152606490fd5b508615611755565b61a4b146146120cc574390565b5f80604051602081019063a3b1b31d60e01b8252600481526120ef602482610aa4565b519060645afa6120fd610ae7565b9015612117576020818051810103126101f4576020015190565b633fa9d32f60e01b5f5260045ffd5b5f808084819460018060a01b03165af161213e610ae7565b50156121475750565b5f80808093815af150612158610ae7565b50565b9291906001600160a01b03811630036121835750612181926001600160a01b03166121da565b565b612181936001600160a01b03165b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152612181916121d5608483610aa4565b612215565b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604480830193909352918152612181916121d5606483610aa4565b905f602091828151910182855af11561226d575f513d61226457506001600160a01b0381163b155b6122445750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b6001141561223d565b6040513d5f823e3d90fdfea26469706673582212200a6c9f9a41130ab09df4a6b738ed3c9eb2e47d7d00ad3eefc51b9d0e9875848a64736f6c634300081e0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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