Uniswap / UniswapX

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

Non-linear Block-based Orders #269

Open codyborn opened 3 weeks ago

codyborn commented 3 weeks 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 weeks ago

seems you need a forge fmt