Skip to content

abi: complete Hipo Finance message schemas - #499

Open
behrang wants to merge 1 commit into
tonkeeper:masterfrom
behrang:hipo-abi
Open

abi: complete Hipo Finance message schemas#499
behrang wants to merge 1 commit into
tonkeeper:masterfrom
behrang:hipo-abi

Conversation

@behrang

@behrang behrang commented Aug 5, 2026

Copy link
Copy Markdown

What

Completes abi/schemas/hipo_finance.xml for Hipo, the liquid staking protocol on TON (treasury EQCLyZHP4Xe8fpchQz76O-_RmUhaVc_9BAoGyJrwJrcbz2eZ, jetton hGRAM, formerly hTON).

The schema currently declares only the deposit leg (deposit_coins, proxy_tokens_minted, tokens_minted, added in 3b80a51). This PR verifies those three field-by-field against the protocol's authoritative TL-B (contracts/schema.tlb — they are correct, only regrouped by contract) and adds the 16 missing ops for the remaining flows:

  • unstake/withdraw: proxy_reserve_tokens, reserve_tokens, proxy_tokens_burned, tokens_burned, withdrawal_notification
  • deferred (bill SBT) flows: proxy_save_coins, save_coins, mint_bill, assign_bill, bill_burned, mint_tokens, burn_tokens, burn_all, last_bill_burned
  • rollback: proxy_rollback_unstake, rollback_unstake
  • loans: request_loan, recover_stake_result, loan_result

Deliberately not redeclared (noted in an XML comment): ops already covered by generic TEP schemas — unstake_tokens is TEP-74 burn#595f07bc, transfer_notification, ownership_assigned, excesses, and Hipo's burn_bill, which is TEP-85 revoke#6f89f5e3 with an identical body (already decoded as SbtRevoke; a duplicate would make the opcode ambiguous).

Regenerated with go run cmd/codegen/abi/main.go. I'm from the Hipo team — happy to adjust conventions if anything doesn't match how you'd like the schemas structured.

Testing

go build ./... and go test ./abi/... pass (one pre-existing failure, Test_contractInspector_InspectContract/storm_vamm_coinm, reproduces on master). Round-trip marshal/decode was verified locally for the trickier layouts (reserve_tokens uint4 mode, Bool fields, request_loan's ^NewStakeMsg).

🤖 Generated with Claude Code

Hipo is a liquid staking protocol for the native coin (treasury
EQCLyZHP4Xe8fpchQz76O-_RmUhaVc_9BAoGyJrwJrcbz2eZ, hGRAM jetton parent
EQDPdq8xjAhytYqfGSX8KcFWIReCufsB9Wdg0pLlYSO_h76w). Only three of its ops
were declared, so unstake, deferred-stake/bill and loan traces decoded as
raw op-codes.

Add the remaining ops needed to follow a full Hipo trace, transcribed from
contracts/schema.tlb in github.com/HipoFinance/contract:

  treasury:   reserve_tokens#386a358b, mint_tokens#42684479,
              burn_tokens#7cffe1ee, last_bill_burned#c6d8b51f,
              request_loan#36335da9, recover_stake_result#0fca4c86
  parent:     proxy_save_coins#47daa10f, proxy_reserve_tokens#688b0213,
              proxy_rollback_unstake#32b67194, proxy_tokens_burned#4476fde0
  wallet:     save_coins#4cce0e74, rollback_unstake#1b77fd1a,
              tokens_burned#5b512e25
  collection: mint_bill#4b2d7871, bill_burned#840f6369, burn_all#639d400a
  bill:       assign_bill#3275dfc2
  borrower:   loan_result#faaa8366
  staker:     withdrawal_notification#f0fa223b

The three pre-existing ops (deposit_coins, proxy_tokens_minted,
tokens_minted) were verified field-by-field against schema.tlb and are
correct; they are only regrouped by contract with the rest.

Ops that the generic TEP schemas already cover are deliberately not
redeclared: unstake_tokens is TEP-74 burn#595f07bc, plus
transfer_notification#7362d09c, ownership_assigned#05138d91,
excesses#d53276db, and Hipo's burn_bill, which is the TEP-85
revoke#6f89f5e3 with an identical body (already decoded as SbtRevoke).

Regenerated with `go run cmd/codegen/abi/main.go`.
@behrang

behrang commented Aug 15, 2026

Copy link
Copy Markdown
Author

Gentle ping — this has been quiet for about ten days, so just making sure it didn't slip off the radar. It's a schema-plus-regenerated-code change with no behavior changes outside the Hipo ABI; happy to adjust naming or structure to your conventions, or split it up if that makes review easier.

@behrang

behrang commented Aug 26, 2026

Copy link
Copy Markdown
Author

Second ping, three weeks in — no urgency, just keeping it on the radar.

One thing that might help with prioritising: opentonapi#939 classifies Hipo actions on top of these schemas, and it picked up a reviewer this week, so landing this side first would unblock that one.

The branch is still conflict-free against master. Happy to rebase, split it up, or adjust anything that doesn't match your conventions.

@behrang

behrang commented Sep 10, 2026

Copy link
Copy Markdown
Author

Third ping, five weeks in.

Still conflict-free against master: schema additions plus regenerated code, no behavior change outside the Hipo ABI. opentonapi#939 builds on these schemas and has a reviewer on it, so this side landing first would unblock that one.

Happy to split it, rebase, or adjust naming to your conventions. If GitHub isn't the right place to chase this, tell me where is and I'll take it there.

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