Skip to content

feat: add TIP-1034 TIP-20 channel reserve interface - #138

Open
Lesnak1 wants to merge 1 commit into
tempoxyz:masterfrom
Lesnak1:feat/add-tip1034-channel-reserve-interface
Open

feat: add TIP-1034 TIP-20 channel reserve interface#138
Lesnak1 wants to merge 1 commit into
tempoxyz:masterfrom
Lesnak1:feat/add-tip1034-channel-reserve-interface

Conversation

@Lesnak1

@Lesnak1 Lesnak1 commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Adds the standard Solidity interface, precompile constants, and unit tests for the TIP-1034 TIP-20 Channel Reserve Precompile (0x4d50500000000000000000000000000000000000), introduced in Tempo Hardfork T5.

The TIP-20 Channel Reserve serves as the foundational on-chain primitive for the Machine Payments Protocol (MPP), locking payer deposits, settling increasing cumulative EIP-712 vouchers, and managing unilateral close grace timers.

Changes

  1. src/interfaces/ITIP20ChannelReserve.sol:

    • Declares ChannelDescriptor, ChannelState, and Channel structs.
    • Declares all channel lifecycle methods: open, settle, topUp, close, requestClose, withdraw.
    • Declares getters: getChannel, getChannelState, getChannelStatesBatch, computeChannelId, getVoucherDigest, domainSeparator, storageCredits.
    • Declares events and custom errors.
  2. src/StdPrecompiles.sol & src/Tempo.sol:

    • Added TIP20_CHANNEL_RESERVE_ADDRESS = 0x4d50500000000000000000000000000000000000.
    • Added typed TIP20_CHANNEL_RESERVE and Tempo.tip20ChannelReserve export.
  3. test/TIP20ChannelReserve.t.sol:

    • Comprehensive test suite asserting precompile address exports, typed exports, 15 function selectors, and 13 custom error selectors against canonical hashes.

Verification

forge test
All tests passing across all suites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant