ETH Price: $2,682.62 (-1.97%)

Contract

0x6B68BbF0492fe5c57B2Aff348B9903DB0Ba5fAa7

Overview

ETH Balance

0.0132 ETH

ETH Value

$35.41 (@ $2,682.62/ETH)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Settle Cohort3725240722025-08-26 15:00:54157 days ago1756220454IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000004790.043766
Settle Cohort3721775622025-08-25 15:00:02158 days ago1756134002IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000001410.01
Cast Prediction3721772802025-08-25 14:58:53158 days ago1756133933IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001330.01
Claim3718336422025-08-24 15:09:39159 days ago1756048179IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000000460.014309
Settle Cohort3718313332025-08-24 15:00:02159 days ago1756047602IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000001860.01
Claim3718056982025-08-24 13:13:21159 days ago1756041201IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000000320.01
Cast Prediction3718055382025-08-24 13:12:41159 days ago1756041161IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.00000090.01
Cast Prediction3718055322025-08-24 13:12:39159 days ago1756041159IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.00000090.01
Cast Prediction3718055252025-08-24 13:12:38159 days ago1756041158IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.00000090.01
Cast Prediction3718055172025-08-24 13:12:36159 days ago1756041156IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001070.01
Claim Keeper Rew...3714871172025-08-23 15:06:50160 days ago1755961610IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000000390.01
Settle Cohort3714857872025-08-23 15:01:19160 days ago1755961279IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000001970.01
Cast Prediction3714761622025-08-23 14:21:17160 days ago1755958877IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001020.011261
Cast Prediction3714761562025-08-23 14:21:16160 days ago1755958876IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001010.01115
Cast Prediction3714761492025-08-23 14:21:14160 days ago1755958874IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001010.011196
Cast Prediction3714761422025-08-23 14:21:12160 days ago1755958872IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001020.011277
Cast Prediction3714761352025-08-23 14:21:10160 days ago1755958870IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001030.011372
Cast Prediction3714761282025-08-23 14:21:09160 days ago1755958869IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001030.01143
Cast Prediction3714761222025-08-23 14:21:07160 days ago1755958867IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001030.011429
Cast Prediction3714761162025-08-23 14:21:06160 days ago1755958866IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001030.011387
Cast Prediction3714761102025-08-23 14:21:04160 days ago1755958864IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001030.011437
Cast Prediction3714761032025-08-23 14:21:02160 days ago1755958862IN
0x6B68BbF0...B0Ba5fAa7
0.01 ETH0.000001240.011507
Claim Keeper Rew...3712019682025-08-22 19:20:23161 days ago1755890423IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000000840.024953
Claim Keeper Rew...3711500392025-08-22 15:44:17161 days ago1755877457IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000002150.048652
Claim3711455722025-08-22 15:25:43161 days ago1755876343IN
0x6B68BbF0...B0Ba5fAa7
0 ETH0.000003890.107294
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
3721772802025-08-25 14:58:53158 days ago1756133933
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3721772802025-08-25 14:58:53158 days ago1756133933
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3718336422025-08-24 15:09:39159 days ago1756048179
0x6B68BbF0...B0Ba5fAa7
0.1 ETH
3718056982025-08-24 13:13:21159 days ago1756041201
0x6B68BbF0...B0Ba5fAa7
0.1 ETH
3718055382025-08-24 13:12:41159 days ago1756041161
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3718055382025-08-24 13:12:41159 days ago1756041161
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3718055322025-08-24 13:12:39159 days ago1756041159
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3718055322025-08-24 13:12:39159 days ago1756041159
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3718055252025-08-24 13:12:38159 days ago1756041158
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3718055252025-08-24 13:12:38159 days ago1756041158
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3718055172025-08-24 13:12:36159 days ago1756041156
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3718055172025-08-24 13:12:36159 days ago1756041156
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3714871172025-08-23 15:06:50160 days ago1755961610
0x6B68BbF0...B0Ba5fAa7
0.001 ETH
3714761622025-08-23 14:21:17160 days ago1755958877
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3714761622025-08-23 14:21:17160 days ago1755958877
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3714761562025-08-23 14:21:16160 days ago1755958876
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3714761562025-08-23 14:21:16160 days ago1755958876
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3714761492025-08-23 14:21:14160 days ago1755958874
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3714761492025-08-23 14:21:14160 days ago1755958874
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3714761422025-08-23 14:21:12160 days ago1755958872
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3714761422025-08-23 14:21:12160 days ago1755958872
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3714761352025-08-23 14:21:10160 days ago1755958870
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3714761352025-08-23 14:21:10160 days ago1755958870
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
3714761282025-08-23 14:21:09160 days ago1755958869
0x6B68BbF0...B0Ba5fAa7
0.0003 ETH
3714761282025-08-23 14:21:09160 days ago1755958869
0x6B68BbF0...B0Ba5fAa7
0.0005 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TopCutMarket

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 9999 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.24;

import {IChainlink} from "./interfaces/IChainlink.sol";
import {ITopCutVault} from "./interfaces/ITopCutVault.sol";

// ============================================
error BrokenOraclePrice();
error CohortActive();
error CohortFull();
error FailedToSendWinnerReward();
error FailedToSendFrontendReward();
error FailedToSendKeeperReward();
error GracePeriodNotOver();
error InsufficientBalance();
error InvalidAmount();
error InvalidCohortID();
error InvalidConstructor();
error InvalidPrice();
error InvalidTradeSize();
error NoClaims();
error SequencerDown();
error StalePrice();
error WaitingToSettle();
error ZeroAddress();
// ============================================

/// @title TopCut Precision Market
/// @author Possum Labs
/**
 * @notice This contract accepts and settles predicitions by traders of a cohort
 * Traders receive Loyalty Points when trading via a registered TopCutMarket
 */
