From 681ef1f98a5ea4291ae6003e94b6274e58fd0880 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 19 Sep 2023 10:06:44 -0400 Subject: [PATCH] add isrc5 to example --- docs/modules/ROOT/pages/erc721.adoc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/erc721.adoc b/docs/modules/ROOT/pages/erc721.adoc index e3806e0ae..117392649 100644 --- a/docs/modules/ROOT/pages/erc721.adoc +++ b/docs/modules/ROOT/pages/erc721.adoc @@ -90,6 +90,7 @@ Here’s what that looks like: mod MyNFT { use starknet::ContractAddress; use openzeppelin::token::erc721::ERC721; + use openzeppelin::introspection::interface::ISRC5; #[storage] struct Storage {} @@ -113,9 +114,18 @@ mod MyNFT { ERC721::InternalImpl::_set_token_uri(ref unsafe_state, token_id, token_uri); } - // Implement the standard IERC721 interface + /// Implement the ISRC5 interface. + #[external(v0)] + impl SRC5Impl of ISRC5 { + fn supports_interface(self: @ContractState, interface_id: felt252) -> bool { + let unsafe_state = ERC721::unsafe_new_contract_state(); + ERC721::SRC5Impl::supports_interface(@unsafe_state, interface_id) + } + } + + /// Implement the standard IERC721 interface. #[external(v0)] - impl MyTokenImpl of ERC721ABI { + impl MyTokenImpl of IERC721 { fn balance_of(self: @ContractState, account: ContractAddress) -> u256 { let unsafe_state = ERC721::unsafe_new_contract_state(); ERC721::ERC721Impl::balance_of(@unsafe_state, account) @@ -124,7 +134,7 @@ mod MyNFT { (...) } - // Implement the IERC721Metadata interface + /// Implement the IERC721Metadata interface. #[external(v0)] impl MyTokenMetadataImpl of IERC721Metadata { fn name(self: @ContractState) -> felt252 {