Skip to content
Verified contractExactMIT

HookedMinerGame

Address0xeb7fdd81f840c5ce99f39a07ea0cd1b63f042086
Balance

0.266422 ETH

 

Transactions

1,004

 

Compiler

solc 0.8.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,887,688
Creation transaction
0x8247afef6b…5f8985c1f6

src/HookedMinerGame.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import {IArbInbox} from "./interfaces/IArbInbox.sol";
import {IHookedMinerSinkL2} from "./interfaces/IHookedMinerSinkL2.sol";

/// @title HookedMinerGame — the L1 body of HookedMiner (Ethereum mainnet)
/// @notice One hook mints Bitcoin. This machine feeds it.
///
///         A plain payable contract (deliberately NOT a v4 hook — F6-C): players buy
///         `miners` on a rising linear curve; every buy is split four ways
///         (40% hooked to L2 mining / 20% jackpot / 20% next-round carry / 20%
///         dividends to existing miners); the round lives on a dead-man's switch
///         quantised to HBTC's 10-minute blocks and dies the moment one full block
///         passes with zero qualifying buys. The hooked slice is one unlabeled bank:
///         when it clears MIN_REMIT it leaves as a dumb retryable (`fund()` + ETH)
///         to HookedMinerSink. No net-line, no per-round oil, no HBTC receipts.
///         Design: docs/DESIGN.md v2.6 (fuel-tank cut); constants:
///         docs/NUMERIC-DRAFT.md v1 (owner-signed 2026-08-22).
///
///         No owner. No admin. No pause. No proxy. Deployment is final.
contract HookedMinerGame {
    // ------------------------------------------------------------- constants

    /// @notice HBTC block cadence (seconds). Timer quantum and remit metronome.
    uint256 public constant BLOCK_DURATION = 600;

    /// @notice Four-way split (basis points). Locked by owner (F2).
    uint256 public constant HOOKED_BPS = 4_000;
    uint256 public constant JACKPOT_BPS = 2_000;
    uint256 public constant CARRY_BPS = 2_000;
    uint256 public constant DIVIDEND_BPS = 2_000;
    uint256 public constant BPS = 10_000;

    /// @notice Miner curve: price per whole miner = P0 + DELTA * minersSold (F6-C).
    ///         Doubles every 5,000 miners. Miners are 1e18-fractional internal
    ///         balances — non-transferable, retired with their round.
    uint256 public constant P0 = 0.0001 ether;
    uint256 public constant DELTA = 0.00000002 ether;
    uint256 public constant ONE_MINER = 1e18;

    /// @notice Minimum qualifying buy (heartbeat) three-phase curve (F1, standard
    ///         package): ramp M0->M1 over RAMP_BLOCKS, plateau until PLATEAU_END,
    ///         then staircase-doubling every DOUBLE_PERIOD blocks. Age-based only.
    uint256 public constant M0 = 0.002 ether;
    uint256 public constant M1 = 0.02 ether;
    uint256 public constant RAMP_BLOCKS = 144;
    uint256 public constant PLATEAU_END = 432;
    uint256 public constant DOUBLE_PERIOD = 72;

    /// @notice Inherited carry vests linearly into the live jackpot over the round's
    ///         first CARRY_DRIP_BLOCKS blocks; unvested remainder rolls to the next
    ///         round's vault on early death (carry-snipe fix, owner-signed 2026-08-22).
    uint256 public constant CARRY_DRIP_BLOCKS = 144;

    /// @notice Remit thresholds: bank at least MIN_REMIT before a live ticket fires,
    ///         and never spend more than 2% of the banked amount on L1->L2 fees.
    ///         A settled round (death flush) waives both gates so leftover hook can
    ///         leave if it still covers the fee quote; dust under fees waits.
    uint256 public constant MIN_REMIT = 0.05 ether;
    uint256 public constant MAX_FEE_DRAG_DIVISOR = 50; // fees * 50 <= bank  <=>  drag <= 2%
    uint256 public constant SUBMISSION_FEE_MULTIPLIER = 3;

    /// @notice Dividend accumulator precision (per miner-wei index).
    uint256 private constant ACC = 1e18;

    // ------------------------------------------------------------ immutables

    /// @notice Arbitrum Delayed Inbox for Robinhood Chain (4663).
    IArbInbox public immutable inbox;

    /// @notice HookedMinerSink on Robinhood Chain. Both retryable refund rails point
    ///         here — the core screw of the no-loss construction (DESIGN §3.7).
    address public immutable sink;

    /// @notice OreHook's genesis timestamp, mirrored so both chains agree on block
    ///         indices (both clocks are unix time; skew is seconds against a 600s
    ///         quantum). Read from OreHook at deployment.
    uint256 public immutable genesisTimestamp;

    /// @notice Retryable execution budget on L2. If maxFeePerGas falls below the L2
    ///         gas price the auto-redeem is skipped, but anyone can redeem manually
    ///         within the 7-day window and unused gas refunds to the sink — money is
    ///         late, never lost.
    uint256 public immutable l2GasLimit;
    uint256 public immutable l2MaxFeePerGas;

    // ----------------------------------------------------------------- state

    struct Round {
        uint64 startBlock; // HBTC block of ignition
        uint64 lastQualifyingBlock; // last block containing a qualifying buy
        uint64 deathBlock; // == lastQualifyingBlock once settled (retroactive last block)
        bool settled;
        address lastHand; // current jackpot candidate
        uint256 totalMiners; // miner-wei sold this round (curve input)
        uint256 jackpotAccrued; // 20% slices + first-buy dividends + split remainders
        uint256 carryTotal; // inherited carry, vesting over CARRY_DRIP_BLOCKS
        uint256 accDivPerMiner; // dividend index, ACC-scaled per miner-wei
    }

    /// @notice Latest round ever ignited (0 = none). rounds[roundId].settled == true
    ///         means the machine is between rounds; the next buy ignites roundId + 1.
    uint256 public roundId;
    mapping(uint256 => Round) public rounds;

    /// @notice Per-round, per-player ledgers. Miners are internal balances only.
    mapping(uint256 => mapping(address => uint256)) public minersOf;
    mapping(uint256 => mapping(address => uint256)) public divDebt;
    mapping(uint256 => mapping(address => uint256)) public divClaimable;

    /// @notice 20% carry slices accumulating for the NEXT round (plus unvested
    ///         drip rolled back by early deaths).
    uint256 public carryVault;

    /// @notice 40% hooked slices awaiting remit — one unlabeled tank. Dust below
    ///         fees waits for later buys to pile on, then leaves in one ticket.
    uint256 public remitBank;

    /// @notice Cumulative net ETH ever sent as l2CallValue (ops counter).
    uint256 public netRemitted;

    uint64 public lastRemitBlock;

    /// @notice Pull-payment ledgers (CEI everywhere; no push payouts).
    mapping(address => uint256) public jackpotOwed;
    uint256 public jackpotLiability;

    /// @notice Aggregate dividend liability. Credited with the full 20% slice
    ///         (index floor dust stays in this pot — it is not skimmed to the
    ///         jackpot). Claims floor on the accumulator, so claims ≤ booked and
    ///         INV-2 holds. Saturating decrement is defense-in-depth only.
    uint256 public divLiability;

    uint256 private _entered;

    // ---------------------------------------------------------------- events

    event RoundIgnited(uint256 indexed roundId, uint64 startBlock, uint256 carryTotal, address igniter);
    event MinersBought(
        uint256 indexed roundId,
        address indexed buyer,
        uint256 ethIn,
        uint256 minerWei,
        bool qualifying,
        uint64 hbtcBlock
    );
    event RoundDied(
        uint256 indexed roundId,
        uint64 deathBlock,
        address indexed lastHand,
        uint256 jackpot,
        uint256 carryVested,
        uint256 carryRolled
    );
    event JackpotClaimed(address indexed player, uint256 amount);
    event DividendsClaimed(uint256 indexed roundId, address indexed player, uint256 amount);
    event Remitted(uint256 netStart, uint256 l2CallValue, uint256 fees, uint256 l1MessageNumber);

    // ---------------------------------------------------------------- errors

    error ZeroBuy();
    error IgnitionBelowMinimum();
    error ZeroAddress();
    error ZeroGasParams();
    error GenesisInFuture();
    error TransferFailed();
    error Reentrancy();
    error SinkCollision();
    error SinkHasL1Code();

    // ------------------------------------------------------------- modifiers

    modifier nonReentrant() {
        if (_entered != 0) revert Reentrancy();
        _entered = 1;
        _;
        _entered = 0;
    }

    // ------------------------------------------------------------ constructor

    constructor(
        IArbInbox inbox_,
        address sink_,
        uint256 genesisTimestamp_,
        uint256 l2GasLimit_,
        uint256 l2MaxFeePerGas_
    ) {
        if (address(inbox_) == address(0) || sink_ == address(0)) revert ZeroAddress();
        if (sink_ == address(this)) revert SinkCollision();
        if (sink_.code.length != 0) revert SinkHasL1Code();
        if (block.timestamp < genesisTimestamp_) revert GenesisInFuture();
        if (l2GasLimit_ == 0 || l2MaxFeePerGas_ == 0) revert ZeroGasParams();
        inbox = inbox_;
        sink = sink_;
        genesisTimestamp = genesisTimestamp_;
        l2GasLimit = l2GasLimit_;
        l2MaxFeePerGas = l2MaxFeePerGas_;
    }

    // ------------------------------------------------------------------ views

    /// @notice Index of the HBTC block containing the current timestamp.
    function hbtcBlock() public view returns (uint64) {
        return uint64((block.timestamp - genesisTimestamp) / BLOCK_DURATION);
    }

    /// @notice Minimum qualifying buy at round age `age` (blocks). Monotone, pure,
    ///         age-only (INV-4): ramp, plateau, then staircase doubling.
    function mqbAt(uint256 age) public pure returns (uint256) {
        if (age < RAMP_BLOCKS) return M0 + ((M1 - M0) * age) / RAMP_BLOCKS;
        if (age < PLATEAU_END) return M1;
        uint256 doublings = (age - PLATEAU_END) / DOUBLE_PERIOD;
        if (doublings > 60) doublings = 60; // 2e16 << 60 ~ 2.3e34 wei: beyond any budget, no overflow
        return M1 << doublings;
    }

    /// @notice Heartbeat price right now (M0 when the machine waits for ignition).
    function currentMQB() external view returns (uint256) {
        Round storage r = rounds[roundId];
        if (roundId == 0 || r.settled) return M0;
        uint64 nb = hbtcBlock();
        // A round past its death condition is priced as a fresh ignition.
        // Do not use startBlock==0 as a sentinel: a round ignited in HBTC
        // block 0 is a real round (audit round 12).
        if (nb >= uint256(r.lastQualifyingBlock) + 2) return M0;
        return mqbAt(nb - r.startBlock);
    }

    /// @notice Live jackpot: accrued slices plus vested carry, computed as "what the
    ///         winner gets if the round dies right now" — the same lived-blocks
    ///         formula `_roll` settles with (AUDIT 2026-08-22: wall-clock age would
    ///         overstate the pot during a death gap, where lastQualifyingBlock is
    ///         frozen but blocks keep passing).
    function liveJackpot() external view returns (uint256) {
        Round storage r = rounds[roundId];
        if (roundId == 0 || r.settled) return 0;
        uint256 lived = uint256(r.lastQualifyingBlock) + 1 - r.startBlock;
        uint256 vested = lived >= CARRY_DRIP_BLOCKS ? r.carryTotal : r.carryTotal * lived / CARRY_DRIP_BLOCKS;
        return r.jackpotAccrued + vested;
    }

    /// @notice Claimable ETH dividends for `player` in round `rid`.
    function pendingDividends(uint256 rid, address player) external view returns (uint256) {
        return
            divClaimable[rid][player] + (minersOf[rid][player] * rounds[rid].accDivPerMiner) / ACC
                - divDebt[rid][player];
    }

    /// @notice Deterministic death timestamp of a settled (or death-gap) round:
    ///         the closing edge of the empty block that killed it. 0 while live.
    function deathTimestampOf(uint256 rid) public view returns (uint64) {
        Round storage r = rounds[rid];
        uint64 deathBlk;
        if (r.settled) {
            deathBlk = r.deathBlock;
        } else if (rid == roundId && roundId != 0 && hbtcBlock() >= uint256(r.lastQualifyingBlock) + 2) {
            deathBlk = r.lastQualifyingBlock;
        } else {
            return 0;
        }
        return uint64(genesisTimestamp + (uint256(deathBlk) + 2) * BLOCK_DURATION);
    }

    /// @notice Immutable L2 execution prepaid on every ticket (`l2GasLimit * l2MaxFeePerGas`).
    function gasBudget() public view returns (uint256) {
        return l2GasLimit * l2MaxFeePerGas;
    }

    /// @notice Miner-wei bought by `value` at the current curve position (view helper).
    function quoteMiners(uint256 value) external view returns (uint256) {
        Round storage r = rounds[roundId];
        // A dead-but-unsettled round (death gap) prices off a FRESH curve: the
        // next real buy settles it and ignites at sold == 0. Mirror currentMQB's
        // gap handling so the two public views never contradict (AUDIT 2026-08-23,
        // 3rd pass). Ignition still requires >= M0. Return 0 below that floor so
        // the quote cannot advertise a mint buyMiners will revert (audit N1).
        bool freshCurve = roundId == 0 || r.settled || hbtcBlock() >= uint256(r.lastQualifyingBlock) + 2;
        if (freshCurve && value < M0) return 0;
        uint256 sold = freshCurve ? 0 : r.totalMiners;
        return _minersFor(value, sold);
    }

    // ------------------------------------------------------------------- buy

    /// @notice Buy miners with ETH. Any amount buys and earns dividends; only buys
    ///         >= the current MQB extend the timer. If no round is live the buy must
    ///         be >= M0 and ignites the next round (a round is born armed — this also
    ///         closes the 1-wei-ignition drip-snipe corner).
    function buyMiners() external payable nonReentrant {
        if (msg.value == 0) revert ZeroBuy();
        uint64 nb = hbtcBlock();
        _roll(nb);
        (uint256 rid, Round storage r) = _liveOrIgnite(nb);
        _splitFour(r);
        uint256 q = _mintMiners(r, rid);

        bool qualifying = msg.value >= mqbAt(nb - r.startBlock);
        if (qualifying) {
            r.lastQualifyingBlock = nb;
            r.lastHand = msg.sender;
        }
        emit MinersBought(rid, msg.sender, msg.value, q, qualifying, nb);

        _tryRemit(nb);
    }

    /// @dev Return the live round or ignite the next one (buy >= M0 required so a
    ///      round is always born armed).
    function _liveOrIgnite(uint64 nb) internal returns (uint256 rid, Round storage r) {
        rid = roundId;
        r = rounds[rid];
        if (rid != 0 && !r.settled) return (rid, r);

        if (msg.value < M0) revert IgnitionBelowMinimum();
        rid = ++roundId;
        r = rounds[rid];
        r.startBlock = nb;
        r.lastQualifyingBlock = nb;
        r.lastHand = msg.sender;
        uint256 carry = carryVault;
        if (carry > 0) {
            r.carryTotal = carry;
            carryVault = 0;
        }
        emit RoundIgnited(rid, nb, carry, msg.sender);
    }

    /// @dev Four-way split of msg.value (INV-1: slices + remainder == msg.value).
    ///      Dividends credit BEFORE minting: already-held miners take their
    ///      pro-rata of this buy; units minted in *this* call do not. First buy
    ///      of a round (no miners yet) routes the dividend slice to the jackpot.
    function _splitFour(Round storage r) internal {
        uint256 v = msg.value;
        uint256 hooked = (v * HOOKED_BPS) / BPS;
        uint256 jack = (v * JACKPOT_BPS) / BPS;
        uint256 carrySlice = (v * CARRY_BPS) / BPS;
        uint256 div = (v * DIVIDEND_BPS) / BPS;
        uint256 toJackpot = jack + (v - hooked - jack - carrySlice - div); // split remainder -> jackpot
        remitBank += hooked;
        carryVault += carrySlice;

        uint256 tm = r.totalMiners;
        if (tm == 0) {
            toJackpot += div; // self-ignition: no recipients yet
        } else {
            uint256 accDelta = (div * ACC) / tm;
            r.accDivPerMiner += accDelta;
            divLiability += div; // full slice; index floor dust stays in this pot
        }
        r.jackpotAccrued += toJackpot;
    }

    /// @dev Harvest the buyer's pending dividends (masterchef), then mint miners
    ///      along the curve and reset the debt checkpoint.
    function _mintMiners(Round storage r, uint256 rid) internal returns (uint256 q) {
        uint256 bal = minersOf[rid][msg.sender];
        if (bal > 0) {
            divClaimable[rid][msg.sender] += (bal * r.accDivPerMiner) / ACC - divDebt[rid][msg.sender];
        }
        uint256 tm = r.totalMiners;
        q = _minersFor(msg.value, tm);
        minersOf[rid][msg.sender] = bal + q;
        r.totalMiners = tm + q;
        divDebt[rid][msg.sender] = ((bal + q) * r.accDivPerMiner) / ACC;
    }

    // ------------------------------------------------------------------ poke

    /// @notice Permissionless keeper entry: settles a due death and fires a due
    ///         remit. Buys do both implicitly; poke covers the quiet hours.
    function poke() external nonReentrant {
        uint64 nb = hbtcBlock();
        _roll(nb);
        _tryRemit(nb);
    }

    // ---------------------------------------------------------------- claims

    /// @notice Pull the jackpot won as the last hand of any settled round.
    function claimJackpot() external nonReentrant returns (uint256 amount) {
        amount = jackpotOwed[msg.sender];
        if (amount == 0) return 0;
        jackpotOwed[msg.sender] = 0;
        jackpotLiability -= amount;
        (bool ok,) = msg.sender.call{value: amount}("");
        if (!ok) revert TransferFailed();
        emit JackpotClaimed(msg.sender, amount);
    }

    /// @notice Pull ETH dividends earned by round `rid` miners. Never expires.
    function claimDividends(uint256 rid) external nonReentrant returns (uint256 amount) {
        uint256 bal = minersOf[rid][msg.sender];
        uint256 acc = rounds[rid].accDivPerMiner;
        amount = divClaimable[rid][msg.sender] + (bal * acc) / ACC - divDebt[rid][msg.sender];
        if (amount == 0) return 0;
        divClaimable[rid][msg.sender] = 0;
        divDebt[rid][msg.sender] = (bal * acc) / ACC;
        // Saturating decrement: the aggregate ledger absorbs sub-wei index drift.
        divLiability = divLiability >= amount ? divLiability - amount : 0;
        (bool ok,) = msg.sender.call{value: amount}("");
        if (!ok) revert TransferFailed();
        emit DividendsClaimed(rid, msg.sender, amount);
    }

    // -------------------------------------------------------------- internals

    /// @dev Lazy death settlement. A round dies iff a full HBTC block passed with
    ///      zero qualifying buys (INV-3): current block >= lastQualifyingBlock + 2.
    function _roll(uint64 nb) internal {
        uint256 rid = roundId;
        if (rid == 0) return;
        Round storage r = rounds[rid];
        if (r.settled) return;
        if (nb < r.lastQualifyingBlock + 2) return;

        uint64 lastBlock = r.lastQualifyingBlock;
        r.settled = true;
        r.deathBlock = lastBlock;

        // Carry drip: vest by blocks lived; roll the remainder to the next vault.
        uint256 lived = uint256(lastBlock) + 1 - r.startBlock;
        uint256 vested = r.carryTotal;
        uint256 rolled = 0;
        if (lived < CARRY_DRIP_BLOCKS) {
            vested = (r.carryTotal * lived) / CARRY_DRIP_BLOCKS;
            rolled = r.carryTotal - vested;
            carryVault += rolled;
        }

        uint256 jackpot = r.jackpotAccrued + vested;
        r.jackpotAccrued = 0;
        jackpotOwed[r.lastHand] += jackpot;
        jackpotLiability += jackpot;

        emit RoundDied(rid, lastBlock, r.lastHand, jackpot, vested, rolled);
    }

    /// @dev Invert the curve integral (q, sold in miner-wei; v in ETH wei):
    ///      v = P0*q/1e18 + DELTA*sold*q/1e36 + DELTA*q^2/2e36.
    ///      Single integer sqrt; floor favors the curve by sub-wei dust.
    function _minersFor(uint256 v, uint256 sold) internal pure returns (uint256) {
        uint256 b = P0 * 1e18 + DELTA * sold;
        uint256 disc = b * b + 2 * DELTA * v * 1e36;
        return (_sqrt(disc) - b) / DELTA;
    }

    /// @dev Floor square root (Babylonian).
    function _sqrt(uint256 x) internal pure returns (uint256 y) {
        if (x == 0) return 0;
        uint256 z = (x + 1) / 2;
        y = x;
        while (z < y) {
            y = z;
            z = (x / z + z) / 2;
        }
    }

    /// @dev Fire a remit ticket if the bank and the block edge allow. Best-effort:
    ///      a buy must never brick on bridge conditions (INV-9, DESIGN §3.7).
    ///
    ///      One unlabeled tank. Live remits need MIN_REMIT and the 2% fee-drag
    ///      gate. A settled current round (death flush) waives both so leftover
    ///      hook can leave if it still covers the fee quote. Dust under fees
    ///      waits for the next pile-on. State mutates only after the Inbox
    ///      accepts the ticket. Payload is `fund()` — 4 bytes, no rids.
    function _tryRemit(uint64 nb) internal {
        uint256 slice = remitBank;
        if (slice == 0) return;
        if (nb <= lastRemitBlock) return;

        bool deathFlush = roundId != 0 && rounds[roundId].settled;
        if (!deathFlush && slice < MIN_REMIT) return;

        bytes memory data = abi.encodeCall(IHookedMinerSinkL2.fund, ());
        uint256 submissionFee;
        try inbox.calculateRetryableSubmissionFee(data.length, block.basefee) returns (uint256 quoted) {
            if (quoted > type(uint256).max / SUBMISSION_FEE_MULTIPLIER) return;
            submissionFee = quoted * SUBMISSION_FEE_MULTIPLIER;
        } catch {
            return;
        }
        uint256 fees = submissionFee + gasBudget();
        if (fees >= slice) return;
        if (!deathFlush && fees * MAX_FEE_DRAG_DIVISOR > slice) return;
        uint256 netValue = slice - fees;

        // UNSAFE creator on purpose: both refund rails are the L2 sink itself, and
        // we must never let Nitro alias them to `alias(sink)` (unowned) — which the
        // safe creator would do the moment L1 code appears at the sink's numeric
        // address post-deploy, sending expired principal into the void (audit angle
        // 4 / Finding 2). Funding is exact. INV-9's no-loss terminal states still
        // hold: refunds reach the LITERAL sink regardless of any later L1 code.
        try inbox.unsafeCreateRetryableTicket{value: slice}(
            sink,
            netValue,
            submissionFee,
            sink, // excess fee refunds -> literal sink (fee dust)
            sink, // callvalue refunds -> literal sink; sink has no cancel function
            l2GasLimit,
            l2MaxFeePerGas,
            data
        ) returns (
            uint256 l1MessageNumber
        ) {
            emit Remitted(netRemitted, netValue, fees, l1MessageNumber);
            remitBank = 0;
            netRemitted += netValue;
            lastRemitBlock = nb;
        } catch {
            // Nothing was mutated; the bank simply waits for the next beat.
        }
    }
}

