Skip to content

Commit

Permalink
fix: check you own an id to set its data
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal committed Jan 3, 2024
1 parent 698debd commit 620ada2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/identity/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ mod Identity {
fn set_user_data(
ref self: ContractState, id: u128, field: felt252, data: felt252, domain: u32
) {
// todo: when volition comes, handle the domain
let caller = get_caller_address();
assert(caller == self.erc721._owner_of(id.into()), 'you don\'t own this id');
self.user_data.write((id, field), data);
self.emit(Event::UserDataUpdate(UserDataUpdate { id, field, _data: data }))
}
Expand Down

0 comments on commit 620ada2

Please sign in to comment.