Skip to content

Commit

Permalink
Duplicated code in snippet (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas192 committed Apr 3, 2024
1 parent ac3ae4e commit 27ac736
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/ch04-03-standard-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,37 +626,6 @@ trait IAccount<T> {
fn supports_interface(self: @T, interface_id: felt252) -> bool;
}

#[starknet::contract]
mod Account {
// Constant identifier for the SRC-6 trait
const SRC6_TRAIT_ID: felt252 = 1270010605630597976495846281167968799381097569185364931397797212080166453709;

// Public interface implementation for the account contract
#[external(v0)]
impl AccountImpl of super::IAccount<ContractState> {
// ... Other function implementations
// Implementation of the interface support check
fn supports_interface(self: @ContractState, interface_id: felt252) -> bool {
// Compares the provided interface ID with the SRC-6 trait ID
interface_id == SRC6_TRAIT_ID
}
}
// ... Additional account contract code
}
// SRC-5 trait defining the introspection method
trait ISRC5 {
// Function to check interface support
fn supports_interface(interface_id: felt252) -> bool;
}

// Extension of the account contract's interface for SRC-5 compliance
#[starknet::interface]
trait IAccount<T> {
// ... Additional methods
// Method to validate interface support
fn supports_interface(self: @T, interface_id: felt252) -> bool;
}

#[starknet::contract]
mod Account {
// Constant identifier for the SRC-6 trait
Expand Down

0 comments on commit 27ac736

Please sign in to comment.