src/interfaces/IArbInbox.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

/// @title IArbInbox — minimal surface of the Arbitrum Delayed Inbox used by HookedMiner
/// @notice Two creators. The game remit path uses only the unsafe one:
///         - `createRetryableTicket` (SAFE): reverts on underfunding AND aliases any
///           refund address that is an L1 contract. Kept on the interface; the
///           fuel-tank Game no longer ships caller-funded tickets.
///         - `unsafeCreateRetryableTicket`: no aliasing. Used by the remit path,
///           whose refund address is the L2 sink itself — we always want the LITERAL
///           sink address, never `alias(sink)` (which nothing controls). The safe
///           variant would alias it the moment any L1 code appears at that numeric
///           address post-deploy, silently sending expired principal to an unowned
///           alias (fresh-eyes audit 2026-08-23, angle 4 / Finding 2). The remit path
///           funds the ticket EXACTLY (value == l2CallValue + submissionCost + gas), so
///           the safe variant's underfunding revert never protected it anyway.
interface IArbInbox {
    /// @notice Create a retryable ticket. Reverts on L1 if msg.value cannot cover
    ///         l2CallValue + maxSubmissionCost + gasLimit * maxFeePerGas; aliases
    ///         refund addresses that are L1 contracts.
    function createRetryableTicket(
        address to,
        uint256 l2CallValue,
        uint256 maxSubmissionCost,
        address excessFeeRefundAddress,
        address callValueRefundAddress,
        uint256 gasLimit,
        uint256 maxFeePerGas,
        bytes calldata data
    ) external payable returns (uint256);

