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

Ensure Direct Calls on set_key #15

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

bh2smith
Copy link
Contributor

@bh2smith bh2smith commented Feb 8, 2024

As discussed in #13 (comment) we should be referring to predecessor account id here instead of signer account. I thought about it a bit more and it seemed as if using predecessor account id could also result in undesired behaviour. Instead I went with maximal security decision to ensure this method can only be called by account holder directly.

  1. Using SignerAccountId: could result in accountA signing a contract execution on accountB which internally makes a cross-contract call to set_key and thus overwriting accountA's key.

  2. Using PredecessorAccountId: Means that the same a user would not necessarily be able to use a contract to set their own key, since they are transacting through an intermediary contract with a different ID.

⚠️ I suppose the argument for using predecessor_account_id here is in case walletA has multiple signers and one of those signers would like to set the key for walletA, then signer_i would want to execute set_key via walletA contract. I guess I will have to change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant