feat: Recursive fn calls to spend more notes.#1779
Merged
iAmMichaelConnor merged 13 commits intomasterfrom Aug 25, 2023
Merged
Conversation
yarn-project/acir-simulator/src/client/private_execution.test.ts
Outdated
Show resolved
Hide resolved
| //*********************************/ | ||
| amount: Field, | ||
| sender: Field, | ||
| sender: Field, // TODO: Should verify sender. |
Contributor
There was a problem hiding this comment.
What does this 'TODO' mean, sorry? Verify how?
Contributor
Author
There was a problem hiding this comment.
Cause this allows any account to be the "sender": if I know your decrypted notes I can spend them. I've changed everywhere else to use msg_sender as the note spender. But this is called by a another contract (swap). So will have to think about how to change the flow (or use tx_origin 😂).
yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/interface.nr
Show resolved
Hide resolved
Comment on lines
+33
to
+36
| // It won't compile if Set.insert() is in an if statement :( | ||
| // if amount as u120 > 0 { | ||
| // create_note(context, balance, recipient, &mut note); | ||
| // } |
Contributor
There was a problem hiding this comment.
Might it be possible to come up with a minimal example which demonstrates this issue, to provide to the Noir team?
Contributor
Author
There was a problem hiding this comment.
I tried it for quite a while but couldn't. Will try again when I get my current PRs merged!
yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr
Show resolved
Hide resolved
yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr
Show resolved
Hide resolved
yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr
Show resolved
Hide resolved
Contributor
|
All done with my review :) |
iAmMichaelConnor
approved these changes
Aug 25, 2023
PhilWindle
pushed a commit
that referenced
this pull request
Aug 30, 2023
🤖 I have created a new Aztec Packages release --- ## [0.1.0-alpha48](v0.1.0-alpha47...v0.1.0-alpha48) (2023-08-30) ### Features * Add ARM build for Mac + cleanup artifacts ([#1837](#1837)) ([270a4ae](270a4ae)) * broadcasting 'public key' and 'partial address' as L1 calldata ([#1801](#1801)) ([78d6444](78d6444)), closes [#1778](#1778) * Check sandbox version matches CLI's ([#1849](#1849)) ([7279730](7279730)) * **docs:** adding some nitpick suggestions before sandbox release ([#1859](#1859)) ([c1144f7](c1144f7)) * More reliable getTxReceipt api. ([#1793](#1793)) ([ad16b22](ad16b22)) * **noir:** use `#[aztec(private)]` and `#[aztec(public)` attributes ([#1735](#1735)) ([89756fa](89756fa)) * Recursive fn calls to spend more notes. ([#1779](#1779)) ([94053e4](94053e4)) * Simulate enqueued public functions and locate failing constraints on them ([#1853](#1853)) ([a065fd5](a065fd5)) * Update safe_math and move to libraries ([#1803](#1803)) ([b10656d](b10656d)) * Write debug-level log to local file in Sandbox ([#1846](#1846)) ([0317e93](0317e93)), closes [#1605](#1605) ### Bug Fixes * Conditionally compile base64 command for bb binary ([#1851](#1851)) ([be97185](be97185)) * default color to light mode ([#1847](#1847)) ([4fc8d39](4fc8d39)) * Disallow unregistered classes in JSON RPC interface and match by name ([#1820](#1820)) ([35b8170](35b8170)) * Set side effect counter on contract reads ([#1870](#1870)) ([1d8881e](1d8881e)), closes [#1588](#1588) * Truncate SRS size to the amount of points that we have downloaded ([#1862](#1862)) ([0a7058c](0a7058c)) ### Miscellaneous * add browser test to canary flow ([#1808](#1808)) ([7f4fa43](7f4fa43)) * **ci:** fix output name in release please workflow ([#1858](#1858)) ([857821f](857821f)) * CLI tests ([#1786](#1786)) ([2987065](2987065)), closes [#1450](#1450) * compile minimal WASM binary needed for blackbox functions ([#1824](#1824)) ([76a30b8](76a30b8)) * fixed linter errors for `ecc`, `numeric` and `common` modules ([#1714](#1714)) ([026273b](026273b)) * Refactor Cli interface to be more unix-like ([#1833](#1833)) ([28d722e](28d722e)) * sync bb master ([#1842](#1842)) ([2c1ff72](2c1ff72)) * sync bb master ([#1852](#1852)) ([f979878](f979878)) * sync bb master ([#1866](#1866)) ([e681a49](e681a49)) * typescript script names should be consistent ([#1843](#1843)) ([eff8fe7](eff8fe7)) * use 2^19 as `MAX_CIRCUIT_SIZE` for NodeJS CLI ([#1834](#1834)) ([c573282](c573282)) ### Documentation * Account contract tutorial ([#1772](#1772)) ([0faefba](0faefba)) * Wallet dev docs ([#1746](#1746)) ([9b4281d](9b4281d)), closes [#1744](#1744) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1422
Also fixed a bug where we allowed any sender to spend notes.
Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.