    /// @notice Like `createRetryableTicket` but performs NO refund-address aliasing
    ///         (and no underfunding pre-check). Refunds go to the literal addresses.
    function unsafeCreateRetryableTicket(
        address to,
        uint256 l2CallValue,
        uint256 maxSubmissionCost,
        address excessFeeRefundAddress,
        address callValueRefundAddress,
        uint256 gasLimit,
        uint256 maxFeePerGas,
        bytes calldata data
    ) external payable returns (uint256);

    /// @notice Current submission fee for a ticket with `dataLength` bytes of calldata.
    function calculateRetryableSubmissionFee(uint256 dataLength, uint256 baseFee) external view returns (uint256);
}

src/interfaces/IHookedMinerSinkL2.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

/// @title IHookedMinerSinkL2 — the exact L2 sink surface the L1 game encodes against
/// @notice Shared by both chains so the compiler enforces selector agreement: the L1
///         game builds retryable calldata with `abi.encodeCall(IHookedMinerSinkL2.fund)`,
///         and `HookedMinerSink` inherits this interface. Signature drift is a compile
///         error rather than a silently-bricked bridge on an un-upgradeable two-chain
///         deploy.
///
///         Fuel-tank cut (owner 2026-09-01): the ticket is ETH plus this empty
///         call. No net line, no round ids, no receipt weights.
interface IHookedMinerSinkL2 {
    function fund() external payable;
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "v4-core/=lib/v4-core/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "@openzeppelin/=lib/v4-core/lib/openzeppelin-contracts/",
    "ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "openzeppelin-contracts/=lib/v4-core/lib/openzeppelin-contracts/",
    "solmate/=lib/v4-core/lib/solmate/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.