Skip to content

Commit

Permalink
disallow same chain token transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin committed Jan 5, 2024
1 parent 0b0c2fe commit 197fd35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connect/src/protocols/tokenTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ export class TokenTransfer<N extends Network = Network>
wh: Wormhole<N>,
transfer: TokenTransferDetails,
): Promise<void> {
if (transfer.from.chain === transfer.to.chain)
throw new Error("Cannot transfer to the same chain");

if (transfer.payload && transfer.automatic)
throw new Error("Payload with automatic delivery is not supported");

Expand Down

0 comments on commit 197fd35

Please sign in to comment.