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

made changes to latest cairo version and updated dependencies #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not building because here you didn't import the same version of the identity package as the one inside the naming package. It should be 5ae7fafdd20abf4b1e789b83af5db7e23ad39a7c

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