v4-core icon indicating copy to clipboard operation
v4-core copied to clipboard

feat: add lock target

Open marktoda opened this issue 1 year ago • 2 comments

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

marktoda avatar Jul 06 '23 23:07 marktoda

[WIP] needs tests

marktoda avatar Jul 06 '23 23:07 marktoda

if we do this, future TODO is to tstore the actual msg.sender and pass it as a param to hook calls

marktoda avatar Jul 07 '23 03:07 marktoda

Seemingly pretty serious gas improvements:

simple swap: 203264 simple swap EOA initiated: 174949 simple swap native: 191605 simple swap EOA initiated native: 168498

marktoda avatar Nov 17 '23 23:11 marktoda

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

ewilz avatar Jan 31 '24 19:01 ewilz