Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: minor comments for private refunds/partial notes #7447

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading