TEAL: Store local state in OptIn transaction

Hi guys, I’m developing a TEAL Smart contract with the following functionality in mind:

  • On Optin call from an account, register the account address on a global table.
  • Set local account state key.

This is possible during the optin transaction? I guess you can modify the global state but Im not sure about local since Optin should be -if im correct- allocating local space and not more.

Thanks.

Welcome to Algorand!

Even in an opt-in transaction, the TEAL stateful contract can set local state, i.e., call app_local_put.

1 Like

Thank you, just an additional question, what is the meaning of the goal app create output:

arg_0 not allowed in current mode?

arg and arg_* are only used in stateless/signature mode.

Use txna ApplicationArgs 0 instead.

See Algorand Developer Docs and Algorand Developer Docs.

1 Like