File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -435,12 +435,15 @@ func (i IBCHandler) IBCReceivePacketCallback(
435
435
436
436
// For a more in-depth explanation of the logic here, see the transfer module implementation:
437
437
// https://github.com/cosmos/ibc-go/blob/a6217ab02a4d57c52a938eeaff8aeb383e523d12/modules/apps/transfer/keeper/relay.go#L147-L175
438
+ // and the sequence diagram in the ICS20 spec:
439
+ // https://github.com/cosmos/ibc/blob/9be3630/spec/app/ics-020-fungible-token-transfer/README.md#data-structures
438
440
if transferData .Token .Denom .HasPrefix (packet .GetSourcePort (), packet .GetSourceChannel ()) {
439
- // this is a denom coming from this chain, being sent back again
440
- // remove prefix
441
+ // This is a denom coming from this chain, being sent back again, so we remove the prefix.
442
+ // See for example the "A -> C" step in the sequence diagram.
441
443
transferData .Token .Denom .Trace = transferData .Token .Denom .Trace [1 :]
442
444
} else {
443
445
// prefixing happens on the receiving end, so we need to do that here
446
+ // See for example the "C -> A" step in the sequence diagram.
444
447
trace := []transfertypes.Hop {transfertypes .NewHop (packet .GetDestPort (), packet .GetDestChannel ())}
445
448
transferData .Token .Denom .Trace = append (trace , transferData .Token .Denom .Trace ... )
446
449
}
You can’t perform that action at this time.
0 commit comments