Hello to Algorand community!
I’m looking into “Contract-Accounts” to be able to program some spending logic in an account. This account was previously a normal Algorand account that opted-in to some app, owned by , let’s say ADMIN private key.
Now I was able to create a Contract-Account using e.g:
goal clerk compile pool-gate.teal
That yields an address, let’s call it ACCOUNT1. First question is: who is the owner of this account at this point? I assume that since it’s not an address derived from a PK, it has no related “owner”.
Having that in mind I would like to -as in the no-contract account- optin to an app from this account.
My assumption is that this works:
# Create an optin-TX goal app optin --app-id $APPID -f $ACCOUNT1 --app-arg "int:100" -o pool-optin.txn # Sign this tx with program logic goal clerk sign --argb64 "$(echo $ARG1 | base64)" -i pool-optin.txn -p pool-gate.teal -o pool-optin.stxn
At this point I guess that I can do
goal clerk rawsend to send this transaction. But how I can enforce that the optin process is done by some owner account?
In case of standard accounts, you could not optin without signing with the proper key. I understand that a .teal program replaces that mechanism.
Maybe this is easy but I’m a little dizzy now.