Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Oct 29, 2024
1 parent 6009b77 commit 2c6f341
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ contract Token {
context: &mut PrivateContext,
storage: Storage<&mut PrivateContext>,
) -> Field {
let to_keys = get_public_keys(to);
let to_note_slot = storage.balances.at(to).set.storage_slot;

// We create a setup payload with unpopulated/zero `amount` for 'to'
Expand All @@ -525,8 +524,9 @@ contract Token {
let note_randomness = unsafe { random() };
let note_setup_payload = UintNote::setup_payload().new(to, note_randomness, to_note_slot);

// We encrypt the note log
let setup_log = note_setup_payload.encrypt_log(context, to_keys, to);
// We set the ovpk to the message sender's ovpk and we encrypt the log.
let from_ovpk = get_public_keys(context.msg_sender()).ovpk_m;
let setup_log = note_setup_payload.encrypt_log(context, from_ovpk, to);

// Using the x-coordinate as a hiding point slot is safe against someone else interfering with it because
// we have a guarantee that the public functions of the transaction are executed right after the private ones
Expand Down

0 comments on commit 2c6f341

Please sign in to comment.