Uniswap / UniswapX

🦄 Gasless ERC20 swap settlement protocol 🦄
GNU General Public License v3.0
383 stars 84 forks source link

Non-linear Block-based Orders #269

Closed codyborn closed 2 months ago

codyborn commented 3 months ago

Some notable differences from Dutchv2 Orders:

  1. Instead of an uint256 endAmount, input and output use a NonLinearDecay curve struct, which defines the relative points on the decay curve. The points are relative so that the cosigner only needs to override the startAmount and the user’s signed curve can remain unchanged.
  2. We use uint16 to store the relative block numbers. With 16 bits, we can define curves with points far into the future (11 days on Arbitrum and 1.5 years on Mainnet). If we were to use 8 bits, we could only define curves with 64 seconds into the future on Arbitrum.
  3. NonLinearDutchInput now contains a maxAmount property to hold the max point on the input curve. Used for constructing the InputToken object for Permit2.
marktoda commented 2 months ago

seems you need a forge fmt