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

Fixes bugs found on release #8

Merged
merged 1 commit into from
Mar 13, 2024
Merged
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
8 changes: 4 additions & 4 deletions src/identity/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ mod Identity {

fn get_main_id(self: @ContractState, user: ContractAddress) -> u128 {
let main_id = self.main_id_by_addr.read(user);
if self.erc721._owner_of(main_id.into()) == user {
if self.owner_from_id(main_id) == user {
main_id
} else {
// if you transfer your main_id to someone, it is no longer your main_id
Expand Down Expand Up @@ -255,7 +255,7 @@ mod Identity {

fn set_main_id(ref self: ContractState, id: u128) {
let caller = get_caller_address();
assert(caller == self.erc721._owner_of(id.into()), 'you don\'t own this id');
assert(caller == self.owner_from_id(id), 'you don\'t own this id');
self.main_id_by_addr.write(caller, id);
self.emit(Event::MainIdUpdate(MainIdUpdate { id, owner: caller }));
}
Expand All @@ -273,7 +273,7 @@ mod Identity {
ref self: ContractState, id: u128, field: felt252, data: felt252, domain: u32
) {
let caller = get_caller_address();
assert(caller == self.erc721._owner_of(id.into()), 'you don\'t own this id');
assert(caller == self.owner_from_id(id), 'you don\'t own this id');
self.user_data.write((id, field), data);
self.emit(Event::UserDataUpdate(UserDataUpdate { id, field, _data: data }))
}
Expand All @@ -282,7 +282,7 @@ mod Identity {
ref self: ContractState, id: u128, field: felt252, data: Span<felt252>, domain: u32
) {
let caller = get_caller_address();
assert(caller == self.erc721._owner_of(id.into()), 'you don\'t own this id');
assert(caller == self.owner_from_id(id), 'you don\'t own this id');
self.set(USER_DATA_ADDR, array![id.into(), field].span(), data, domain);
self
.emit(
Expand Down
Loading