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

Upgraded Q -> 2 from #167 [1727128717282] #171

Closed
c4-judge opened this issue Sep 23, 2024 · 4 comments
Closed

Upgraded Q -> 2 from #167 [1727128717282] #171

c4-judge opened this issue Sep 23, 2024 · 4 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-8 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-judge
Copy link
Contributor

Judge has assessed an item in Issue #167 as 2 risk. The relevant finding follows:

[LOW-3] No function to set the fee_protocol of a pool:

Uniswap v3 has a function that let's the factory owner to set the protocol's fee denominator value for a pool. However, no such function exists in pool.rs. However, the pool storage contains the fee_protocol var:

https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L31

fee_protocol: StorageU8,

Therefore, the protocol won't be able to collect fee on the swap operations that would take place.

Recommended Mitigation Steps:

Add a function that would let the admin set the fee_protocol variable.

[LOW-4] No use of seconds and tick_cumulative values of a tick:

The tick.rs contains the following in its storage:

https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/tick.rs#L54

    tick_cumulative_outside: StorageI64,
    seconds_per_liquidity_outside: StorageU160,
    seconds_outside: StorageU32,

However, these values are never set and used by the protocol. These values are basically maintained by uniswap v3 for other external contracts to use.

Recommended Mitigation Steps:

It is recommended to remove these storage vars if there are not to be used.

@c4-judge c4-judge added the 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value label Sep 23, 2024
@c4-judge
Copy link
Contributor Author

alex-ppg marked the issue as duplicate of #8

@c4-judge c4-judge added duplicate-8 partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) labels Sep 23, 2024
@c4-judge
Copy link
Contributor Author

alex-ppg marked the issue as partial-50

@c4-judge c4-judge added partial-75 Incomplete articulation of vulnerability; eligible for partial credit only (75%) and removed partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) labels Sep 23, 2024
@c4-judge
Copy link
Contributor Author

alex-ppg marked the issue as partial-75

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards and removed partial-75 Incomplete articulation of vulnerability; eligible for partial credit only (75%) labels Sep 23, 2024
@c4-judge
Copy link
Contributor Author

alex-ppg marked the issue as satisfactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-8 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

1 participant