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/get-profile-by-anchor #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions src/core/registry.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub trait IRegistry<TContractState> {
fn add_members(ref self: TContractState, profile_Id: u256, members: Array<ContractAddress>);
fn update_profile_metadata(ref self: TContractState, profile_id: u256, metadata: Metadata);
fn get_profile_by_id(self: @TContractState, profile_id: u256) -> Registry::Profile;
fn get_profile_by_anchor(self: @TContractState, anchor: ContractAddress) -> Registry::Profile;
}
#[starknet::contract]
pub mod Registry {
Expand Down Expand Up @@ -152,6 +153,11 @@ pub mod Registry {
// Down below is the function that is to be implemented in the contract but in cairo.
// https://github.com/allo-protocol/allo-v2/blob/4dd0ea34a504a16ac90e80f49a5570b8be9b30e9/contracts/core/Registry.sol#L102

fn get_profile_by_anchor(self: @ContractState, anchor: ContractAddress) -> Profile {
let profile_id = self.anchor_to_profile_id.read(anchor);
return self.profiles_by_id.read(profile_id);
}

// Issue no. #13 Implement the functionality of createProfile
// Down below is the function that is to be implemented in the contract but in cairo.
// https://github.com/allo-protocol/allo-v2/blob/4dd0ea34a504a16ac90e80f49a5570b8be9b30e9/contracts/core/Registry.sol#L118C5-L125C18
Expand Down
Loading