Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Aug 16, 2024
1 parent 2b14696 commit 4d8633b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,19 +356,19 @@ contract Token {
);

storage.balances.add(from, change).emit(
encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ivpk_m, from_keys.ovpk_m, from)
encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ovpk_m, from_keys.ivpk_m, from)
);

storage.balances.add(to, amount).emit(
encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ivpk_m, to_keys.ivpk_m, to)
encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ovpk_m, to_keys.ivpk_m, to)
);

// We don't constrain encryption of the note log in `transfer` (unlike in `transfer_from`) because the transfer
// function is only designed to be used in situations where the event is not strictly necessary (e.g. payment to
// another person where the payment is considered to be successful when the other party successfully decrypts a
// note).
Transfer { from, to, amount: amount.to_field() }.emit(
encode_and_encrypt_event_with_keys_unconstrained(&mut context, from_keys.ivpk_m, to_keys.ivpk_m, to)
encode_and_encrypt_event_with_keys_unconstrained(&mut context, from_keys.ovpk_m, to_keys.ivpk_m, to)
);
}
// docs:end:transfer
Expand Down

0 comments on commit 4d8633b

Please sign in to comment.