Skip to content

Commit

Permalink
made changes to latest cairo version and updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
PoulavBhowmick03 committed Nov 27, 2024
1 parent 58ca354 commit 30e9ad8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name = "resolver"
version = "0.1.0"

[dependencies]
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" }
starknet = "2.6.3"
naming = { git = "https://github.com/starknet-id/naming.git", rev = "7fa861a7a6e56c96ba3b508c66d7587d2597385a" }
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", rev = "0697004db74502ce49900edef37331dd03531356" }
identity = { git = "https://github.com/starknet-id/identity.git", rev = "2185e542838c639be5cee47979e2462822000fd0" }
storage_read = { git = "https://github.com/starknet-id/storage_read_component.git", rev = "6440184cc078188d1efeab1283d1698738cde435" }

[[target.starknet-contract]]
# Enable Sierra codegen.
Expand Down
13 changes: 8 additions & 5 deletions src/resolver.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
mod Resolver {
use core::option::OptionTrait;
use core::traits::TryInto;
use core::array::SpanTrait;
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};
use openzeppelin::access::ownable::OwnableComponent;
use core::starknet::storage::{
StoragePointerReadAccess, StoragePointerWriteAccess,
Map, StoragePathEntry
};

component!(path: storage_read_component, storage: storage_read, event: StorageReadEvent);
component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
Expand All @@ -21,7 +24,7 @@ mod Resolver {
#[storage]
struct Storage {
public_key: felt252,
uri: LegacyMap<(felt252, felt252), felt252>,
uri: Map<(felt252, felt252), felt252>,
#[substorage(v0)]
storage_read: storage_read_component::Storage,
#[substorage(v0)]
Expand Down Expand Up @@ -51,7 +54,7 @@ mod Resolver {
self.public_key.write(_public_key);
}

#[external(v0)]
#[abi(embed_v0)]
impl ResolverImpl of IResolver<ContractState> {
fn resolve(
self: @ContractState, domain: Span<felt252>, field: felt252, hint: Span<felt252>
Expand Down Expand Up @@ -127,8 +130,8 @@ mod Resolver {

fn remove_uri(ref self: ContractState, index: felt252) {
self.ownable.assert_only_owner();
let uri_removed = self.get_uri_at_index(index).span();
self.emit(StarknetIDOffChainResolverUpdate { uri_added: array![].span(), uri_removed });
let uri_removed = self.get_uri_at_index(index);
self.emit(StarknetIDOffChainResolverUpdate { uri_added: array![].span(), uri_removed: uri_removed.span() });
self.uri.write((index, 0), 'this call was removed');
}
}
Expand Down

0 comments on commit 30e9ad8

Please sign in to comment.