Test adapter support tokens - #792
Conversation
… vv/token-registry-bindings-and-deployment
…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>
… vv/test-adapter-enable-token-transfer
| // 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:"^"` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Nvm. I'm moving this to a follow up PR
|
|
||
| // 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') |
There was a problem hiding this comment.
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
|
|
||
| // TODO: add TokenAmounts support for TON token transfers | ||
| return router.CCIPSend{ | ||
| tokenAmounts := make(common.SnakedCell[router.TokenAmount], 0, len(components.TokenAmounts)) |
There was a problem hiding this comment.
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:
- AuthorizeRouterToWithdraw sends the tokens to the escrow account
- 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
… vv/test-adapter-enable-token-transfer
… vv/test-adapter-enable-token-transfer
No description provided.