diff --git a/corelib/src/starknet.cairo b/corelib/src/starknet.cairo index b5ed9310796..f34698451bf 100644 --- a/corelib/src/starknet.cairo +++ b/corelib/src/starknet.cairo @@ -98,6 +98,18 @@ pub mod event; pub use event::Event; pub mod account; +#[feature("deprecated-starknet-account-trait")] +#[deprecated( + feature: "deprecated-starknet-account-trait", + note: "This trait is deprecated in favor of the standardized Starknet Account Abstraction (AA) + interface, formalized in SNIP-6. Users should migrate to defining a contract interface + trait (e.g., #[starknet::interface] trait IAccount) that includes the mandatory SNIP-6 + entry points: `__validate__`, `__execute__`, `__validate_declare__`, and + `__validate_deploy__`. The community-standard trait implementing this interface is + typically named `ISRC6`. For canonical examples, consult the OpenZeppelin Contracts for + Cairo repository.", + since: "2.15.0", +)] pub use account::AccountContract; pub mod storage; diff --git a/corelib/src/starknet/account.cairo b/corelib/src/starknet/account.cairo index c984957df1b..50b54f3cb74 100644 --- a/corelib/src/starknet/account.cairo +++ b/corelib/src/starknet/account.cairo @@ -31,6 +31,17 @@ pub struct 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. +#[deprecated( + feature: "deprecated-starknet-account-trait", + note: "This trait is deprecated in favor of the standardized Starknet Account Abstraction (AA) + interface, formalized in SNIP-6. Users should migrate to defining a contract interface + trait (e.g., #[starknet::interface] trait IAccount) that includes the mandatory SNIP-6 + entry points: `__validate__`, `__execute__`, `__validate_declare__`, and + `__validate_deploy__`. The community-standard trait implementing this interface is + typically named `ISRC6`. For canonical examples, consult the OpenZeppelin Contracts for + Cairo repository.", + since: "2.15.0", +)] #[starknet::interface] pub trait AccountContract { /// An entry point that is called to check if the account is willing to pay for the declaration diff --git a/crates/cairo-lang-starknet/cairo_level_tests/contracts/account.cairo b/crates/cairo-lang-starknet/cairo_level_tests/contracts/account.cairo index 260d290440f..8883470a798 100644 --- a/crates/cairo-lang-starknet/cairo_level_tests/contracts/account.cairo +++ b/crates/cairo-lang-starknet/cairo_level_tests/contracts/account.cairo @@ -50,6 +50,7 @@ mod account { self.validate_transaction() } + #[feature("deprecated-starknet-account-trait")] #[abi(embed_v0)] impl AccountContractImpl of starknet::account::AccountContract { fn __validate_declare__(self: @ContractState, class_hash: felt252) -> felt252 {