This forum is a read-only archive. Posting, replying and signing in are disabled.

Logic eval error: invalid ApplicationArgs index 2 but I don't have 3 args

aleve99

Hi sorry, again I, I have this error, calling the application like this:
ApplicationNoOpTxn(address, params, app_id, foreign_assets=[asa_id], app_args=[intToBytes(asa_id),bytes("put","utf-8")]
In the application I have no reference to indexes over the 1 for the application_args. I don’t really know what’s going on. Can anyone help me?

✔ Solved by cusma in post #4
aleve99

OK yes the error seems that, but I have no references to index 2… I will try to use the debugger, i see is in go, it exists also a python implementation included with py-algorand-sdk?

cusma

The tealdebugger is just a tool you can use to verify a given dry-runned transaction against Smart Contracts’ logic, step by step. It doesn’t matter if the tool has been written in Go, this is just due to the fact that the Algorand’s node is written in Go. You can actually use Python SDK to create and sign the Application Call transactions you want to test against your PyTeal logic.

If your stack is based on Python, my personal advise is:

  1. Run the sandbox in dev mode, since this reduces debugging time
  2. Deploy your PyTeal smart contract on the sandbox and get the AppID
  3. Create a set of ApplicationCall transactions with py-algorand-sdk associated with unit tests using PyTest
  4. If a given unit test ApplicationCall fails, than write the failed unit test transaction to file
  5. $ ./sandbox copyTo unit_test_txn.signed
  6. $ ./sandbox goal clerk dryrun -t unit_test_txn.signed --dryrun-dump -o unit_test.json
  7. $ ./sandbox tealdbg debug --listen 0.0.0.0 -d unit_test.json