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

feat: add is_valid_signature to corelib starknet::account::AccountContract trait #6713

Open
1 of 2 tasks
julio4 opened this issue Nov 21, 2024 · 0 comments
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@julio4
Copy link
Contributor

julio4 commented Nov 21, 2024

Feature Request

The standard account interface defined in SNIP6 states that all accounts MUST implement the SRC6 and SRC5 interfaces.

The corelib provides a standard account interface at starknet::account::AccountContract:

/// A trait for account contracts that support class declarations (only validate and execute are
/// mandatory for an account).
///
/// This trait assumes that the calldata for invoke transactions is `Array<Call>`.
/// This is the network standard following SNIP6.
/// It is not enforced by StarkNet, but deviating from the standard interface may lead to
/// incompatibility with standard tooling.
#[starknet::interface]
pub trait AccountContract<TContractState> {
    fn __validate_declare__(self: @TContractState, class_hash: felt252) -> felt252;
    fn __validate__(ref self: TContractState, calls: Array<Call>) -> felt252;
    fn __execute__(ref self: TContractState, calls: Array<Call>) -> Array<Span<felt252>>;
}

It declares both __execute__ and __validate__ from SRC6 with an extra __validate_declare__ entrypoint, but missing the is_valid_signature function.
SRC5 can be implemented separately, but is there a reason to not add is_valid_signature in this interface?
Why not define all starknet SRC interfaces in the starknet module of the corelib for accepted SNIP?

If the feature request is approved, would you be willing to submit a PR?

  • Yes
  • No
@julio4 julio4 added the enhancement New feature or request label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant