Protocol earnings are permanently lost/locked #60
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-84
🤖_38_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
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/lib.rs#L1149-L1150
Vulnerability details
Impact
It will be impossible to withdraw the accrued protocol fees, so funds are permanently locked inside the contract.
Proof of Concept
The
collect_protocol
function is designed to transfer the FUSDC and pool token protocol fees to a recipient:https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/lib.rs#L1149-L1150
The issue is that the token address and recipient are inverted in order, so the previous calls will always revert, as they use the recipient as the token address instead:
https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/seawater/src/wasm_erc20.rs#L158
Tools Used
Manual Review
Recommended Mitigation Steps
Consider fixing the argument order:
Assessed type
Token-Transfer
The text was updated successfully, but these errors were encountered: