Skip to content

Commit

Permalink
docs: minor comments for private refunds/partial notes (#7447)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kothari authored Jul 12, 2024
1 parent f898a0e commit 9bcbb6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ contract PrivateToken {
#[aztec(internal)]
fn complete_refund(fee_payer_point: Point, user_point: Point) {
// 1. We get the final note content hashes by calling the `complete_refund` on the note.
// We use 1:1 exchange rate between fee juice and token. So using `tx_fee` is enough
let tx_fee = context.transaction_fee();
let (fee_payer_note_content_hash, user_note_content_hash) = TokenNote::complete_refund(fee_payer_point, user_point, tx_fee);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl OwnedNote for TokenNote {
* way to deduce what s is. This is the discrete log problem.
*
* However we can still perform addition/subtraction on points! That is why we generate those two points, which are:
* incomplete_fee_payer_point := G_npk * fee_payer_npk + G_amt * fee_payer_randomness
* incomplete_fee_payer_point := G_npk * fee_payer_npk + G_rnd * fee_payer_randomness
* incomplete_user_point := G_npk * user_npk + G_amt * funded_amount + G_rnd * user_randomness
*
* where `funded_amount` is the total amount in tokens that the sponsored user initially supplied, from which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class PrivateRefundPaymentMethod implements FeePaymentMethod {
* @returns The function call to pay the fee.
*/
async getFunctionCalls(gasSettings: GasSettings): Promise<FunctionCall[]> {
// we assume 1:1 exchange rate between fee juice and token. But in reality you would need to convert feeLimit (maxFee) to be in token denomination
const maxFee = gasSettings.getFeeLimit();

await this.wallet.createAuthWit({
Expand Down

0 comments on commit 9bcbb6c

Please sign in to comment.