Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load storage read component #12

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
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
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