diff --git a/Scarb.toml b/Scarb.toml index 42ac34c..afafa0b 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -7,6 +7,7 @@ version = "0.1.0" [dependencies] starknet = "2.3.0-rc0" openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.8.0-beta.0" } +storage_read = { git = "https://github.com/starknet-id/storage_read_component", branch = "master" } identity = { git = "https://github.com/starknet-id/identity.git", branch = "master" } [[target.starknet-contract]] diff --git a/src/naming/main.cairo b/src/naming/main.cairo index c1f1545..ccc8a15 100644 --- a/src/naming/main.cairo +++ b/src/naming/main.cairo @@ -13,18 +13,19 @@ mod Naming { use naming::{ naming::{asserts::AssertionsTrait, internal::InternalTrait, utils::UtilsTrait}, interface::{ - naming::{INaming, INamingDispatcher, INamingDispatcherTrait}, - resolver::{IResolver, IResolverDispatcher, IResolverDispatcherTrait}, - pricing::{IPricing, IPricingDispatcher, IPricingDispatcherTrait}, - referral::{IReferral, IReferralDispatcher, IReferralDispatcherTrait}, - }}; + naming::{INaming, INamingDispatcher, INamingDispatcherTrait}, + resolver::{IResolver, IResolverDispatcher, IResolverDispatcherTrait}, + pricing::{IPricing, IPricingDispatcher, IPricingDispatcherTrait}, + referral::{IReferral, IReferralDispatcher, IReferralDispatcherTrait}, + } + }; use clone::Clone; use array::ArrayTCloneImpl; use identity::interface::identity::{IIdentity, IIdentityDispatcher, IIdentityDispatcherTrait}; use openzeppelin::token::erc20::interface::{ IERC20Camel, IERC20CamelDispatcher, IERC20CamelDispatcherTrait }; - use debug::PrintTrait; + use storage_read::{main::storage_read_component, interface::IStorageRead}; #[event] #[derive(Drop, starknet::Event)] @@ -36,6 +37,7 @@ mod Naming { DomainTransfer: DomainTransfer, SubdomainsReset: SubdomainsReset, SaleMetadata: SaleMetadata, + StorageReadEvent: storage_read_component::Event } #[derive(Drop, starknet::Event)] @@ -115,6 +117,8 @@ mod Naming { _domain_data: LegacyMap, _hash_to_domain: LegacyMap<(felt252, usize), felt252>, _address_to_domain: LegacyMap<(ContractAddress, usize), felt252>, + #[substorage(v0)] + storage_read: storage_read_component::Storage, } #[constructor] @@ -131,6 +135,10 @@ mod Naming { self._admin_address.write(admin); } + component!(path: storage_read_component, storage: storage_read, event: StorageReadEvent); + + #[abi(embed_v0)] + impl StorageReadComponent = storage_read_component::StorageRead; #[external(v0)] impl NamingImpl of INaming {