Skip to content

Conversation

hensha256
Copy link
Contributor

Related Issue

Which issue does this pull request resolve?

This contract is not secure and is just a test util. Lets name it as such, and put a better version in periphery for real contracts.

Copy link

Forge code coverage:

File % Lines % Statements % Branches % Funcs
src/ERC6909.sol 91.30% (21/23) 85.71% (24/28) 100.00% (4/4) 85.71% (6/7)
src/ERC6909Claims.sol 100.00% (6/6) 100.00% (8/8) 100.00% (4/4) 100.00% (1/1)
src/Extsload.sol 100.00% (2/2) 100.00% (2/2) 100.00% (0/0) 100.00% (3/3)
src/Exttload.sol 0.00% (0/1) 0.00% (0/1) 100.00% (0/0) 50.00% (1/2)
src/NoDelegateCall.sol 100.00% (3/3) 100.00% (4/4) 100.00% (2/2) 100.00% (3/3)
src/PoolManager.sol 100.00% (94/94) 98.48% (130/132) 100.00% (38/38) 100.00% (20/20)
src/ProtocolFees.sol 100.00% (24/24) 96.67% (29/30) 100.00% (11/11) 100.00% (6/6)
src/libraries/BitMath.sol 100.00% (11/11) 100.00% (11/11) 100.00% (4/4) 100.00% (2/2)
src/libraries/CurrencyDelta.sol 100.00% (6/6) 100.00% (8/8) 100.00% (0/0) 100.00% (3/3)
src/libraries/CurrencyReserves.sol 75.00% (3/4) 75.00% (3/4) 100.00% (2/2) 100.00% (5/5)
src/libraries/CustomRevert.sol 100.00% (0/0) 100.00% (0/0) 100.00% (0/0) 100.00% (8/8)
src/libraries/FullMath.sol 100.00% (28/28) 100.00% (32/32) 100.00% (8/8) 100.00% (2/2)
src/libraries/Hooks.sol 100.00% (81/81) 98.61% (142/144) 100.00% (60/60) 100.00% (14/14)
src/libraries/LPFeeLibrary.sol 100.00% (10/10) 100.00% (17/17) 100.00% (4/4) 100.00% (7/7)
src/libraries/LiquidityMath.sol 100.00% (2/2) 100.00% (1/1) 100.00% (1/1) 100.00% (1/1)
src/libraries/Lock.sol 100.00% (1/1) 100.00% (1/1) 100.00% (0/0) 100.00% (3/3)
src/libraries/NonZeroDeltaCount.sol 100.00% (3/3) 100.00% (3/3) 100.00% (0/0) 100.00% (3/3)
src/libraries/ParseBytes.sol 100.00% (3/3) 100.00% (3/3) 100.00% (0/0) 100.00% (3/3)
src/libraries/Pool.sol 99.35% (154/155) 99.42% (172/173) 100.00% (86/86) 100.00% (13/13)
src/libraries/Position.sol 100.00% (11/11) 100.00% (12/12) 100.00% (4/4) 100.00% (2/2)
src/libraries/ProtocolFeeLibrary.sol 100.00% (6/6) 100.00% (6/6) 100.00% (0/0) 100.00% (4/4)
src/libraries/SafeCast.sol 100.00% (10/10) 100.00% (16/16) 100.00% (10/10) 100.00% (5/5)
src/libraries/SqrtPriceMath.sol 100.00% (37/37) 100.00% (48/48) 88.24% (15/17) 100.00% (9/9)
src/libraries/StateLibrary.sol 100.00% (65/65) 100.00% (88/88) 100.00% (4/4) 100.00% (14/14)
src/libraries/SwapMath.sol 100.00% (24/24) 100.00% (25/25) 100.00% (6/6) 100.00% (2/2)
src/libraries/TickBitmap.sol 100.00% (21/21) 100.00% (26/26) 100.00% (3/3) 100.00% (4/4)
src/libraries/TickMath.sol 100.00% (97/97) 100.00% (142/142) 100.00% (45/45) 100.00% (4/4)
src/libraries/TransientStateLibrary.sol 100.00% (8/8) 100.00% (12/12) 100.00% (2/2) 100.00% (5/5)
src/libraries/UnsafeMath.sol 100.00% (1/1) 100.00% (1/1) 100.00% (0/0) 100.00% (1/1)
src/types/BalanceDelta.sol 100.00% (2/2) 100.00% (2/2) 100.00% (0/0) 100.00% (2/2)
src/types/BeforeSwapDelta.sol 100.00% (2/2) 100.00% (2/2) 100.00% (0/0) 100.00% (2/2)
src/types/Currency.sol 100.00% (16/16) 96.00% (24/25) 100.00% (10/10) 100.00% (7/7)
src/types/PoolId.sol 100.00% (1/1) 100.00% (1/1) 100.00% (0/0) 100.00% (1/1)
src/types/Slot0.sol 100.00% (8/8) 100.00% (8/8) 100.00% (0/0) 100.00% (8/8)
Total 83.49% (1507/1805) 82.89% (1967/2373) 79.94% (578/723) 78.77% (371/471)

/// To settle a negative delta (a debt on the user), a user make transfer or burn to pay off a debt.
/// @dev Note that sync() is called before any erc-20 transfer in `settle`.
library CurrencySettler {
/// @dev THIS CONTRACT IS NOT SECURE, IT IS FOR TESTING PURPOSES, DO NOT USE IT IN PROD
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this warning is a bit overkill? It just doesn't use safe transfer from and we don't do this in a lot of our test contracts which should never be used in prod

Copy link
Member

Choose a reason for hiding this comment

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

I think just renaming it and putting it in the test/utils file is sufficient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants