airgap-wallet icon indicating copy to clipboard operation
airgap-wallet copied to clipboard

Broken FA2 transfer transaction

Open PureSpider opened this issue 3 years ago • 9 comments

I'm trying to facilitate a standard FA2 transfer operation. However, whenever the transaction contains more than two token transfers at once, the app breaks completely. This is the payload I'm trying to send:

[
   {
      "from_":"tz1PqooZUtCQqP539PmMzUWHtaUX6EQtFY5S",
      "txs":[
         {
            "to_":"tz2MRhfAKUyNZDKH8XBzmXyCwd2h5ySbgZJJ",
            "token_id":"53220",
            "amount":"1"
         },
         {
            "to_":"tz1fhd4k1jSJRRcNVbkMwVzkKEhX3kzApsfk",
            "token_id":"53220",
            "amount":"1"
         },
         {
            "to_":"tz1aVgxdSRcHZZK9BSmEPHjMA6eM7dsiboN5",
            "token_id":"53220",
            "amount":"1"
         }
      ]
   }
]

And this is what the app does after trying to fetch the confirmation details: image

PureSpider avatar May 02 '21 11:05 PureSpider

Thanks for the report. I'll look into this as soon as possible.

Are you using any website / public snippet to do this? That would help me reproduce it more quickly.

AndreasGassmann avatar May 02 '21 11:05 AndreasGassmann

It's a tool I'm building that facilitates mass distribution of FA2 NFTs. I can provide a sample payload with about 50 transfers, if that would help? I'm using taquitos with the beacon-wallet to build the transaction.

PureSpider avatar May 02 '21 11:05 PureSpider

Unless it's an interactive website I don't think it will be of much help, because I actually need to own the NFTs to get past the "run_operation" simulation. I'll try to reproduce it on my end and let you know if I need any help. Thanks!

AndreasGassmann avatar May 02 '21 11:05 AndreasGassmann

I don't own the NFTs either - it breaks at the confirmation step, so the transaction doesn't even get on the blockchain.

PureSpider avatar May 02 '21 11:05 PureSpider

You can reproduce it like this:

  • Go to https://better-call.dev/mainnet/KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton/interact?entrypoint=transfer
  • Setup a transaction in this fashion (data from the initial JSON, even though the actual token IDs don't matter): image
  • Select "Execute" and then "Wallet", and connect your airgap wallet

At the following transaction confirmation step, the app breaks.

PureSpider avatar May 02 '21 11:05 PureSpider

I'll try that as soon as I'm back on my computer. If you try the same thing with Spire, what happens?

AndreasGassmann avatar May 02 '21 12:05 AndreasGassmann

Same error when using my airgap wallet through spire.

PureSpider avatar May 02 '21 12:05 PureSpider

As suspected, the operation fails because of a contract error.

The latest AirGap Wallet version seems to have a bug that prevents the contract error from being displayed properly. Instead, it displays this generic message.

If you try it with a local mnemonic in Spire, you will see the correct error message.

We will fix the UI bug in the next release, but I'm quite confident that the valid transaction would work with AirGap. (Valid meaning that you actually own the FA2 tokens).

AndreasGassmann avatar May 03 '21 16:05 AndreasGassmann

How come that when I try the transaction with only the first two elements (of which I own neither token), the confirmation shows fine?

PureSpider avatar May 04 '21 18:05 PureSpider