Add TP 2.0 CCV and fees management - #836
Open
krebernisak wants to merge 2 commits into
Open
Conversation
krebernisak
force-pushed
the
feat/tp-get-ccvs-fees
branch
from
August 19, 2026 13:30
fa5afb0 to
94657e2
Compare
duck-types
self-requested a review
August 21, 2026 14:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Token Pool 2.0: async
GetCCVs/GetCCVsAndFeesTON-native replacement for EVM
getRequiredCCVs+getFeeWhat. Adds the missing V2 CCV-management surface to the TON TokenPool, closing the headline gap in the EVM-parity. EVM exposes two sync view calls —
getRequiredCCVs(...)(delegates toAdvancedPoolHooks) andgetFee(...). TON can't use sync cross-contract views, so this lands a message/req-res translation.Design (one round-trip, minimal).
TokenPool_GetCCVs(0xc5476d2b) →TokenPool_CCVs(CCVs only; OffRamp).TokenPool_GetCCVsAndFees(0xd22944d5) →TokenPool_CCVsAndFees(CCVs and the pool-computed fee params in one reply; OnRamp). This bundles EVM's two calls into a single async round-trip.TokenPool_GetCCVsto asyncadvancedPoolHooks(replyTo=pool, context echoed back); the pool reassembles the correct reply variant fromTokenPool_FeeContext(null→CCVs, elseCCVsAndFees).TokenPool_GetCCVsFailed(addedTokenPool_GetCCVsto each pool'sBouncedMessagewith the same RichBounce handling as the other bounce paths).Parity with
TokenPool.sol. Exact port ofgetRequiredCCVsamount logic (outbound subtracts bps fee; inbound_calculateLocalAmountviaparseRemoteDecimals(extraData)) andgetFee(disabled/missing config →feesProvided=false→ FeeQuoter defaults). Exposed both as on-chain messages and as agetCCVAmountGET for off-chain tooling.Bindings & tests. Go (TON-SDK) message structs +
GetCCVAmountgetter + TLB registration + round-trip tests; generated TS wrappers; sharedTokenPool.ccvFees.behavior.tswired into all three concrete pools (LockRelease, BurnMint, LockReleaseLockbox) covering: empty-CCV reply + fwdPayload echo, post-fee math (enabled fee config),feesProvided=false(disabled config), revert on unsupported token/un-configured chain/disallowed finality, and the async-hooks path.Notes. This is the pool-side mechanism only. TON V2 OnRamp/OffRamp consumers (OnRamp→
GetCCVsAndFees, OffRamp→GetCCVs) intentionally land separately. Deviation from EVM: on-chain CCV queries revert for un-configured lanes/tokens (EVM's pure-view returns empty) so the async path fails loudly; off-chain tooling should probe via GET getters.