Uniswap / v4-core

🦄 🦄 🦄 🦄 Core smart contracts of Uniswap v4
https://blog.uniswap.org/uniswap-v4
2.01k stars 968 forks source link

Test suite improvements #390

Open snreynolds opened 1 year ago

snreynolds commented 1 year ago

Component

General design optimization (improving efficiency, cleanliness, or developer experience)

Describe the suggested feature and problem it solves.

Deployers contract that we use in the testing suite has gotten a little bloated. I think we should clean this up and have a standard way of approving tokens and creating a new pool, and then enforce a standard way to perform all operations on top of that: adding liquidity/swapping/donating.

Describe the desired implementation.

No response

Describe alternatives.

No response

Additional context.

No response

hensha256 commented 1 year ago

Things I'd like to see improved

hensha256 commented 1 year ago
hensha256 commented 1 year ago
hensha256 commented 1 year ago
hensha256 commented 1 year ago
snreynolds commented 1 year ago

Added these notes as checkboxes above

zhongeric commented 1 year ago

FYI we are splitting up modifyPosition tests with work in #402 so hopefully it'll be more fine grained

hensha256 commented 11 months ago

Add testing for interactions of NoOp #324 and Access Lock #404 once they are both merged. For example testing a nested call to swap where the inner call NoOps

hensha256 commented 11 months ago

Test all functions revert without a lock

hensha256 commented 11 months ago

Remove vm.assume and replace with bound or actually test the other values revert !

hensha256 commented 8 months ago

Make a common SWAP_PARAMS in Deployers.sol instead of having IPoolManager.SwapParams({zeroForOne: true, amountSpecified: -100, sqrtPriceLimitX96: SQRT_RATIO_1_2}) copied everywhere

hensha256 commented 8 months ago

helper functions _settle and _take could take a uint instead of an int