diff --git a/noir-projects/noir-contracts/contracts/private_token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/private_token_contract/src/main.nr index 789799211e3..cf918a9833b 100644 --- a/noir-projects/noir-contracts/contracts/private_token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/private_token_contract/src/main.nr @@ -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); diff --git a/noir-projects/noir-contracts/contracts/private_token_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/private_token_contract/src/types/token_note.nr index 7a45e9140b7..d2f0ddf2d38 100644 --- a/noir-projects/noir-contracts/contracts/private_token_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/private_token_contract/src/types/token_note.nr @@ -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 diff --git a/yarn-project/end-to-end/src/e2e_fees/private_refunds.test.ts b/yarn-project/end-to-end/src/e2e_fees/private_refunds.test.ts index 52076a9703c..963cb351ce0 100644 --- a/yarn-project/end-to-end/src/e2e_fees/private_refunds.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/private_refunds.test.ts @@ -187,6 +187,7 @@ class PrivateRefundPaymentMethod implements FeePaymentMethod { * @returns The function call to pay the fee. */ async getFunctionCalls(gasSettings: GasSettings): Promise { + // 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({