Skip to content

Commit

Permalink
WP
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Nov 11, 2024
1 parent 22d71aa commit dcbcd38
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions noir-projects/noir-contracts/contracts/token_contract/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -513,16 +513,9 @@ contract Token {
let note_randomness = unsafe { random() };
let note_setup_payload = UintNote::setup_payload().new(to, note_randomness, to_note_slot);

// We set the ovpk to (whose OVPK? issue below) ovpk and we encrypt the log.
// TODO(benesjan): I've stumbled upon an escrowing issue. Ideally we would set `from` to `msg_sender` here
// this typically doesn't work because this msg_sender is typically for example a token bridge contract that
// does not have keys registered and hence cannot receive an outgoing. We could allow passing a `from` argument
// to `prapare_transfer_to_private` but then it would allow the party to set arbitrary `from` and hence
// it could confuse the recipient of the outgoing (why am I receiving outgoing from this contract?). I am
// temporarily setting this to `to` to unblock myself.
// let from = context.msg_sender();
let from = to;
let from_ovpk = get_public_keys(from).ovpk_m;
// We get the keys and encrypt the log of the note
let from = context.msg_sender();
let from_ovpk = get_public_keys(context.msg_sender()).ovpk_m;
let setup_log = note_setup_payload.encrypt_log(context, from_ovpk, to, from);

// Using the x-coordinate as a hiding point slot is safe against someone else interfering with it because
Expand Down

0 comments on commit dcbcd38

Please sign in to comment.