Programmable transaction issues

Hello

When trying to execute a transaction defined through a programmable transaction block via the sui sdk it fails.

These are the steps to reproduce:

  • first we check if the user already has a kiosk, if not we create one for him (KioskTransaction.create())
  • then we call shareAndTransferCap and finalize the kiosk transaction.
  • then we call the smart contract function (txb.moveCall) with arguments objectID, transferPolicy, kiosTx.getKiosk(), kioskTx.getKioskCap()
  • then execute and sign transaction block

When executing this transaction it fails with the error message “CommandArgumentError { arg_idx: 2, kind: InvalidValueUsage } in command 3” Indicating that the kiosk argument is somehow wrong.

If we execute the function when already having a kiosk on the account it works. Only if no kiosk exists yet and we create it, the transaction fails, even though when printing the kiosk on the console they are the same.

Here is the transaction id of the failed transaction “H7zFzVvVuptDmSYdLmF5pjP5QBHJe1svMgNhp2NHpcoD”

Thanks you for your help!

2 Likes

Our workaround is currently to create the kiosk separately, then doing the smart contract call. This works, but within a programmable transaction, doing everything at once, we get an error. I tried to trace the error in programmable_transaction/context.rs and it indicates a borrowing issue. However, I don’t see why it should fail. Anyway we have a workaround, but if someone reads this, and knows why, a hint why it fails would be nice :slight_smile:

1 Like