-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: remove ActionData to allow arbitrary calls and test cleanups #9
Conversation
@@ -63,30 +69,23 @@ contract RelayOrderReactorIntegrationTest is GasSnapshot, Test, Interop, PermitS | |||
reactor = RelayOrderReactor(RELAY_ORDER_REACTOR); | |||
permitExecutor = new PermitExecutor(address(filler), reactor, address(filler)); | |||
|
|||
// Swapper max approves permit post | |||
// Swapper max approves permit post for all input tokens | |||
vm.startPrank(swapper); | |||
DAI.approve(address(PERMIT2), type(uint256).max); | |||
USDC.approve(address(PERMIT2), type(uint256).max); | |||
PERMIT2.approve(address(DAI), address(reactor), type(uint160).max, type(uint48).max); | |||
PERMIT2.approve(address(USDC), address(reactor), type(uint160).max, type(uint48).max); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the users are approving this router on permit2, can't they then hack each other?
- Alice does
PERMIT2.approve(dai, reactor, maxAmount, maxTimestamp)
- Bob calls reactor with an action: target=permit2, call="transfer alice's tokens to bob"
- Permit2 has approval to let the reactor access Alice's tokens, so it accepts the call and gives alice's tokens to bob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to add a test to check if this is possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha totally, I think we don't need to approves on Permit2 because we do signature transfer so I should remove these and see if the tests pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya we don't need these approves. I think in this design, you definitely cannot be approving this reactor
No description provided.