Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 1: Improve forge tests #407

Merged
merged 19 commits into from
Nov 16, 2023
Merged

Part 1: Improve forge tests #407

merged 19 commits into from
Nov 16, 2023

Conversation

hensha256
Copy link
Contributor

Related Issue

Which issue does this pull request resolve?
Fixes 4 of the TODOs in #390

Description of changes

  • Checking revert reasons in more places
  • Larger helper functions in Deployers to remove the repeated logic from lots of tests. Standard key, pool, liquidity adding etc

marktoda
marktoda previously approved these changes Nov 15, 2023
Copy link
Contributor

@marktoda marktoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!!! much improved

src/test/PoolDonateTest.sol Outdated Show resolved Hide resolved
src/test/PoolModifyPositionTest.sol Outdated Show resolved Hide resolved
// if the product overflows, we know the denominator underflows
// in addition, we must check that the denominator does not underflow
require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product);
if (product / amount != sqrtPX96 || numerator1 <= product) revert PriceOverflow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any concerns if amount is 0 for div?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think so - thats in the V3 core code too


if (data.params.liquidityDelta > 0) {
assert(delta0 > 0 || delta1 > 0);
assert(!(delta0 < 0 || delta1 < 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this second assert seems unneeded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second assert is to check that modify position never returns a negative delta (which would be correct for that function. Where the first is to check that at least one of the deltas is non-0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes I see


IPoolManager.SwapParams memory params =
IPoolManager.SwapParams({zeroForOne: true, amountSpecified: 100, sqrtPriceLimitX96: SQRT_RATIO_1_2});
PoolSwapTest.TestSettings memory testSettings =
PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true});

vm.expectEmit(true, true, true, true, address(manager));
emit Swap(key.toId(), address(swapRouter), 100, -99, 79228162514264329670727698910, 1e18, -1, 0);
emit Swap(key.toId(), address(swapRouter), 100, -98, 79228162514264329749955861424, 1e18, -1, 123);
Copy link
Contributor

@zhongeric zhongeric Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the change here from using a new poolKey with diff liquidity/fee?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes its because this was a fees test that wasnt actually testing with a fee lol

@hensha256 hensha256 linked an issue Nov 16, 2023 that may be closed by this pull request
@hensha256 hensha256 merged commit 7998e6c into main Nov 16, 2023
2 checks passed
@hensha256 hensha256 deleted the improve-forge-tests branch November 16, 2023 16:41
zhongeric pushed a commit that referenced this pull request Dec 14, 2023
* Revert messages

* Common take and settle contract for tests

* improving swap and take tests

* add asserts for modify position

* extra asserts in modify position

* asserts in donate test

* More deployment helpers

* native set up in deployer

* simplify initialize tests

* few more corrections

* more cleanup

* remove console logs

* snapshots and test fix post merge

* snapshots

* accidentally pushed foundry.toml

* PR comments
zhongeric pushed a commit that referenced this pull request Dec 14, 2023
* Revert messages

* Common take and settle contract for tests

* improving swap and take tests

* add asserts for modify position

* extra asserts in modify position

* asserts in donate test

* More deployment helpers

* native set up in deployer

* simplify initialize tests

* few more corrections

* more cleanup

* remove console logs

* snapshots and test fix post merge

* snapshots

* accidentally pushed foundry.toml

* PR comments
zhongeric added a commit that referenced this pull request Dec 16, 2023
* forge install: erc-6909

* migrate 1155 to 6909

* rm old 6909

* forge install: erc-6909

* add event arg

* rm old 6909

* forge install: erc-6909

* update test event

* Add gas snaps

* squash: support arbitrary calldata on test routers (#361)

* Chore: update licenses (#364)

* chore: update README

* chore: update interface licenses

* chore: update Hooks.sol license

* chore: update types licenses

* Migrate SwapMath tests to foundry (#363)

* write SwapMath Tests

* write gas snapshots tests

* delete SwapMath hardhat implementation

* eliminate SwapMathTest + add gas snapshots

* delete js snapshots

* migrate echidna test

* forge fmt

* test titles

* remove console import

---------

Co-authored-by: Job Mwitah <[email protected]>
Co-authored-by: Mwitah <[email protected]>

* add base hook for tests (#377)

* change natspec to ILockCallback.lockAcquired (#376)

* feat: update to solidity 0.8.22 (#378)

- Enforce evm_version to avoid compiling push0
- Remove unchecked loops which are unchecked by default in 0.8.22

* Cache dynamic fee in slot0 (#360)

* Bug: Require different currencies (#380)

* Require different currencies

* hardhat snapshots

* Add new custom type function

* remove extra paren

* Replace MockERC20 with solmate's MockERC20 (#374)

* rename MockERC20 -> UniMockERC20

* remove UniMockERC20 in favor of solmate/MockERC20

* update snapshots

* Fixing compiler warnings (#386)

* fix: add gas snaps for swaps with 1155 as input/output (#383)

* Add snaps for 1155 swaps

* remove lib

* Add gas prefix

* Delete Hardhat (#372)

Co-authored-by: Sara Reynolds <[email protected]>
Co-authored-by: Alice <[email protected]>
Co-authored-by: Sara Reynolds <[email protected]>

* feat: use standard forge directory structure (#389)

* feat: standard foundry directory structure

This commit moves to the standard foundry directory structure with
contracts in src/ and tests in test/.

* feat: remove JS stuff

* fix: remove out dir

* fix: workflows

* fix: re-add js scripts

* fix: add back js stuff

* feat: yarn lock

* fix: alice comments

* Improve forge tests (#391)

* Updating lots of tests

* Fixed final test

* remove console2

* mark PR comment

* Fix Issue #397: Incorrect Documentation (#399)

* feat: move whitepapers to docs dir to cleanup root (#393)

* feat: move whitepapers to docs dir to cleanup root

* fix: remove draft so links dont break

* add snapshots to CI with tolerance (#401)

* Implement Claims accounting as minimal balance (#379)

* Add MinimalBalance

* Initial commmit

* Router custodies Claims, has access to priviledged burnFrom anbd tests

* updategas

* remove 6909 lib

* yarn snapshots

* Add gas snaps for swapping from claims balance

* fix gas snaps by removing aux logic in router

* gas

* remove lib

* Add transfer to minimalBalance, update tests

* nit: rename

* add back custom errors

* move addition out of unchecked

* Add transfer overflow check

* Rename impl test

* nit comments

* comment#

* Remove unused inheritance

* remove comment

* Remove poolClaimTest

* fix interfaces

* Feedback

* Add address(0) and address(this) check for transfer

* remove address(0) check

* Remove batchBurn

* Move mock claims to diff file

* Add gas snaps for collect protocol fees

* Add balance checks, make balances mapping private

* Fix imports

* fix fs perms

* Remove uint256 in mapping and use Currency

* feedback

* Add gas snaps

* fix: whitepaper link (#400)

I accidentally broke the link from readme

* Add solc binaries and transient storage lock library (#395)

* Updated solc setup and instructions (#406)

* Added contribution instructions

* missing space

* Updated solc config

* feat: move JS scripts to subdir and add helper (#405)

This commit moves our JS helper scripts into a test subdirectory and
adds a helper abstract contract to more easily build the ffi commands to
interop with javascript testers

* Set tick spacing range as constants (#369)

* Set tick spacing range as constants

While tick and tick spacing both use int24 as their type, each has a
different range. Tick spacing has a range of [1, 32767].
This commit updates Tick test cases to use proper tick spacing range
instead that of tick.

Resolves issue #371

* Restore a unit test on tick spacing liquidity

This commit adds back the unit test that checks for tick spacing
liquidity given the entire tick range as the input argument.
This is an alternative change mentioned on the issue referred below.

resolves #369

* Remove duplicate constants from test suite

This commit moves MIN_TICK, MAX_TICK, MIN_TICK_SPACING, and
MAX_TICK_SPACING constants from test suite constants file to TickMath
library. Previous to this commit, TickMath library declared MIN_TICK and
MAX_TICK constants with the same value from the test suite constants
file. Removing duplicate constants from the test file and referencing
them from the production file prevents future dicrepancies between
production and test environments.

* Remove unused import

* Remove unnecessary override keywords

* Update forge snapshots

* Part 1: Improve forge tests (#407)

* Revert messages

* Common take and settle contract for tests

* improving swap and take tests

* add asserts for modify position

* extra asserts in modify position

* asserts in donate test

* More deployment helpers

* native set up in deployer

* simplify initialize tests

* few more corrections

* more cleanup

* remove console logs

* snapshots and test fix post merge

* snapshots

* accidentally pushed foundry.toml

* PR comments

* remove forge snapshot --check (#417)

* feat: update justfile with custom solc (#418)

For folks who dont want to update their global env they can use `just
test` or `just build` which sets solc using cli arg

* Fix typos (#365)

* Fix typos

* Fix typo in src/libraries/Lockers.sol

* Update just prep and build (#421)

* udpate prep and add build

* Update justfile

* fix tests

* remove totalsupply

* remove lib

* remove solmate

* forge install: solmate

main

* Add comment

* Add solmate 6909 and remove claims

* feat: add variadic args to justfile (#423)

allows to pass on args to forge i.e. `forge test --mt fuzz`

* move up settle and remove solmate

* forge install: solmate

* copy erc6909 locally and use _mint and _burn

* forge fmt

* remove lib

* forge install: solmate

v6

* rmeove solmate

* forge install: solmate

2001af43ae

* fix gas snaps

* remove unchecked without totalSupply

* Lock on initialize (#424)

* Lock on initialize

* Rename initialize error

* fix CI fuzz edge case

* NoOp implementation with flag (#324)

* cherrypicking

* tests running and update snaps

* test supoprt

* format and run hardhat tests

* remove irrelevant comment

* test noops

* add tests for noop

* lint and snapshots

* fix hook tests

* clean

* foundry toml

* helper function

* Revert early if pool isnt initialized

* Extra tests

* Tests NoOps on disallowed hooks fail

* linting

* snapshots

* helper function for initialized pool

* PR comments

* PR comment test coverage

* Final PR comments

* comments about sentinel value

* Fix masking tests

* decrease calls to assume

---------

Co-authored-by: Alex <[email protected]>
Co-authored-by: hensha256 <[email protected]>

* update testss

* rm solmate

* forge install: solmate

main

* Use solmate 6909

* fmt

* cache msg sender

* Explain different solc options (#429)

* explain solc options

* Add reference in readme

* random linting issue

* Access lock (#404)

* Fix broken tests that were using old claims balance format

* Add V46909 and reorder params

* Add V46909 and Mock contract for test

* Add revert tests

* burnFrom internal

* remove old gas snaps and add native tests

* feat: add lock target (#300)

* feat: add lock target

* feat: store lockOriginator

* fix: tests

* feat: lockOriginator => lockCaller

* feat: add invalid locker tests

* fix: remove unused params

* fix tests and snaps

* forge fmt

* expectEmit() all

* expect emit all

* Prevent ProtocolFeeController from bricking pool initialization on revert (#362)

* Default protocol fees to 0 if protocolFeeController reverts

* snapshots

* fix comment

* add another malicious contract

* remove useless var assignment

* make call and decode return in assembly

* fix typo in var assingmenet

* clean up tests

* update snapshots#

* check withdrawFee == 0 on tests too

* add test

* separate out fetchProtocolFees and checkProtocolFees

* manually revert in setProtocolFees

* Add success return value to fetchProtocolFEes

* Add test for FeeTooLarge passing on initialzie but not on setProtocolFees

* check low level call success

* clean up

* add comment

* simplify

* udpate snaps

* fix compiler warnings

* fix result type

* fix formatting

* Add more descriptive error message

* Change error name again

* Add comments

* update gas specs

* fix merge conflict t4ests

* fix tests

* Add tests for setProtocolFee with invalid controllers

* Add missing snaps

* Feedback changes

* fix initialize tests

* fix fmt

* Fix comment

* comments and revise order

---------

Co-authored-by: Sara Reynolds <[email protected]>

* feedback

* Add IERC69009, does not compile

* Revert "Add IERC69009, does not compile"

This reverts commit 4e89408.

* added delta overflow checks (#433)

* add pool getters (#438)

* add getters

* update snaps

* clean test

* A few cleanup tasks (#437)

* Fix compiler warnings

* todo for mapping transient

* fixing tests with fuzzing

* remove console logs

* Update PoolDonateTest.sol

* remove amount overload

---------

Co-authored-by: Sara Reynolds <[email protected]>

* Remove hook fees and protocol fee on withdrawal (#432)

* Remove hook fees and protocol fee on withdrawal

* hook fee tests

* Update AccessLockHook.sol

* assume -> bound

* more comments on fee grnaularity

* refactor: hooks callsites (#439)

* feat: hooks refactor

* fix: tests

* feat: noop -> shouldExecute

* fix: remove shouldCall functions for helper

* fix: using for in test

* fix: alice comment

* merge conflicts

* fix fialing test

* Copy solmate 6909 locally to get interface inheritance

* natspec

* expose getters in pool interface

* Use id for mint/burn instead of currency

* forge fmt

* Add burnFrom no approval test

* feedback

* feedback

* forge install: ERC-6909

main

* remove lib

* Add commit SHA

* merge conflicts galore

* forge install: solmate

4b47a19038b798b4a33d9749d25e570443520647

* fix conflict

* fix libs

* del

* forge install: openzeppelin-contracts

v4.4.2

* fix tests from conflcits and gas

* forge fmt

* removed unused file

* fix: faling fuzz tests (#441)

* Add failing fuzz test

* Add bounds

* added out of range checks

* changed assume to bound

* forge fmt

* changed Position -> Liquidity on merge main

* moved amount helper to utils

---------

Co-authored-by: Austin Adams <[email protected]>

* fix gas snap

* forge test

* feedback

---------

Co-authored-by: jtriley.eth <[email protected]>
Co-authored-by: saucepoint <[email protected]>
Co-authored-by: Erin Koen <[email protected]>
Co-authored-by: Emily Williams <[email protected]>
Co-authored-by: Job Mwitah <[email protected]>
Co-authored-by: Mwitah <[email protected]>
Co-authored-by: Sara Reynolds <[email protected]>
Co-authored-by: Ed Mazurek <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: Alice <[email protected]>
Co-authored-by: Sara Reynolds <[email protected]>
Co-authored-by: Jose Carlos Montero Gomez <[email protected]>
Co-authored-by: hyunchel <[email protected]>
Co-authored-by: xiaolou86 <[email protected]>
Co-authored-by: emma <[email protected]>
Co-authored-by: Alex <[email protected]>
Co-authored-by: hensha256 <[email protected]>
Co-authored-by: Austin Adams <[email protected]>
Co-authored-by: Austin Adams <[email protected]>
hyunchel pushed a commit to hyunchel/v4-core that referenced this pull request Feb 21, 2024
* Revert messages

* Common take and settle contract for tests

* improving swap and take tests

* add asserts for modify position

* extra asserts in modify position

* asserts in donate test

* More deployment helpers

* native set up in deployer

* simplify initialize tests

* few more corrections

* more cleanup

* remove console logs

* snapshots and test fix post merge

* snapshots

* accidentally pushed foundry.toml

* PR comments
hyunchel added a commit to hyunchel/v4-core that referenced this pull request Feb 21, 2024
* forge install: erc-6909

* migrate 1155 to 6909

* rm old 6909

* forge install: erc-6909

* add event arg

* rm old 6909

* forge install: erc-6909

* update test event

* Add gas snaps

* squash: support arbitrary calldata on test routers (Uniswap#361)

* Chore: update licenses (Uniswap#364)

* chore: update README

* chore: update interface licenses

* chore: update Hooks.sol license

* chore: update types licenses

* Migrate SwapMath tests to foundry (Uniswap#363)

* write SwapMath Tests

* write gas snapshots tests

* delete SwapMath hardhat implementation

* eliminate SwapMathTest + add gas snapshots

* delete js snapshots

* migrate echidna test

* forge fmt

* test titles

* remove console import

---------

Co-authored-by: Job Mwitah <[email protected]>
Co-authored-by: Mwitah <[email protected]>

* add base hook for tests (Uniswap#377)

* change natspec to ILockCallback.lockAcquired (Uniswap#376)

* feat: update to solidity 0.8.22 (Uniswap#378)

- Enforce evm_version to avoid compiling push0
- Remove unchecked loops which are unchecked by default in 0.8.22

* Cache dynamic fee in slot0 (Uniswap#360)

* Bug: Require different currencies (Uniswap#380)

* Require different currencies

* hardhat snapshots

* Add new custom type function

* remove extra paren

* Replace MockERC20 with solmate's MockERC20 (Uniswap#374)

* rename MockERC20 -> UniMockERC20

* remove UniMockERC20 in favor of solmate/MockERC20

* update snapshots

* Fixing compiler warnings (Uniswap#386)

* fix: add gas snaps for swaps with 1155 as input/output (Uniswap#383)

* Add snaps for 1155 swaps

* remove lib

* Add gas prefix

* Delete Hardhat (Uniswap#372)

Co-authored-by: Sara Reynolds <[email protected]>
Co-authored-by: Alice <[email protected]>
Co-authored-by: Sara Reynolds <[email protected]>

* feat: use standard forge directory structure (Uniswap#389)

* feat: standard foundry directory structure

This commit moves to the standard foundry directory structure with
contracts in src/ and tests in test/.

* feat: remove JS stuff

* fix: remove out dir

* fix: workflows

* fix: re-add js scripts

* fix: add back js stuff

* feat: yarn lock

* fix: alice comments

* Improve forge tests (Uniswap#391)

* Updating lots of tests

* Fixed final test

* remove console2

* mark PR comment

* Fix Issue Uniswap#397: Incorrect Documentation (Uniswap#399)

* feat: move whitepapers to docs dir to cleanup root (Uniswap#393)

* feat: move whitepapers to docs dir to cleanup root

* fix: remove draft so links dont break

* add snapshots to CI with tolerance (Uniswap#401)

* Implement Claims accounting as minimal balance (Uniswap#379)

* Add MinimalBalance

* Initial commmit

* Router custodies Claims, has access to priviledged burnFrom anbd tests

* updategas

* remove 6909 lib

* yarn snapshots

* Add gas snaps for swapping from claims balance

* fix gas snaps by removing aux logic in router

* gas

* remove lib

* Add transfer to minimalBalance, update tests

* nit: rename

* add back custom errors

* move addition out of unchecked

* Add transfer overflow check

* Rename impl test

* nit comments

* comment#

* Remove unused inheritance

* remove comment

* Remove poolClaimTest

* fix interfaces

* Feedback

* Add address(0) and address(this) check for transfer

* remove address(0) check

* Remove batchBurn

* Move mock claims to diff file

* Add gas snaps for collect protocol fees

* Add balance checks, make balances mapping private

* Fix imports

* fix fs perms

* Remove uint256 in mapping and use Currency

* feedback

* Add gas snaps

* fix: whitepaper link (Uniswap#400)

I accidentally broke the link from readme

* Add solc binaries and transient storage lock library (Uniswap#395)

* Updated solc setup and instructions (Uniswap#406)

* Added contribution instructions

* missing space

* Updated solc config

* feat: move JS scripts to subdir and add helper (Uniswap#405)

This commit moves our JS helper scripts into a test subdirectory and
adds a helper abstract contract to more easily build the ffi commands to
interop with javascript testers

* Set tick spacing range as constants (Uniswap#369)

* Set tick spacing range as constants

While tick and tick spacing both use int24 as their type, each has a
different range. Tick spacing has a range of [1, 32767].
This commit updates Tick test cases to use proper tick spacing range
instead that of tick.

Resolves issue Uniswap#371

* Restore a unit test on tick spacing liquidity

This commit adds back the unit test that checks for tick spacing
liquidity given the entire tick range as the input argument.
This is an alternative change mentioned on the issue referred below.

resolves Uniswap#369

* Remove duplicate constants from test suite

This commit moves MIN_TICK, MAX_TICK, MIN_TICK_SPACING, and
MAX_TICK_SPACING constants from test suite constants file to TickMath
library. Previous to this commit, TickMath library declared MIN_TICK and
MAX_TICK constants with the same value from the test suite constants
file. Removing duplicate constants from the test file and referencing
them from the production file prevents future dicrepancies between
production and test environments.

* Remove unused import

* Remove unnecessary override keywords

* Update forge snapshots

* Part 1: Improve forge tests (Uniswap#407)

* Revert messages

* Common take and settle contract for tests

* improving swap and take tests

* add asserts for modify position

* extra asserts in modify position

* asserts in donate test

* More deployment helpers

* native set up in deployer

* simplify initialize tests

* few more corrections

* more cleanup

* remove console logs

* snapshots and test fix post merge

* snapshots

* accidentally pushed foundry.toml

* PR comments

* remove forge snapshot --check (Uniswap#417)

* feat: update justfile with custom solc (Uniswap#418)

For folks who dont want to update their global env they can use `just
test` or `just build` which sets solc using cli arg

* Fix typos (Uniswap#365)

* Fix typos

* Fix typo in src/libraries/Lockers.sol

* Update just prep and build (Uniswap#421)

* udpate prep and add build

* Update justfile

* fix tests

* remove totalsupply

* remove lib

* remove solmate

* forge install: solmate

main

* Add comment

* Add solmate 6909 and remove claims

* feat: add variadic args to justfile (Uniswap#423)

allows to pass on args to forge i.e. `forge test --mt fuzz`

* move up settle and remove solmate

* forge install: solmate

* copy erc6909 locally and use _mint and _burn

* forge fmt

* remove lib

* forge install: solmate

v6

* rmeove solmate

* forge install: solmate

2001af43ae

* fix gas snaps

* remove unchecked without totalSupply

* Lock on initialize (Uniswap#424)

* Lock on initialize

* Rename initialize error

* fix CI fuzz edge case

* NoOp implementation with flag (Uniswap#324)

* cherrypicking

* tests running and update snaps

* test supoprt

* format and run hardhat tests

* remove irrelevant comment

* test noops

* add tests for noop

* lint and snapshots

* fix hook tests

* clean

* foundry toml

* helper function

* Revert early if pool isnt initialized

* Extra tests

* Tests NoOps on disallowed hooks fail

* linting

* snapshots

* helper function for initialized pool

* PR comments

* PR comment test coverage

* Final PR comments

* comments about sentinel value

* Fix masking tests

* decrease calls to assume

---------

Co-authored-by: Alex <[email protected]>
Co-authored-by: hensha256 <[email protected]>

* update testss

* rm solmate

* forge install: solmate

main

* Use solmate 6909

* fmt

* cache msg sender

* Explain different solc options (Uniswap#429)

* explain solc options

* Add reference in readme

* random linting issue

* Access lock (Uniswap#404)

* Fix broken tests that were using old claims balance format

* Add V46909 and reorder params

* Add V46909 and Mock contract for test

* Add revert tests

* burnFrom internal

* remove old gas snaps and add native tests

* feat: add lock target (Uniswap#300)

* feat: add lock target

* feat: store lockOriginator

* fix: tests

* feat: lockOriginator => lockCaller

* feat: add invalid locker tests

* fix: remove unused params

* fix tests and snaps

* forge fmt

* expectEmit() all

* expect emit all

* Prevent ProtocolFeeController from bricking pool initialization on revert (Uniswap#362)

* Default protocol fees to 0 if protocolFeeController reverts

* snapshots

* fix comment

* add another malicious contract

* remove useless var assignment

* make call and decode return in assembly

* fix typo in var assingmenet

* clean up tests

* update snapshots#

* check withdrawFee == 0 on tests too

* add test

* separate out fetchProtocolFees and checkProtocolFees

* manually revert in setProtocolFees

* Add success return value to fetchProtocolFEes

* Add test for FeeTooLarge passing on initialzie but not on setProtocolFees

* check low level call success

* clean up

* add comment

* simplify

* udpate snaps

* fix compiler warnings

* fix result type

* fix formatting

* Add more descriptive error message

* Change error name again

* Add comments

* update gas specs

* fix merge conflict t4ests

* fix tests

* Add tests for setProtocolFee with invalid controllers

* Add missing snaps

* Feedback changes

* fix initialize tests

* fix fmt

* Fix comment

* comments and revise order

---------

Co-authored-by: Sara Reynolds <[email protected]>

* feedback

* Add IERC69009, does not compile

* Revert "Add IERC69009, does not compile"

This reverts commit 4e89408.

* added delta overflow checks (Uniswap#433)

* add pool getters (Uniswap#438)

* add getters

* update snaps

* clean test

* A few cleanup tasks (Uniswap#437)

* Fix compiler warnings

* todo for mapping transient

* fixing tests with fuzzing

* remove console logs

* Update PoolDonateTest.sol

* remove amount overload

---------

Co-authored-by: Sara Reynolds <[email protected]>

* Remove hook fees and protocol fee on withdrawal (Uniswap#432)

* Remove hook fees and protocol fee on withdrawal

* hook fee tests

* Update AccessLockHook.sol

* assume -> bound

* more comments on fee grnaularity

* refactor: hooks callsites (Uniswap#439)

* feat: hooks refactor

* fix: tests

* feat: noop -> shouldExecute

* fix: remove shouldCall functions for helper

* fix: using for in test

* fix: alice comment

* merge conflicts

* fix fialing test

* Copy solmate 6909 locally to get interface inheritance

* natspec

* expose getters in pool interface

* Use id for mint/burn instead of currency

* forge fmt

* Add burnFrom no approval test

* feedback

* feedback

* forge install: ERC-6909

main

* remove lib

* Add commit SHA

* merge conflicts galore

* forge install: solmate

4b47a19038b798b4a33d9749d25e570443520647

* fix conflict

* fix libs

* del

* forge install: openzeppelin-contracts

v4.4.2

* fix tests from conflcits and gas

* forge fmt

* removed unused file

* fix: faling fuzz tests (Uniswap#441)

* Add failing fuzz test

* Add bounds

* added out of range checks

* changed assume to bound

* forge fmt

* changed Position -> Liquidity on merge main

* moved amount helper to utils

---------

Co-authored-by: Austin Adams <[email protected]>

* fix gas snap

* forge test

* feedback

---------

Co-authored-by: jtriley.eth <[email protected]>
Co-authored-by: saucepoint <[email protected]>
Co-authored-by: Erin Koen <[email protected]>
Co-authored-by: Emily Williams <[email protected]>
Co-authored-by: Job Mwitah <[email protected]>
Co-authored-by: Mwitah <[email protected]>
Co-authored-by: Sara Reynolds <[email protected]>
Co-authored-by: Ed Mazurek <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: Alice <[email protected]>
Co-authored-by: Sara Reynolds <[email protected]>
Co-authored-by: Jose Carlos Montero Gomez <[email protected]>
Co-authored-by: hyunchel <[email protected]>
Co-authored-by: xiaolou86 <[email protected]>
Co-authored-by: emma <[email protected]>
Co-authored-by: Alex <[email protected]>
Co-authored-by: hensha256 <[email protected]>
Co-authored-by: Austin Adams <[email protected]>
Co-authored-by: Austin Adams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revert with custom error in SafeCast.sol
3 participants