Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Account setPublicKey function a two-steps process #469

Closed
ericnordelo opened this issue Sep 13, 2022 · 5 comments
Closed

Make the Account setPublicKey function a two-steps process #469

ericnordelo opened this issue Sep 13, 2022 · 5 comments
Labels
Account contract enhancement New feature or request

Comments

@ericnordelo
Copy link
Member

@external
func setPublicKey{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(
newPublicKey: felt
) {
Account.set_public_key(newPublicKey);
return ();
}

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:

@external
func setEthAddress{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(
newEthAddress: felt
) {
Account.set_public_key(newEthAddress);
return ();
}

@ericnordelo ericnordelo added enhancement New feature or request Account contract labels Sep 13, 2022
@martriay martriay moved this to 📋 Backlog in Cairo team Sep 23, 2022
@martriay martriay moved this to 📋 Backlog in Contracts for Cairo Nov 5, 2023
@martriay
Copy link
Contributor

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

@martriay martriay added this to the later milestone Dec 10, 2023
@martriay
Copy link
Contributor

Apparently I suggested that already 😅: #818

@martriay martriay modified the milestones: later, after Jan 26, 2024
@TAdev0
Copy link
Contributor

TAdev0 commented Jan 31, 2024

@martriay may i work on this issue?

@martriay
Copy link
Contributor

Same as #21 (comment), let's focus on the ongoing ones first.

@martriay martriay modified the milestones: after, next Feb 18, 2024
@martriay martriay modified the milestones: next, current Mar 4, 2024
@martriay martriay moved this from 📋 Backlog to 👀 In review in Contracts for Cairo Mar 4, 2024
@martriay martriay self-assigned this Mar 4, 2024
@martriay martriay removed their assignment Mar 21, 2024
@martriay martriay modified the milestones: 0. current, 2. after Mar 21, 2024
@andrew-fleming andrew-fleming removed this from the 2. next milestone Apr 30, 2024
@andrew-fleming andrew-fleming added this to the 1. current milestone Apr 30, 2024
@ericnordelo
Copy link
Member Author

Closing in favor of #818

@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Resolved in Contracts for Cairo May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account contract enhancement New feature or request
Projects
Status: ✅ Resolved
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

4 participants