cairo-contracts
cairo-contracts copied to clipboard
Make the Account setPublicKey function a two-steps process
https://github.com/OpenZeppelin/cairo-contracts/blob/b764660da224ee757b831ea62bf7a4c63ee898fb/src/openzeppelin/account/presets/Account.cairo#L47-L53
This method can make the contract unusable if a wrong public key is set by mistake. Maybe it would be good to add a two steps process allowing to claim the new public key before removing the old one? (Similar to the two-step ownership transfer process in Solidity contracts).
Also applies for setEthAddress in EthAccount.cairo:
https://github.com/OpenZeppelin/cairo-contracts/blob/b764660da224ee757b831ea62bf7a4c63ee898fb/src/openzeppelin/account/presets/EthAccount.cairo#L45-L51
What about an optimization: make it a single tx that takes the incoming pubkey's new signature to validate the process.
Apparently I suggested that already 😅: #818
@martriay may i work on this issue?
Same as https://github.com/OpenZeppelin/cairo-contracts/issues/21#issuecomment-1919538690, let's focus on the ongoing ones first.
Closing in favor of #818