Skip to content

Commit

Permalink
feat: add storage read component
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Mar 27, 2024
1 parent 93baac9 commit fb60b15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 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 @@ starknet = "2.3.1"
naming = { git = "https://github.com/starknet-id/naming.git", rev = "6e45f7fc2bc9e8e9d874a1d2c2d46e3226a96f6d" }
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", rev = "f3e2a5f0547a429c716f32471b06df729cbdfb9f" }
identity = { git = "https://github.com/starknet-id/identity.git", rev = "eb37846330b78e1410cf5e3e17a5dcca5652f921" }
storage_read = { git = "https://github.com/starknet-id/storage_read_component.git", rev = "c6c69e15d34abfc39ac51dc21b96724e2e19ff31" }

[[target.starknet-contract]]
# Enable Sierra codegen.
Expand Down
16 changes: 16 additions & 0 deletions src/resolver.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@ mod Resolver {
use starknet::{ContractAddress, get_block_timestamp};
use ecdsa::check_ecdsa_signature;
use resolver::interface::resolver::{IResolver, IResolverDispatcher, IResolverDispatcherTrait};
use storage_read::{main::storage_read_component, interface::IStorageRead};

component!(path: storage_read_component, storage: storage_read, event: StorageReadEvent);

#[abi(embed_v0)]
impl StorageReadImpl = storage_read_component::StorageRead<ContractState>;

#[storage]
struct Storage {
public_key: felt252,
uri: LegacyMap<felt252, felt252>,
#[substorage(v0)]
storage_read: storage_read_component::Storage,
}

#[event]
#[derive(Drop, starknet::Event)]
enum Event {
#[flat]
StorageReadEvent: storage_read_component::Event,
}


#[constructor]
fn constructor(ref self: ContractState, _public_key: felt252, uri: Span<felt252>) {
self.public_key.write(_public_key);
Expand Down

0 comments on commit fb60b15

Please sign in to comment.