wormhole-foundation / wormhole-explorer

We could have named this super-parakeet. Tweet tweet.
Other
30 stars 27 forks source link

Add support for unknown payload #691

Open gipsh opened 1 year ago

gipsh commented 1 year ago

There are vaa emitted by this contract 000000000000000000000000ba7bac71a8ee550d89b827fe6d67bc3dca07b104 in some evm chains like bsc, optimism, eth, and others.

They seem to be transfers but we dont know how to decode it.

This story is for the research on how to decode this vaas and to implement it on the payload parser.

Look here for more info: https://docs.magpiefi.xyz/magpie-protocol/

some examples here:

4/000000000000000000000000ba7bac71a8ee550d89b827fe6d67bc3dca07b104/1612

23/000000000000000000000000ba7bac71a8ee550d89b827fe6d67bc3dca07b104/3207

The payload always look like this:

0003000000000000000000000000ba7bac71a8ee550d89b827fe6d67bc3dca07b104000000000000065100010002000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000005cd15af072b3a0e5f6617f4650baf434743f83ba000000000000000000000000ba7bac71a8ee550d89b827fe6d67bc3dca07b1040000000000000000000000000000000000000000000000000000000006586c54000000000000000000000000000000000000000000000000000000000000c9490000000000000000

The first 4 bytes look like a destionation or origin chain id.

gipsh commented 1 year ago

Magpie sent me some data:


first 42 bytes are part of TransferKey:
2 bytes: networkId
32 bytes: senderAddress
8 bytes: our swapSequence

remaining bytes are part of Transaction data:
1 byte: dataTransferType
1 byte: bridgeType
2 bytes: recipientNetworkId (its our networkId not blockchain Id)
32 bytes: fromAssetAddress
32 bytes: toAssetAddress
32 bytes: to (recipient user)
32 bytes: recipientAggregatorAddress
32 bytes: amountOutMin
32 bytes: swapOutGasFee
gipsh commented 12 months ago

Network ids of magpie: ethereum: 1 polygon: 2 bsc: 3 avalanche: 4 arbitrum: 5 optimism: 6