Skip to content

Commit

Permalink
feat: load storage read component
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal committed Oct 31, 2023
1 parent f354e42 commit 09c8f5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
20 changes: 14 additions & 6 deletions src/naming/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -36,6 +37,7 @@ mod Naming {
DomainTransfer: DomainTransfer,
SubdomainsReset: SubdomainsReset,
SaleMetadata: SaleMetadata,
StorageReadEvent: storage_read_component::Event
}

#[derive(Drop, starknet::Event)]
Expand Down Expand Up @@ -115,6 +117,8 @@ mod Naming {
_domain_data: LegacyMap<felt252, DomainData>,
_hash_to_domain: LegacyMap<(felt252, usize), felt252>,
_address_to_domain: LegacyMap<(ContractAddress, usize), felt252>,
#[substorage(v0)]
storage_read: storage_read_component::Storage,
}

#[constructor]
Expand All @@ -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<ContractState>;

#[external(v0)]
impl NamingImpl of INaming<ContractState> {
Expand Down

0 comments on commit 09c8f5e

Please sign in to comment.