wfCash4626 withdraw method can settle the account #169
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
Notional
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-06-notional-coop/blob/main/notional-wrapped-fcash/contracts/wfCashERC4626.sol#L192
Vulnerability details
withdraw
will revert if the account has not been settled yet.This is just due to the implementation and can be avoided by, well, settling the account.
Impact
withdraw
reverts unnecessarily. Protocols and users which will use wfCash4626 will have to discover this and settle by themselves.Proof of Concept
withdraw
callspreviewWithdraw
, which ends up calling_getMaturedValue
, which will revert if the account is not settled yet.Recommended Mitigation Steps
Add to
withdraw
:This will ensure that the account is settled and
withdraw
will not revert.The text was updated successfully, but these errors were encountered: