v4-core
v4-core copied to clipboard
feat: add lock target
This commit adds a lockTarget parameter to lock where any caller can specify a locker to handle the routing logic on their behalf. This can allow safe storage via tstore and passing usage of the lock initiator to hook callbacks
closes #298
Related Issue
Which issue does this pull request resolve?
Description of changes
[WIP] needs tests
if we do this, future TODO is to tstore the actual msg.sender and pass it as a param to hook calls
Seemingly pretty serious gas improvements:
simple swap: 203264 simple swap EOA initiated: 174949 simple swap native: 191605 simple swap EOA initiated native: 168498
are gas savings the only reason for this PR? bc I imagine we'll inevitably go through the router anyway since we tend to aggregate across versions, so I imagine this will actually be a gas increase overall for our app? UNless we want to special case v4-only swaps and save for that subset of swaps... But for aggregators etc, gas goes up