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

Implement Claims accounting as minimal balance #379

Merged
merged 38 commits into from
Nov 14, 2023
Merged

Conversation

zhongeric
Copy link
Contributor

@zhongeric zhongeric commented Oct 31, 2023

Related Issue

Which issue does this pull request resolve?
#46 #197 #294

Using ERC1155s incurred too much bloat and was not gas efficient for our anticipated use cases. #357 replaced 1155s with ERC6909, a more lightweight multi token standard. This PR uses a minimal balance mapping to represent Claims on balances within PoolManager, only exposing mint, burn, and transfer.

Bytecode: 24,141 bytes, saving around 5,000 compared to latest main

Follow ups:

  • Accrue protocol fees as Claims to fee controller
  • Add ClaimRouter for tests

Description of changes

Gas report:

contracts/PoolManager.sol:PoolManager contract
Deployment Cost Deployment Size
4857763 24373
Function Name min avg median max # calls
MAX_TICK_SPACING 321 321 321 321 3
MIN_TICK_SPACING 278 278 278 278 1
balanceOf 788 788 788 788 3
burn 3930 3930 3930 3930 1
collectHookFees 21300 21300 21300 21300 1
collectProtocolFees 21359 21359 21359 21359 1
currencyDelta 776 1576 776 2776 5
donate 4506 59184 46839 193971 11
getLock 525 525 525 525 11
getPosition 1542 1542 1542 1542 1
getSlot0 839 839 839 839 1
hookFeesAccrued 775 2005 2775 2775 13
initialize 1383 195709345850760450 37997 8937393460516356415 137
lock 6482 158130 111015 1086513 96
lockData 481 481 481 481 19
mint 21489 21489 21489 21489 2
modifyPosition 5220 168495 185035 244464 40
pools 1339 5264 7339 9339 27
protocolFeeController 404 1404 1404 2404 2
protocolFeesAccrued 625 1513 625 2625 18
setHookFees 6915 10513 9705 13715 11
setProtocolFeeController 23758 25576 25758 25758 11
setProtocolFees 4574 10452 11779 13519 9
settle 2512 16220 20768 45869 71
swap 3852 57356 37746 129371 30
take 5032 5916 5032 20952 18

contracts/PoolManager.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/interfaces/IMinimalBalance.sol Outdated Show resolved Hide resolved
contracts/interfaces/IPoolManager.sol Outdated Show resolved Hide resolved
contracts/PoolManager.sol Outdated Show resolved Hide resolved
contracts/test/PoolSwapTest.sol Outdated Show resolved Hide resolved
test/foundry-tests/MinimalBalance.t.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
contracts/MinimalBalance.sol Outdated Show resolved Hide resolved
test/foundry-tests/MinimalBalance.t.sol Outdated Show resolved Hide resolved
contracts/Claims.sol Outdated Show resolved Hide resolved
contracts/Claims.sol Outdated Show resolved Hide resolved
contracts/test/PoolSwapTest.sol Outdated Show resolved Hide resolved
test/foundry-tests/Claims.t.sol Outdated Show resolved Hide resolved
test/foundry-tests/Claims.t.sol Outdated Show resolved Hide resolved
src/Claims.sol Outdated Show resolved Hide resolved
src/interfaces/IClaims.sol Outdated Show resolved Hide resolved
test/Claims.t.sol Show resolved Hide resolved
test/Claims.t.sol Show resolved Hide resolved
marktoda
marktoda previously approved these changes Nov 14, 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!! looking good to me

@zhongeric zhongeric merged commit 3921fad into main Nov 14, 2023
2 checks passed
@zhongeric zhongeric deleted the minimal-balances branch November 14, 2023 15:28
This was referenced Nov 14, 2023
zhongeric added a commit that referenced this pull request Dec 14, 2023
* 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
zhongeric added a commit that referenced this pull request Dec 14, 2023
* 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
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 <jobmwitah@gmail.com>
Co-authored-by: Mwitah <136892656+MwitahJob@users.noreply.github.com>

