Conversation
| require(initiator == address(0), AlreadyInitiated()); | ||
| initiator = msg.sender; |
There was a problem hiding this comment.
not resetting at the end of the function, because reading of the initiator variable should only happen if the msg.sender is the bundler. So we have the property "when initiator will be read, it will just have been set to the caller"
Although it prevents from calling this bundler functions multiple times in the same transaction. Note sure we need that, but it's cheap to add
| SharesPermit memory sharesPermit, | ||
| uint256 deadline | ||
| ) external { | ||
| require(initiator == address(0), AlreadyInitiated()); |
There was a problem hiding this comment.
This require makes it very easy to think about the initiator: you know it will stay the same for at least as long as the function call. It prevents issues such as:
- call a function, which set the initiator
- at the beginning of the function control flow is passed to an arbitrary address (think Midnight callback, that you normally don't need to inspect), which calls back the bundler and overwrites the
initiatorvariable - then it does an interaction with a vault v2, which will read the wrong
initiatorvalue
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0fc4814df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| require(initiator == address(0), AlreadyInitiated()); | ||
| initiator = msg.sender; |
There was a problem hiding this comment.
Sorry for the back and forth: actually I prefer when stuff that applies to all bundles is at the top. Can't we write it in one line in a way? Not worth an internal function anyway
No description provided.