contract TopCutMarket {
    constructor(
        address _oracleContract,
        address _sequencerUptimeFeed,
        address _topCutVault,
        uint256 _tradeSize,
        uint256 _tradeDuration,
        uint256 _firstSettlementTime
    ) {
        if (_oracleContract == address(0)) revert InvalidConstructor();
        if (_sequencerUptimeFeed == address(0)) revert InvalidConstructor();
        ORACLE = IChainlink(_oracleContract);
        ORACLE_DECIMALS = ORACLE.decimals();
        SEQUENCER_UPTIME_FEED = IChainlink(_sequencerUptimeFeed);

        if (_topCutVault == address(0)) revert InvalidConstructor();
        TOP_CUT_VAULT = ITopCutVault(_topCutVault);

        ///@dev Given 1 in 11 (9%) fee potential, calculate how much reward can be allocated to keepers per unit (prediction)
        uint256 feeShareSum = SHARE_VAULT + SHARE_FRONTEND; // e.g. 80
        uint256 maxFeeRemainder = 90 - feeShareSum; // e.g. 10 (1%)
        uint256 maxKeeperRewardUnit = (maxFeeRemainder * _tradeSize) / SHARE_PRECISION;

        if (KEEPER_REWARD_UNIT > maxKeeperRewardUnit) revert InvalidConstructor(); // keeper reward + fees cannot exceed 9% of tradeSize
        TRADE_SIZE = _tradeSize;
        WIN_SIZE = _tradeSize * 10;

        if (_tradeDuration < 86400) revert InvalidConstructor(); // min 24h
        TRADE_DURATION = _tradeDuration;

        if (_firstSettlementTime < block.timestamp) revert InvalidConstructor();
        nextSettlement = _firstSettlementTime;

        activeCohortID = 2;

        VAULT_REWARD = (TRADE_SIZE * SHARE_VAULT) / SHARE_PRECISION;
        FRONTEND_REWARD = (TRADE_SIZE * SHARE_FRONTEND) / SHARE_PRECISION;
    }

    // ============================================
    // ==                STORAGE                 ==
    // ============================================
    IChainlink public immutable ORACLE;
    IChainlink private immutable SEQUENCER_UPTIME_FEED; // = IChainlink(0xFdB631F5EE196F0ed6FAa767959853A9F217697D); // liveness feed for Chainlink on Arbitrum
    uint256 private constant ORACLE_THRESHOLD_TIME = 3600; // 1h threshold for price freshness & grace period after sequencer reboot
    uint256 private immutable ORACLE_DECIMALS; // Decimals of the oracle price feed

    uint256 private constant MAX_COHORT_SIZE = 2200;

    uint256 public constant SHARE_PRECISION = 1000;
    uint256 public constant SHARE_VAULT = 50; // 5% of trade volume
    uint256 public constant SHARE_FRONTEND = 30; // 3% of trade volume

    uint256 private constant KEEPER_REWARD_UNIT = 1e14; // Multiplied by the cohortSize to get the reward for settlement
    uint256 private constant MIN_KEEPER_REWARD = 1e15; // min 0.001 ETH reward for settling a cohort
    uint256 private immutable VAULT_REWARD;
    uint256 private immutable FRONTEND_REWARD;

    ITopCutVault public immutable TOP_CUT_VAULT;
    uint256 public immutable TRADE_DURATION; // The duration when no new trades are accepted before a cohort is settled
    uint256 public immutable TRADE_SIZE; // The amount of ETH that traders pay for each prediction
    uint256 public immutable WIN_SIZE; // Winning trades get back 10x of the TradeSize
    uint256 public constant PREDICTION_DECIMALS = 18; // Decimals of the price input by traders - oracle price is normalized to match

    uint256 public activeCohortID;
    uint256 public cohortSize_1; // Tracks trades in the cohort 1
    uint256 public cohortSize_2; // Tracks trades in the cohort 2

    uint256 public nextSettlement; // Time when the active Cohort can be settled

    struct tradeData {
        address predictionOwner;
        uint256 prediction;
    }

    mapping(uint256 tradeID => tradeData) public tradesCohort_1;
    mapping(uint256 tradeID => tradeData) public tradesCohort_2;

    mapping(address trader => uint256 claim) public claimAmounts; // Amount of ETH payouts a winner can claim
    uint256 public totalPendingClaims; // Sum of all claim amounts

    mapping(address keeper => uint256 claim) public keeperRewards; // Amount of ETH a keeper can claim

    // ============================================
    // ==                EVENTS                  ==
    // ============================================
    event PredictionPosted(address indexed user, uint256 indexed settlementTime, uint256 price);
    event CohortSettled(uint256 cohortSize, uint256 winners, uint256 settlementPrice, uint256 settlementTime);
    event PrizesClaimed(address indexed user, uint256 claimedAmount);

    // ============================================
    // ==           EXTERNAL FUNCTIONS           ==
    // ============================================
    ///@notice Traders enter their price predictions and pay ETH according to TradeSize
    ///@dev Frontends add their wallet address to receive a volume share as compensation for providing access
    ///@dev A referral ID must be assigned with each trade and it must be an existing TopCut NFT ID
    ///@dev Predictions are not accepted within TRADE_DURATION before settlement
    function castPrediction(address _frontend, uint256 _refID, uint256 _price, uint256 _cohortID) external payable {
        address user = msg.sender;

        // CHECKS
        ///@dev Validate frontend beneficiary and price prediction
        if (_frontend == address(0)) revert ZeroAddress();
        if (_price == 0) revert InvalidPrice();

        ///@dev Enforce uniform trade size of each prediction
        if (msg.value != TRADE_SIZE) revert InvalidTradeSize();

        ///@dev Ensure that the prediction is entered in the valid cohort (next cohort)
        if (_cohortID == activeCohortID) revert InvalidCohortID();

        ///@dev Only allow predictions if the settlement of the active cohort is not overdue
        uint256 settlementTime = nextSettlement;
        if (block.timestamp >= settlementTime) revert WaitingToSettle();

        ///@dev Get the number of predictions from the next cohort because the active cohort is blocked and waiting for settlement
        uint256 tradeCounter = (activeCohortID == 2) ? cohortSize_1 : cohortSize_2;

        ///@dev Enforce the ceiling of cohort size
        if (tradeCounter == MAX_COHORT_SIZE) revert CohortFull();

        // EFFECTS
        ///@dev Save the prediction and trader address in storage
        ///@dev Increase the trade counter of the respective cohort
        tradeData memory data;
        data.predictionOwner = user;
        data.prediction = _price;

        ///@dev Add prediction to the next cohort, because the active cohort is blocked and waits for settlement
        if (activeCohortID == 2) {
            tradesCohort_1[tradeCounter] = data;
            cohortSize_1 = tradeCounter + 1;
        } else {
            tradesCohort_2[tradeCounter] = data;
            cohortSize_2 = tradeCounter + 1;
        }

        ///@dev Add the trade duration to the current settlement time to attribute this prediction to the next cohort via event
        settlementTime += TRADE_DURATION;

        // INTERACTIONS
        ///@dev Update Loyalty Points and Affiliate Points in the TopCut Vault
        ///@dev Send the Vault rev share with the function call
        TOP_CUT_VAULT.updatePoints{value: VAULT_REWARD}(user, _refID);

        ///@dev Send frontend reward
        (bool sent,) = payable(_frontend).call{value: FRONTEND_REWARD}("");
        if (!sent) revert FailedToSendFrontendReward();

        ///@dev Emit event that informs about this prediction
        emit PredictionPosted(user, settlementTime, _price);
    }

    ///@notice Find the winning predictions of the active Cohort and save in storage
    ///@dev Update the winnersList[] array with owners of the smallest differences (most precise)
    ///@dev Compensate a permissionless keeper for running this function
    function settleCohort() external {
        // CHECKS
        ///@dev Ensure that the L2 sequencer is live and was not restarted just recently
        _checkSequencerStatus();

        ///@dev Get the settlement price and timestamps from the oracle
        (uint80 roundId, int256 price, /*uint256 startedAt*/, uint256 updatedAt, uint80 answeredInRound) =
            ORACLE.latestRoundData();

        ///@dev Perform validation checks on the oracle feed
        _validatePriceData(roundId, price, updatedAt, answeredInRound);

        ///@dev Ensure that the settlement time is reached
        uint256 settlementTime = nextSettlement;
        if (block.timestamp < settlementTime) revert CohortActive();

        ///@dev Typecast oracle price to uint256 and normalize to prediction input precision
        uint256 settlementPrice = (uint256(price) * (10 ** PREDICTION_DECIMALS)) / (10 ** ORACLE_DECIMALS);

        ///@dev Get the cohort size of the active cohort
        uint256 activeID = activeCohortID;
        uint256 _cohortSize = (activeID == 2) ? cohortSize_2 : cohortSize_1; // Cache for gas savings

        ///@dev Evaluate only if there was at least 1 trade, otherwise skip to end
        uint256 cohortWinners;
        if (_cohortSize > 0) {
            // EFFECTS
            ///@dev Calculate number of winners and update the global tracker of pending claims
            cohortWinners = (_cohortSize > 11) ? _cohortSize / 11 : 1; // Minimum 1 winner
            totalPendingClaims = totalPendingClaims + (cohortWinners * WIN_SIZE);

            ///@dev Find the winners by looping through all predictions & save the most precise 1 out of 11
            uint256[] memory winnerDiffs = new uint256[](cohortWinners); // absolute differences to oracle price of winning predictions
            address[] memory owners = new address[](cohortWinners); // owner addresses of the winning predictions

            uint256 currentMaxIndex = 0;
            uint256 currentMaxValue = 0; // maximum deviation among winning predictions

            tradeData memory data;
            uint256 prediction;
            uint256 diff;
            address owner;

            ///@dev Loop through all predictions of the active cohort & calculate differences to settlement price
            for (uint256 i = 0; i < _cohortSize; i++) {
                data = (activeID == 2) ? tradesCohort_2[i] : tradesCohort_1[i];

                prediction = data.prediction;
                diff = (prediction > settlementPrice) ? prediction - settlementPrice : settlementPrice - prediction; // Absolute difference to settlement price
                owner = data.predictionOwner;

                ///@dev Populate the winner list and track largest difference
                if (i < cohortWinners) {
                    winnerDiffs[i] = diff;
                    owners[i] = owner;

                    if (diff >= currentMaxValue) {
                        currentMaxValue = diff;
                        currentMaxIndex = i;
                    }

                    ///@dev After winner list is populated, only replace winners if evaluated prediction is more precise than current largest difference
                } else if (diff < currentMaxValue) {
                    winnerDiffs[currentMaxIndex] = diff;
                    owners[currentMaxIndex] = owner;

                    ///@dev Find the new maximum value in the array (worst prediction among the winners)
                    currentMaxIndex = _findMaxIndex(winnerDiffs);
                    currentMaxValue = winnerDiffs[currentMaxIndex];
                }
            }

            ///@dev Update the pending claim amount for each winning address
            for (uint256 i = 0; i < cohortWinners; i++) {
                claimAmounts[owners[i]] = claimAmounts[owners[i]] + WIN_SIZE;
            }
        }

        ///@dev Update the settlement time for the next round
        nextSettlement = settlementTime + TRADE_DURATION;

        ///@dev Increase keeper rewards based on the number of traders in the Cohort & ensure a minimum compensation
        uint256 keeperReward = getSettlementReward();
        keeperRewards[msg.sender] += keeperReward;

        ///@dev Transition the active cohort 1 -> 2 or 2 -> 1 and reset the settled cohort size
        if (activeID == 2) {
            activeCohortID = 1;
            cohortSize_2 = 0;
        } else {
            activeCohortID = 2;
            cohortSize_1 = 0;
        }

        // INTERACTIONS
        ///@dev Emit event that the cohort was settled
        emit CohortSettled(_cohortSize, cohortWinners, settlementPrice, settlementTime);
    }

    ///@notice Calculate the reward for permissionless settlement
    function getSettlementReward() public view returns (uint256 keeperReward) {
        ///@dev Get the cohort size of the active cohort
        uint256 _cohortSize = (activeCohortID == 2) ? cohortSize_2 : cohortSize_1;

        ///@dev Calculate and return the reward for settlement
        keeperReward = (_cohortSize * KEEPER_REWARD_UNIT < MIN_KEEPER_REWARD)
            ? MIN_KEEPER_REWARD
            : _cohortSize * KEEPER_REWARD_UNIT;
    }

    ///@notice Enable users to claim their pending prizes
    function claim() external {
        // CHECKS
        ///@dev Ensure that the user has pending claims
        address user = msg.sender;
        uint256 amount = claimAmounts[user];
        if (amount == 0) revert NoClaims();

        ///@dev Ensure that the contract has enough ETH
        if (amount > address(this).balance) revert InsufficientBalance();

        // EFFECTS
        ///@dev Update the pending amount
        claimAmounts[user] = 0;

        ///@dev Update the global tracker of pending claims
        totalPendingClaims -= amount;

        // INTERACTIONS
        ///@dev Distribute ETH to the user
        (bool sent,) = payable(user).call{value: amount}("");
        if (!sent) revert FailedToSendWinnerReward();

        ///@dev Emit the event that the user claimed ETH
        emit PrizesClaimed(user, amount);
    }

    ///@notice Enable keepers who settle markets to claim their ETH rewards
    ///@dev Make sure the recipient can receive ETH
    ///@dev No event because this function is only relevant for experts and does not need to be tracked
    function claimKeeperReward(address _recipient, uint256 _amountETH) external {
        // CHECKS
        ///@dev Standard checks
        if (_recipient == address(0)) revert ZeroAddress();
        if (_amountETH == 0) revert InvalidAmount();

        ///@dev Check for sufficient ETH in the contract when considering pending claims
        uint256 withdrawable =
            (totalPendingClaims < address(this).balance) ? address(this).balance - totalPendingClaims : 0;
        if (_amountETH > withdrawable) revert InsufficientBalance();

        ///@dev Validate the amount to be claimed by the keeper
        uint256 rewards = keeperRewards[msg.sender];
        if (_amountETH > rewards) revert InvalidAmount();

        // EFFECTS
        ///@dev Deduct the claimed amount from rewards
        keeperRewards[msg.sender] = rewards - _amountETH;

        // INTERACTIONS
        ///@dev Distribute ETH to the recipient as specified by the keeper
        (bool sent,) = payable(_recipient).call{value: _amountETH}("");
        if (!sent) revert FailedToSendKeeperReward();
    }

    // ============================================
    // ==          INTERNAL FUNCTIONS            ==
    // ============================================
    /// @notice Find the index of the largest number in a memory array
    function _findMaxIndex(uint256[] memory array) private pure returns (uint256 maxIndex) {
        ///@dev Presume that the largest number is at index 0, then search rest of the array
        for (uint256 i = 1; i < array.length; i++) {
            if (array[i] > array[maxIndex]) {
                maxIndex = i;
            }
        }
    }

    ///@notice Ensures that the L2 sequencer is live and that a grace period has passed since restart
    function _checkSequencerStatus() internal view {
        (
            /*uint80 roundID*/
            ,
            int256 answer,
            uint256 startedAt,
            /*uint256 updatedAt*/
            ,
            /*uint80 answeredInRound*/
        ) = SEQUENCER_UPTIME_FEED.latestRoundData();

        // Answer == 0: Sequencer is up
        // Answer == 1: Sequencer is down
        bool isSequencerUp = answer == 0;
        if (!isSequencerUp) {
            revert SequencerDown();
        }

        // Make sure grace period has passed after sequencer comes back up
        uint256 timeSinceUp = (block.timestamp < startedAt) ? 0 : block.timestamp - startedAt;
        if (timeSinceUp <= ORACLE_THRESHOLD_TIME) {
            revert GracePeriodNotOver();
        }
    }

    ///@notice Validates the data provided by Chainlink
    function _validatePriceData(uint80 roundId, int256 price, uint256 updatedAt, uint80 answeredInRound)
        internal
        view
    {
        // Check for stale data & round completion (round incomplete when updatedAt == 0)
        // Incomplete rounds will always revert because block.timestamp > (0 + ORACLE_THRESHOLD_TIME)
        uint256 timeDiff = (block.timestamp < updatedAt) ? 0 : block.timestamp - updatedAt;
        if (timeDiff > ORACLE_THRESHOLD_TIME) revert StalePrice();
        if (answeredInRound < roundId) revert StalePrice();

        // Check for valid price
        if (price <= 0) revert InvalidPrice();
    }
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;

interface IChainlink {
    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

    function decimals() external view returns (uint8);
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;

interface ITopCutVault {
    function AFFILIATE_NFT() external view returns (address);
    function affiliatePoints(uint256 _refID) external view returns (uint256);
    function loyaltyPointsLeader() external view returns (address);
    function leadingPoints() external view returns (uint256);
    function nextDistributionTime() external view returns (address);
    function loyaltyPoints(address _trader) external view returns (uint256);

    function getAffiliateReward(uint256 _refID) external view returns (uint256 ethReward);
    function claimAffiliateReward(uint256 _refID, uint256 _pointsRedeemed, uint256 _minReceived, uint256 _deadline)
        external;

    function updatePoints(address _trader, uint256 _refID) external payable;

    function getRedeemRewardPSM(uint256 _amountPSM) external view returns (uint256 ethReward);
    function redeemPSM(uint256 _amountPSM, uint256 _minReceived, uint256 _deadline) external;

    function extractTokenBalance(address _token, uint256 _minReceived, uint256 _deadline) external payable;
}

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": 9999
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_oracleContract","type":"address"},{"internalType":"address","name":"_sequencerUptimeFeed","type":"address"},{"internalType":"address","name":"_topCutVault","type":"address"},{"internalType":"uint256","name":"_tradeSize","type":"uint256"},{"internalType":"uint256","name":"_tradeDuration","type":"uint256"},{"internalType":"uint256","name":"_firstSettlementTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CohortActive","type":"error"},{"inputs":[],"name":"CohortFull","type":"error"},{"inputs":[],"name":"FailedToSendFrontendReward","type":"error"},{"inputs":[],"name":"FailedToSendKeeperReward","type":"error"},{"inputs":[],"name":"FailedToSendWinnerReward","type":"error"},{"inputs":[],"name":"GracePeriodNotOver","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCohortID","type":"error"},{"inputs":[],"name":"InvalidConstructor","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"InvalidTradeSize","type":"error"},{"inputs":[],"name":"NoClaims","type":"error"},{"inputs":[],"name":"SequencerDown","type":"error"},{"inputs":[],"name":"StalePrice","type":"error"},{"inputs":[],"name":"WaitingToSettle","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"cohortSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winners","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settlementPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"settlementTime","type":"uint256"}],"name":"CohortSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"settlementTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"PredictionPosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"name":"PrizesClaimed","type":"event"},{"inputs":[],"name":"ORACLE","outputs":[{"internalType":"contract IChainlink","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PREDICTION_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SHARE_FRONTEND","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SHARE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SHARE_VAULT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOP_CUT_VAULT","outputs":[{"internalType":"contract ITopCutVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRADE_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRADE_SIZE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WIN_SIZE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activeCohortID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_frontend","type":"address"},{"internalType":"uint256","name":"_refID","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_cohortID","type":"uint256"}],"name":"castPrediction","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"trader","type":"address"}],"name":"claimAmounts","outputs":[{"internalType":"uint256","name":"claim","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amountETH","type":"uint256"}],"name":"claimKeeperReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cohortSize_1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cohortSize_2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSettlementReward","outputs":[{"internalType":"uint256","name":"keeperReward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"keeper","type":"address"}],"name":"keeperRewards","outputs":[{"internalType":"uint256","name":"claim","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextSettlement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"settleCohort","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalPendingClaims","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tradeID","type":"uint256"}],"name":"tradesCohort_1","outputs":[{"internalType":"address","name":"predictionOwner","type":"address"},{"internalType":"uint256","name":"prediction","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tradeID","type":"uint256"}],"name":"tradesCohort_2","outputs":[{"internalType":"address","name":"predictionOwner","type":"address"},{"internalType":"uint256","name":"prediction","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101a060405234801562000011575f80fd5b5060405162001d8038038062001d80833981016040819052620000349162000280565b6001600160a01b0386166200005c576040516312c1701b60e01b815260040160405180910390fd5b6001600160a01b03851662000084576040516312c1701b60e01b815260040160405180910390fd5b6001600160a01b03861660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015620000cd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620000f39190620002e2565b60ff1660c0526001600160a01b0380861660a052841662000127576040516312c1701b60e01b815260040160405180910390fd5b6001600160a01b038416610120525f62000144601e60326200031f565b90505f6200015482605a6200033b565b90505f6103e862000166878462000351565b6200017291906200036b565b905080655af3107a400011156200019c576040516312c1701b60e01b815260040160405180910390fd5b610160869052620001af86600a62000351565b6101805262015180851015620001d8576040516312c1701b60e01b815260040160405180910390fd5b6101408590524284101562000200576040516312c1701b60e01b815260040160405180910390fd5b600384905560025f55610160516103e8906200021f9060329062000351565b6200022b91906200036b565b60e052610160516103e8906200024490601e9062000351565b6200025091906200036b565b61010052506200038b975050505050505050565b80516001600160a01b03811681146200027b575f80fd5b919050565b5f805f805f8060c0878903121562000296575f80fd5b620002a18762000264565b9550620002b16020880162000264565b9450620002c16040880162000264565b9350606087015192506080870151915060a087015190509295509295509295565b5f60208284031215620002f3575f80fd5b815160ff8116811462000304575f80fd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156200033557620003356200030b565b92915050565b818103818111156200033557620003356200030b565b80820281158282048414176200033557620003356200030b565b5f826200038657634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05160e051610100516101205161014051610160516101805161195e620004225f395f818161031a015281816108740152610b3201525f81816104d20152610d6401525f818161018d01528181610c0e0152610f9401525f8181610375015261100801525f61109e01525f61103301525f6107ea01525f61137801525f81816101d30152610707015261195e5ff3fe608060405260043610610178575f3560e01c806374d5d9fa116100d1578063e08f30491161007c578063e57532c111610057578063e57532c114610462578063e81ec3df14610476578063fde34a84146104c1575f80fd5b8063e08f3049146103ab578063e0ec772f146103d6578063e46009121461044d575f80fd5b8063ad3ab5b8116100ac578063ad3ab5b814610350578063d9aed47314610364578063dfb091bc14610397575f80fd5b806374d5d9fa146102ea57806376d8797014610309578063a6298b071461033c575f80fd5b80635fc5e020116101315780636d4d226e1161010c5780636d4d226e146102955780637096706e146102c057806370bf2381146102d5575f80fd5b80635fc5e0201461025957806363c70a541461026e57806364ee42c214610282575f80fd5b806346445a421161016157806346445a421461021a5780634e71d92d1461022e5780635caf68ef14610244575f80fd5b806316cadef81461017c57806338013f02146101c2575b5f80fd5b348015610187575f80fd5b506101af7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156101cd575f80fd5b506101f57f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b9565b348015610225575f80fd5b506101af6104f4565b348015610239575f80fd5b5061024261054e565b005b34801561024f575f80fd5b506101af60015481565b348015610264575f80fd5b506101af6103e881565b348015610279575f80fd5b506102426106f9565b610242610290366004611603565b610cdc565b3480156102a0575f80fd5b506101af6102af366004611639565b60066020525f908152604090205481565b3480156102cb575f80fd5b506101af60025481565b3480156102e0575f80fd5b506101af60075481565b3480156102f5575f80fd5b50610242610304366004611659565b611196565b348015610314575f80fd5b506101af7f000000000000000000000000000000000000000000000000000000000000000081565b348015610347575f80fd5b506101af603281565b34801561035b575f80fd5b506101af601e81565b34801561036f575f80fd5b506101f57f000000000000000000000000000000000000000000000000000000000000000081565b3480156103a2575f80fd5b506101af5f5481565b3480156103b6575f80fd5b506101af6103c5366004611639565b60086020525f908152604090205481565b3480156103e1575f80fd5b506104216103f0366004611681565b60056020525f90815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169082565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016101b9565b348015610458575f80fd5b506101af60035481565b34801561046d575f80fd5b506101af601281565b348015610481575f80fd5b50610421610490366004611681565b60046020525f90815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169082565b3480156104cc575f80fd5b506101af7f000000000000000000000000000000000000000000000000000000000000000081565b5f805f546002146105075760015461050b565b6002545b905066038d7ea4c68000610525655af3107a4000836116c5565b1061053f5761053a655af3107a4000826116c5565b610548565b66038d7ea4c680005b91505090565b335f8181526006602052604081205490819003610597576040517fe120557300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b478111156105d1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82165f9081526006602052604081208190556007805483929061060a9084906116e2565b90915550506040515f9073ffffffffffffffffffffffffffffffffffffffff84169083908381818185875af1925050503d805f8114610664576040519150601f19603f3d011682016040523d82523d5f602084013e610669565b606091505b50509050806106a4576040517f7dc82f3600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff167f2ba0f09c5981638c28ab2c6ffad3986b84cf071c22daa8a06415e1a0aee7aea1836040516106ec91815260200190565b60405180910390a2505050565b610701611374565b5f805f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561076e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610792919061170e565b9450945050935093506107a7848484846114a1565b600354428111156107e4576040517f1d8b1cdd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108107f0000000000000000000000000000000000000000000000000000000000000000600a611878565b61081c6012600a611878565b61082690876116c5565b6108309190611883565b5f8054919250600282146108465760015461084a565b6002545b90505f8115610c0957600b821161086257600161086d565b61086d600b83611883565b90506108997f0000000000000000000000000000000000000000000000000000000000000000826116c5565b6007546108a691906118bb565b6007555f8167ffffffffffffffff8111156108c3576108c36118ce565b6040519080825280602002602001820160405280156108ec578160200160208202803683370190505b5090505f8267ffffffffffffffff811115610909576109096118ce565b604051908082528060200260200182016040528015610932578160200160208202803683370190505b5090505f8061096860405180604001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81525090565b5f8080805b8a811015610b25578b60021461098f575f81815260046020526040902061099d565b5f8181526005602052604090205b60408051808201909152815473ffffffffffffffffffffffffffffffffffffffff1681526001909101546020820181905290955093508c84116109e9576109e4848e6116e2565b6109f3565b6109f38d856116e2565b8551909350915089811015610a815782898281518110610a1557610a156118fb565b60200260200101818152505081888281518110610a3457610a346118fb565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050858310610a7c578295508096505b610b1d565b85831015610b1d5782898881518110610a9c57610a9c6118fb565b60200260200101818152505081888881518110610abb57610abb6118fb565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610afe89611582565b9650888781518110610b1257610b126118fb565b602002602001015195505b60010161096d565b505f5b89811015610bff577f000000000000000000000000000000000000000000000000000000000000000060065f8a8481518110610b6657610b666118fb565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610bb291906118bb565b60065f8a8481518110610bc757610bc76118fb565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2055600101610b28565b5050505050505050505b610c337f0000000000000000000000000000000000000000000000000000000000000000866118bb565b6003555f610c3f6104f4565b335f90815260086020526040812080549293508392909190610c629084906118bb565b90915550506002849003610c7e5760015f908155600255610c88565b60025f9081556001555b6040805184815260208101849052908101869052606081018790527fa1df4ecbfcf24755c35c73587a001179603cdcfddf19c3c8487f6c347225dc6d9060800160405180910390a150505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8516610d2a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f03610d62576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000003414610dbb576040517f7ac17d2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f548203610df5576040517f9d64984200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600354428111610e31576040517f1c09ff4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054600214610e4357600254610e47565b6001545b90506108988103610e84576040517f4f5eb21600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915273ffffffffffffffffffffffffffffffffffffffff84168152602081018690525f54600203610f25575f828152600460209081526040909120825181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617815590820151600191820155610f1d9083906118bb565b600155610f8f565b5f828152600560209081526040909120825181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617815590820151600191820155610f8b9083906118bb565b6002555b610fb97f0000000000000000000000000000000000000000000000000000000000000000846118bb565b6040517f2af0742400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018a90529194507f000000000000000000000000000000000000000000000000000000000000000090911690632af07424907f0000000000000000000000000000000000000000000000000000000000000000906044015f604051808303818588803b15801561106d575f80fd5b505af115801561107f573d5f803e3d5ffd5b50505050505f8873ffffffffffffffffffffffffffffffffffffffff167f00000000000000000000000000000000000000000000000000000000000000006040515f6040518083038185875af1925050503d805f81146110fa576040519150601f19603f3d011682016040523d82523d5f602084013e6110ff565b606091505b505090508061113a576040517f74c49eca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838573ffffffffffffffffffffffffffffffffffffffff167fdd381d66ea80a4a838ceb97ad9e3d39b0535933882b8ade17d1b6dc2196ef3a78960405161118391815260200190565b60405180910390a3505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff82166111e3576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f0361121c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f476007541061122c575f611239565b60075461123990476116e2565b905080821115611275576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815260086020526040902054808311156112be576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112c883826116e2565b335f9081526008602052604080822092909255905173ffffffffffffffffffffffffffffffffffffffff86169085908381818185875af1925050503d805f811461132d576040519150601f19603f3d011682016040523d82523d5f602084013e611332565b606091505b505090508061136d576040517f348aa51d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113df573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611403919061170e565b509194509250508215905080611445576040517f032b3d0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82421061145c5761145783426116e2565b61145e565b5f5b9050610e10811161149b576040517fd15f73b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b5f8242106114b8576114b383426116e2565b6114ba565b5f5b9050610e108111156114f8576040517f19abf40e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8469ffffffffffffffffffff168269ffffffffffffffffffff16101561154a576040517f19abf40e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f841361136d576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60015b82518110156115d5578282815181106115a1576115a16118fb565b60200260200101518382815181106115bb576115bb6118fb565b602002602001015111156115cd578091505b600101611586565b50919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146115fe575f80fd5b919050565b5f805f8060808587031215611616575f80fd5b61161f856115db565b966020860135965060408601359560600135945092505050565b5f60208284031215611649575f80fd5b611652826115db565b9392505050565b5f806040838503121561166a575f80fd5b611673836115db565b946020939093013593505050565b5f60208284031215611691575f80fd5b5035919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176116dc576116dc611698565b92915050565b818103818111156116dc576116dc611698565b805169ffffffffffffffffffff811681146115fe575f80fd5b5f805f805f60a08688031215611722575f80fd5b61172b866116f5565b945060208601519350604086015192506060860151915061174e608087016116f5565b90509295509295909350565b600181815b808511156117b357817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561179957611799611698565b808516156117a657918102915b93841c939080029061175f565b509250929050565b5f826117c9575060016116dc565b816117d557505f6116dc565b81600181146117eb57600281146117f557611811565b60019150506116dc565b60ff84111561180657611806611698565b50506001821b6116dc565b5060208310610133831016604e8410600b8410161715611834575081810a6116dc565b61183e838361175a565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561187057611870611698565b029392505050565b5f61165283836117bb565b5f826118b6577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b808201808211156116dc576116dc611698565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212204ca62640fbbf06e3532c2150c6da927b80897278cfc1c37f5410dda891e60f6464736f6c634300081800330000000000000000000000006ce185860a4963106506c203335a2910413708e9000000000000000000000000fdb631f5ee196f0ed6faa767959853a9f217697d0000000000000000000000003cfc3cba1b4aaf969057f590d23efe46848f4270000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000015180000000000000000000000000000000000000000000000000000000006894bf70

Deployed Bytecode

0x608060405260043610610178575f3560e01c806374d5d9fa116100d1578063e08f30491161007c578063e57532c111610057578063e57532c114610462578063e81ec3df14610476578063fde34a84146104c1575f80fd5b8063e08f3049146103ab578063e0ec772f146103d6578063e46009121461044d575f80fd5b8063ad3ab5b8116100ac578063ad3ab5b814610350578063d9aed47314610364578063dfb091bc14610397575f80fd5b806374d5d9fa146102ea57806376d8797014610309578063a6298b071461033c575f80fd5b80635fc5e020116101315780636d4d226e1161010c5780636d4d226e146102955780637096706e146102c057806370bf2381146102d5575f80fd5b80635fc5e0201461025957806363c70a541461026e57806364ee42c214610282575f80fd5b806346445a421161016157806346445a421461021a5780634e71d92d1461022e5780635caf68ef14610244575f80fd5b806316cadef81461017c57806338013f02146101c2575b5f80fd5b348015610187575f80fd5b506101af7f000000000000000000000000000000000000000000000000000000000001518081565b6040519081526020015b60405180910390f35b3480156101cd575f80fd5b506101f57f0000000000000000000000006ce185860a4963106506c203335a2910413708e981565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b9565b348015610225575f80fd5b506101af6104f4565b348015610239575f80fd5b5061024261054e565b005b34801561024f575f80fd5b506101af60015481565b348015610264575f80fd5b506101af6103e881565b348015610279575f80fd5b506102426106f9565b610242610290366004611603565b610cdc565b3480156102a0575f80fd5b506101af6102af366004611639565b60066020525f908152604090205481565b3480156102cb575f80fd5b506101af60025481565b3480156102e0575f80fd5b506101af60075481565b3480156102f5575f80fd5b50610242610304366004611659565b611196565b348015610314575f80fd5b506101af7f000000000000000000000000000000000000000000000000016345785d8a000081565b348015610347575f80fd5b506101af603281565b34801561035b575f80fd5b506101af601e81565b34801561036f575f80fd5b506101f57f0000000000000000000000003cfc3cba1b4aaf969057f590d23efe46848f427081565b3480156103a2575f80fd5b506101af5f5481565b3480156103b6575f80fd5b506101af6103c5366004611639565b60086020525f908152604090205481565b3480156103e1575f80fd5b506104216103f0366004611681565b60056020525f90815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169082565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016101b9565b348015610458575f80fd5b506101af60035481565b34801561046d575f80fd5b506101af601281565b348015610481575f80fd5b50610421610490366004611681565b60046020525f90815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169082565b3480156104cc575f80fd5b506101af7f000000000000000000000000000000000000000000000000002386f26fc1000081565b5f805f546002146105075760015461050b565b6002545b905066038d7ea4c68000610525655af3107a4000836116c5565b1061053f5761053a655af3107a4000826116c5565b610548565b66038d7ea4c680005b91505090565b335f8181526006602052604081205490819003610597576040517fe120557300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b478111156105d1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82165f9081526006602052604081208190556007805483929061060a9084906116e2565b90915550506040515f9073ffffffffffffffffffffffffffffffffffffffff84169083908381818185875af1925050503d805f8114610664576040519150601f19603f3d011682016040523d82523d5f602084013e610669565b606091505b50509050806106a4576040517f7dc82f3600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff167f2ba0f09c5981638c28ab2c6ffad3986b84cf071c22daa8a06415e1a0aee7aea1836040516106ec91815260200190565b60405180910390a2505050565b610701611374565b5f805f807f0000000000000000000000006ce185860a4963106506c203335a2910413708e973ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561076e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610792919061170e565b9450945050935093506107a7848484846114a1565b600354428111156107e4576040517f1d8b1cdd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108107f0000000000000000000000000000000000000000000000000000000000000008600a611878565b61081c6012600a611878565b61082690876116c5565b6108309190611883565b5f8054919250600282146108465760015461084a565b6002545b90505f8115610c0957600b821161086257600161086d565b61086d600b83611883565b90506108997f000000000000000000000000000000000000000000000000016345785d8a0000826116c5565b6007546108a691906118bb565b6007555f8167ffffffffffffffff8111156108c3576108c36118ce565b6040519080825280602002602001820160405280156108ec578160200160208202803683370190505b5090505f8267ffffffffffffffff811115610909576109096118ce565b604051908082528060200260200182016040528015610932578160200160208202803683370190505b5090505f8061096860405180604001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81525090565b5f8080805b8a811015610b25578b60021461098f575f81815260046020526040902061099d565b5f8181526005602052604090205b60408051808201909152815473ffffffffffffffffffffffffffffffffffffffff1681526001909101546020820181905290955093508c84116109e9576109e4848e6116e2565b6109f3565b6109f38d856116e2565b8551909350915089811015610a815782898281518110610a1557610a156118fb565b60200260200101818152505081888281518110610a3457610a346118fb565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050858310610a7c578295508096505b610b1d565b85831015610b1d5782898881518110610a9c57610a9c6118fb565b60200260200101818152505081888881518110610abb57610abb6118fb565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610afe89611582565b9650888781518110610b1257610b126118fb565b602002602001015195505b60010161096d565b505f5b89811015610bff577f000000000000000000000000000000000000000000000000016345785d8a000060065f8a8481518110610b6657610b666118fb565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610bb291906118bb565b60065f8a8481518110610bc757610bc76118fb565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2055600101610b28565b5050505050505050505b610c337f0000000000000000000000000000000000000000000000000000000000015180866118bb565b6003555f610c3f6104f4565b335f90815260086020526040812080549293508392909190610c629084906118bb565b90915550506002849003610c7e5760015f908155600255610c88565b60025f9081556001555b6040805184815260208101849052908101869052606081018790527fa1df4ecbfcf24755c35c73587a001179603cdcfddf19c3c8487f6c347225dc6d9060800160405180910390a150505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8516610d2a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f03610d62576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000002386f26fc100003414610dbb576040517f7ac17d2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f548203610df5576040517f9d64984200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600354428111610e31576040517f1c09ff4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054600214610e4357600254610e47565b6001545b90506108988103610e84576040517f4f5eb21600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915273ffffffffffffffffffffffffffffffffffffffff84168152602081018690525f54600203610f25575f828152600460209081526040909120825181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617815590820151600191820155610f1d9083906118bb565b600155610f8f565b5f828152600560209081526040909120825181547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617815590820151600191820155610f8b9083906118bb565b6002555b610fb97f0000000000000000000000000000000000000000000000000000000000015180846118bb565b6040517f2af0742400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018a90529194507f0000000000000000000000003cfc3cba1b4aaf969057f590d23efe46848f427090911690632af07424907f0000000000000000000000000000000000000000000000000001c6bf52634000906044015f604051808303818588803b15801561106d575f80fd5b505af115801561107f573d5f803e3d5ffd5b50505050505f8873ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000110d9316ec0006040515f6040518083038185875af1925050503d805f81146110fa576040519150601f19603f3d011682016040523d82523d5f602084013e6110ff565b606091505b505090508061113a576040517f74c49eca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838573ffffffffffffffffffffffffffffffffffffffff167fdd381d66ea80a4a838ceb97ad9e3d39b0535933882b8ade17d1b6dc2196ef3a78960405161118391815260200190565b60405180910390a3505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff82166111e3576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f0361121c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f476007541061122c575f611239565b60075461123990476116e2565b905080821115611275576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815260086020526040902054808311156112be576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112c883826116e2565b335f9081526008602052604080822092909255905173ffffffffffffffffffffffffffffffffffffffff86169085908381818185875af1925050503d805f811461132d576040519150601f19603f3d011682016040523d82523d5f602084013e611332565b606091505b505090508061136d576040517f348aa51d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b5f807f000000000000000000000000fdb631f5ee196f0ed6faa767959853a9f217697d73ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113df573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611403919061170e565b509194509250508215905080611445576040517f032b3d0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82421061145c5761145783426116e2565b61145e565b5f5b9050610e10811161149b576040517fd15f73b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b5f8242106114b8576114b383426116e2565b6114ba565b5f5b9050610e108111156114f8576040517f19abf40e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8469ffffffffffffffffffff168269ffffffffffffffffffff16101561154a576040517f19abf40e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f841361136d576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60015b82518110156115d5578282815181106115a1576115a16118fb565b60200260200101518382815181106115bb576115bb6118fb565b602002602001015111156115cd578091505b600101611586565b50919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146115fe575f80fd5b919050565b5f805f8060808587031215611616575f80fd5b61161f856115db565b966020860135965060408601359560600135945092505050565b5f60208284031215611649575f80fd5b611652826115db565b9392505050565b5f806040838503121561166a575f80fd5b611673836115db565b946020939093013593505050565b5f60208284031215611691575f80fd5b5035919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176116dc576116dc611698565b92915050565b818103818111156116dc576116dc611698565b805169ffffffffffffffffffff811681146115fe575f80fd5b5f805f805f60a08688031215611722575f80fd5b61172b866116f5565b945060208601519350604086015192506060860151915061174e608087016116f5565b90509295509295909350565b600181815b808511156117b357817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561179957611799611698565b808516156117a657918102915b93841c939080029061175f565b509250929050565b5f826117c9575060016116dc565b816117d557505f6116dc565b81600181146117eb57600281146117f557611811565b60019150506116dc565b60ff84111561180657611806611698565b50506001821b6116dc565b5060208310610133831016604e8410600b8410161715611834575081810a6116dc565b61183e838361175a565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561187057611870611698565b029392505050565b5f61165283836117bb565b5f826118b6577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b808201808211156116dc576116dc611698565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212204ca62640fbbf06e3532c2150c6da927b80897278cfc1c37f5410dda891e60f6464736f6c63430008180033

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

0000000000000000000000006ce185860a4963106506c203335a2910413708e9000000000000000000000000fdb631f5ee196f0ed6faa767959853a9f217697d0000000000000000000000003cfc3cba1b4aaf969057f590d23efe46848f4270000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000015180000000000000000000000000000000000000000000000000000000006894bf70

-----Decoded View---------------
Arg [0] : _oracleContract (address): 0x6ce185860a4963106506C203335A2910413708e9
Arg [1] : _sequencerUptimeFeed (address): 0xFdB631F5EE196F0ed6FAa767959853A9F217697D
Arg [2] : _topCutVault (address): 0x3cfc3CBA1B4aAF969057F590D23efe46848F4270
Arg [3] : _tradeSize (uint256): 10000000000000000
Arg [4] : _tradeDuration (uint256): 86400
Arg [5] : _firstSettlementTime (uint256): 1754578800

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000006ce185860a4963106506c203335a2910413708e9
Arg [1] : 000000000000000000000000fdb631f5ee196f0ed6faa767959853a9f217697d
Arg [2] : 0000000000000000000000003cfc3cba1b4aaf969057f590d23efe46848f4270
Arg [3] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [5] : 000000000000000000000000000000000000000000000000000000006894bf70


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.