cairo-contracts icon indicating copy to clipboard operation
cairo-contracts copied to clipboard

Make the Account setPublicKey function a two-steps process

Open ericnordelo opened this issue 2 years ago • 4 comments

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

ericnordelo avatar Sep 13 '22 11:09 ericnordelo

What about an optimization: make it a single tx that takes the incoming pubkey's new signature to validate the process.

martriay avatar Dec 10 '23 18:12 martriay

Apparently I suggested that already 😅: #818

martriay avatar Dec 10 '23 18:12 martriay

@martriay may i work on this issue?

TAdev0 avatar Jan 31 '24 10:01 TAdev0

Same as https://github.com/OpenZeppelin/cairo-contracts/issues/21#issuecomment-1919538690, let's focus on the ongoing ones first.

martriay avatar Jan 31 '24 17:01 martriay

Closing in favor of #818

ericnordelo avatar May 14 '24 11:05 ericnordelo