Replies: 3 comments 3 replies
-
While some items like
These are already handled client-side as we need them, esp. the nonce (async call) for the signature generation. No issue here. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Closing, this was implemented in #58. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While writing #53, I came up with the following way of framing the devilish problem that led @razgraf and @gavriliumircea to spend weeks debugging Permit2 signatures:
The core issue is that the
ProxyTarget
contract requires users to ensure that all of the following parameters are in synchrony:createParams.totalAmount
)Permit2Params
bytes
signatureIn hindsight, this seems to me like a bad design because it's easy to shoot yourself in the foot with it.
To cut the proverbial Gordian Knot, we could follow in Uniswap's footsteps and require the front-end client to pass the
PermitSingle
struct alongside the Permit2 signature:https://github.com/Uniswap/universal-router/blob/b01e71f8ea6458ce86cb94ad68b5d4d92d3a7382/contracts/base/Dispatcher.sol#L163-L170
This approach is more verbose; values like
nonce
andspender
would have to be handled by the front-end. However, this should be a worthy trade-off because the system would become more robust and resilient against human error.WDYT, @razgraf, @gavriliumircea?
Beta Was this translation helpful? Give feedback.
All reactions