Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Duplicated code in snippet #356

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading