I am trying to do bulk NFT mint in a single tx by using multicall in ts-sdk v0.75.0. However, when I try to mint more than 10 NFTs in a single tx, I get this error:

TransferToAddressRevertError: The script reverted with reason TransferToAddressFailed
    0x3b24330bd1e1354ea0c14948d0e58334b9921c28a0394e26d2f26054e024c662: {"type":4,"val":"0xffffffffffff0001","pc":"0x56c0","is":"0x3830"}

I am following this NFT contract for this purpose.

Hello @fsociety.

You can understand more about this error and how to solve it here.

In summary, you need to add OutputVariables to the contract call:

await contract.functions
  .transfer_to_address(address, assetId, 100)
    variableOutputs: 1,

Can you provide a code snippet of the code that you are using?


This fixed the error. Thanks a lot!

1 Like

acc. to the linked doc: For instance, if a contract function calls a Sway transfer function 3 times, it will require 3 Output Variables present within the list of outputs in your transaction.

op is looking to bulk mint and transfer some NFTs (say, 10). Shouldn’t the variableOutputs be 10? Why does adding variableOutputs: 1 solve this issue despite >1 mints and transfers?


This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.