* 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 <30504811+snreynolds@users.noreply.github.com>
Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com>
Co-authored-by: Sara Reynolds <snreynolds2506@gmail.com>

* 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 <dalexwatts@gmail.com>
Co-authored-by: hensha256 <henshawalice@gmail.com>

* 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 <snreynolds2506@gmail.com>

* 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 <snreynolds2506@gmail.com>

* 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 <austino256@gmail.com>

* fix gas snap

* forge test

* feedback

---------

Co-authored-by: jtriley.eth <Jtriley15@gmail.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: Erin Koen <46381469+erin-koen@users.noreply.github.com>
Co-authored-by: Emily Williams <emag3m@gmail.com>
Co-authored-by: Job Mwitah <jobmwitah@gmail.com>
Co-authored-by: Mwitah <136892656+MwitahJob@users.noreply.github.com>
Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com>
Co-authored-by: Ed Mazurek <Edward.R.Mazurek@gmail.com>
Co-authored-by: marktoda <toda.mark@gmail.com>
Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com>
Co-authored-by: Sara Reynolds <snreynolds2506@gmail.com>
Co-authored-by: Jose Carlos Montero Gomez <sipox11@gmail.com>
Co-authored-by: hyunchel <3271191+hyunchel@users.noreply.github.com>
Co-authored-by: xiaolou86 <20718693+xiaolou86@users.noreply.github.com>
Co-authored-by: emma <57429431+emmaguo13@users.noreply.github.com>
Co-authored-by: Alex <dalexwatts@gmail.com>
Co-authored-by: hensha256 <henshawalice@gmail.com>
Co-authored-by: Austin Adams <36116882+aadams@users.noreply.github.com>
Co-authored-by: Austin Adams <austino256@gmail.com>
hyunchel pushed a commit to hyunchel/v4-core that referenced this pull request Feb 21, 2024
* 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
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 <jobmwitah@gmail.com>
Co-authored-by: Mwitah <136892656+MwitahJob@users.noreply.github.com>

* 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 <30504811+snreynolds@users.noreply.github.com>
Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com>
Co-authored-by: Sara Reynolds <snreynolds2506@gmail.com>

* 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 <dalexwatts@gmail.com>
Co-authored-by: hensha256 <henshawalice@gmail.com>

* 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 <snreynolds2506@gmail.com>

* 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 <snreynolds2506@gmail.com>

* 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 <austino256@gmail.com>

* fix gas snap

* forge test

* feedback

---------

Co-authored-by: jtriley.eth <Jtriley15@gmail.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: Erin Koen <46381469+erin-koen@users.noreply.github.com>
Co-authored-by: Emily Williams <emag3m@gmail.com>
Co-authored-by: Job Mwitah <jobmwitah@gmail.com>
Co-authored-by: Mwitah <136892656+MwitahJob@users.noreply.github.com>
Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com>
Co-authored-by: Ed Mazurek <Edward.R.Mazurek@gmail.com>
Co-authored-by: marktoda <toda.mark@gmail.com>
Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com>
Co-authored-by: Sara Reynolds <snreynolds2506@gmail.com>
Co-authored-by: Jose Carlos Montero Gomez <sipox11@gmail.com>
Co-authored-by: hyunchel <3271191+hyunchel@users.noreply.github.com>
Co-authored-by: xiaolou86 <20718693+xiaolou86@users.noreply.github.com>
Co-authored-by: emma <57429431+emmaguo13@users.noreply.github.com>
Co-authored-by: Alex <dalexwatts@gmail.com>
Co-authored-by: hensha256 <henshawalice@gmail.com>
Co-authored-by: Austin Adams <36116882+aadams@users.noreply.github.com>
Co-authored-by: Austin Adams <austino256@gmail.com>
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.

3 participants