tokenlon-contracts
tokenlon-contracts copied to clipboard
feature: decouple strategyData from GenericSwapData
strategyData is time-sensitive, and including it in the GenericSwapData struct would make the entire order time-restricted. By decoupling strategyData, the order becomes more flexible, ensuring that the user's intent to exchange tokens remains unchanged while avoiding the need to repeatedly sign the same exchange intent with different strategyData.
Changes to gas cost
Generated at commit: b12306b63c417bb917dec3296ff89699adf4327d, compared to commit: 1eb77cd6ae1a28d677ebaeb0d026af3f36f98a5d
🧾 Summary (20% most significant diffs)
| Contract | Method | Avg (+/-) | % |
|---|---|---|---|
| GenericSwap | executeSwapWithSig | -24,801 ✅ | -14.94% |
Full diff report 👇
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| GenericSwap | 2,085,538 (+358,609) | allowanceTarget executeSwap executeSwapWithSig permit2 |
446 (+132) 32,016 (-20) 35,515 (-3,546) 204 (+22) |
+42.04% -0.06% -9.08% +12.09% |
446 (+132) 108,779 (-469) 141,166 (-24,801) 204 (+22) |
+42.04% -0.43% -14.94% +12.09% |
446 (+132) 96,847 (-966) 67,559 (-105,108) 204 (+22) |
+42.04% -0.99% -60.87% +12.09% |
446 (+132) 247,172 (-969) 281,013 (+1,541) 204 (+22) |
+42.04% -0.39% +0.55% +12.09% |
1 (0) 13 (0) 5 (+1) 1 (0) |
| SmartOrderStrategy | 1,163,069 (0) | approveTokens | 55,489 (0) | 0.00% | 160,228 (-13,092) | -7.55% | 160,223 (-104,735) | -39.53% | 264,970 (0) | 0.00% | 36 (+4) |