Unset fee_protocol
forces protocol fee loss during swaps
#14
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-8
edited-by-warden
🤖_03_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L31
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L345-L346
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L356
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L449-L453
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L514
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/pool.rs#L522
Vulnerability details
Impact
Loss of protocol fees during swaps as the
fee_protocol
variable wasn't set anywhere during the creation of pools and there is no setter function to set it once the pool is live. Hence, protocol fee accrual will be lost.Proof of Concept
Consider this scenario:
collect_protocol_7540_F_A_9_F
function is calledThis code block is skipped because fee_protocol zeroed out
Tools Used
Manual review
Recommended Mitigation Steps
Set
fee_protocol
when the pool is created or have a function for setting it.Assessed type
Math
The text was updated successfully, but these errors were encountered: