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

Rekeying to smart contracts

javier0rosas

If I rekey an account to a smart contract, are checks like the ones below necessary?

Assert( Gtxn[1].close_remainder_to() == Global.zero_address()      ),
Assert( Gtxn[1].rekey_to() == Global.zero_address()                        ),

In theory, the smart contract has full authority over the accounts that have been rekeyed to it and no other account can rekey or close the account.

Is this correct?

✔ Solved by fabrice in post #2
fabrice

It depends on the use case.
What is Gtxn[1] in this case?

But when you rekey an account A to a logicsig/smart signature contract account, then if the logicsig allows rekeying itself, then anyone can rekey A to the account of their choice and take ownership of A.
This is why in general you should always check that no rekeying occurs in smart signatures.