Skip to content

Commit a38dcdb

Browse files
committed
Added deprecation for AccountContract trait.
1 parent 59656f8 commit a38dcdb

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

corelib/src/starknet.cairo

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ pub mod event;
9898
pub use event::Event;
9999

100100
pub mod account;
101+
#[feature("deprecated-starknet-account-trait")]
102+
#[deprecated(
103+
feature: "deprecated-starknet-account-trait",
104+
note: "This trait is deprecated in favor of the standardized Starknet Account Abstraction (AA)
105+
interface, formalized in SNIP-6. Users should migrate to defining a contract interface
106+
trait (e.g., #[starknet::interface] trait IAccount) that includes the mandatory SNIP-6
107+
entry points: `__validate__`, `__execute__`, `__validate_declare__`, and
108+
`__validate_deploy__`. The community-standard trait implementing this interface is
109+
typically named `ISRC6`. For canonical examples, consult the OpenZeppelin Contracts for
110+
Cairo repository.",
111+
since: "2.15.0",
112+
)]
101113
pub use account::AccountContract;
102114

103115
pub mod storage;

corelib/src/starknet/account.cairo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ pub struct Call {
3131
/// This is the network standard following SNIP6.
3232
/// It is not enforced by Starknet, but deviating from the standard interface may lead to
3333
/// incompatibility with standard tooling.
34+
#[deprecated(
35+
feature: "deprecated-starknet-account-trait",
36+
note: "This trait is deprecated in favor of the standardized Starknet Account Abstraction (AA)
37+
interface, formalized in SNIP-6. Users should migrate to defining a contract interface
38+
trait (e.g., #[starknet::interface] trait IAccount) that includes the mandatory SNIP-6
39+
entry points: `__validate__`, `__execute__`, `__validate_declare__`, and
40+
`__validate_deploy__`. The community-standard trait implementing this interface is
41+
typically named `ISRC6`. For canonical examples, consult the OpenZeppelin Contracts for
42+
Cairo repository.",
43+
since: "2.15.0",
44+
)]
3445
#[starknet::interface]
3546
pub trait AccountContract<TContractState> {
3647
/// An entry point that is called to check if the account is willing to pay for the declaration

crates/cairo-lang-starknet/cairo_level_tests/contracts/account.cairo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ mod account {
5050
self.validate_transaction()
5151
}
5252

53+
#[feature("deprecated-starknet-account-trait")]
5354
#[abi(embed_v0)]
5455
impl AccountContractImpl of starknet::account::AccountContract<ContractState> {
5556
fn __validate_declare__(self: @ContractState, class_hash: felt252) -> felt252 {

0 commit comments

Comments
 (0)