Skip to content

Test adapter support tokens - #792

Open
vicentevieytes wants to merge 76 commits into
mainfrom
vv/test-adapter-enable-token-transfer
Open

Test adapter support tokens#792
vicentevieytes wants to merge 76 commits into
mainfrom
vv/test-adapter-enable-token-transfer

Conversation

@vicentevieytes

Copy link
Copy Markdown
Collaborator

No description provided.

vicentevieytes and others added 30 commits June 18, 2026 19:32
…ddress

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix typo

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@vicentevieytes vicentevieytes changed the title tokenRegistry bindings and deployment Test adapter support tokens Jul 14, 2026
Base automatically changed from vv/token-adapter to main July 16, 2026 17:36
// Source token amounts plus the destination token address, grouped into a single
// ref to stay within the 4-ref-per-cell limit (matches TVM2AnyTokenTransfer in
// contracts/ccip/onramp/types.tolk).
TokenTransfer TVM2AnyTokenTransfer `tlb:"^"`

@vicentevieytes vicentevieytes Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from TokenAmounts to TVM2AnyTokenTransfer to have the DestTokenAddress in the event, which is needed by ConvertCCIPMessageSent (pkg/ccip/chainaccessor/event.go).

This is aligned with how EVM does this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm. I'm moving this to a follow up PR

Comment thread contracts/contracts/ccip/test/tokenPool/messages.tolk Outdated

// Native TON attached to the transfer notification, used to pay fees + execution costs.
const FORWARD_TON_AMOUNT = toNano('1')
const FORWARD_TON_AMOUNT = toNano('10')

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a big overhead here to not get InsufficientFee or -14 errors. When the message flow is completely defined we can benchmark and estimate from scratch

Comment thread deployment/ccip/1_6_0/sequences/tokens.go Outdated
Comment thread deployment/ccip/1_6_0/sequences/tokens.go Outdated

// TODO: add TokenAmounts support for TON token transfers
return router.CCIPSend{
tokenAmounts := make(common.SnakedCell[router.TokenAmount], 0, len(components.TokenAmounts))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes the BuildMessage function return two different types depending on wether this is arbitrary messaging (returns CCIPSend) or if it's a TokenTransfer (returns a TokenTransferMessage struct with the CCIPSend payload as forwardNotification)

Then SendMessage changes it's behavior depending on the type that's passed to it, and it either sends the message to the router or to it's wallet.

This would be simpler with the escrow account entrypoint:

  1. AuthorizeRouterToWithdraw sends the tokens to the escrow account
  2. SendMessage sends CCIPSend to the router, the router will later withdraw the messages when it needs them.

A quick follow up to this should be to change to this model IMO

@vicentevieytes
vicentevieytes marked this pull request as ready for review August 5, 2026 19:30
@vicentevieytes
vicentevieytes requested a review from a team as a code owner August 5, 2026 19:30
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