Example Scenarios
Successful Transfer forwarding through chain B
Memo for simple forward
- The packet-forward-middleware integrated on Chain B.
- The packet data receiverfor theMsgTransferon Chain A is set to"pfm"or some other invalid bech32 string.*
- The packet memois included inMsgTransferby user on Chain A.
Error on Forwarding Hop, Refund to A
Forwarding with Retry and Timeout Logic
A -> B -> C full success
- AThis sends packet over underlying ICS-004 wrapper with memo as is.
- BThis receives packet and parses it into ICS-020 packet.
- BValidates- forwardpacket on this step, return- ACKerror if fails.
- BIf other middleware not yet called ICS-020, call it and ACK error on fail. Tokens minted or unescrowed here.
- BHandle denom. If denom prefix is from- B, remove it. If denom prefix is other chain - add- Bprefix.
- BTake fee, create new ICS-004 packet with timeout from forward for next step, and remaining inner- memo.
- BSend transfer to- Cwith parameters obtained from- memo. Tokens burnt or escrowed here.
- BStore tracking- in flight packetunder next- (channel, port, ICS-20 transfer sequence), do not- ACKpacket yet.
- CHandle ICS-020 packet as usual.
- BOn ICS-020 ACK from- Cfind- in flight packet, delete it and write- ACKfor original packet from- A.
- AHandle ICS-020- ACKas usual
A -> B -> C with C error ACK
- BOn ICS-020 ACK from- Cfind- in flight packet, delete it
- BBurns or escrows tokens.
- BAnd write error- ACKfor original packet from- A.
- AHandle ICS-020 timeout as usual
- Cwrites success- ACKfor packet from- B
C
A packet timeouts on B before C timeouts packet from B
- ACannot timeout because- in flight packethas proof on- Bof packet inclusion.
- Bwaits for ACK or timeout from- C.
- Btimeout from- Cbecomes fail- ACKon- Bfor- A
- Areceives success or fail- ACK, but not timeout
A assets hang until final hop timeouts or ACK.
Memo for Retry and Timeout Logic, with Nested Memo (2 forwards)
- The packet-forward-middleware integrated on Chain B and Chain C.
- The packet data receiverfor theMsgTransferon Chain A is set to"pfm"or some other invalid bech32 string.
- The forward metadata receiverfor the hop from Chain B to Chain C is set to"pfm"or some other invalid bech32 string.
- The packet memois included inMsgTransferby user on Chain A.
- A packet timeout of 10 minutes and 2 retries is set for both forwards.
next is the memo to pass for the next transfer hop. Per memo intended usage of a JSON string, it should be either JSON which will be Marshaled retaining key order, or an escaped JSON string which will be passed directly.
next as JSON