QA Report #208
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
1. Missing
approve(0)
when minting an fCash position fromNotionalTradeModule.sol
Line References
NotionalTradeModule.sol#L493-L505
Impact
The
_approve
function inNotionalTradeModule.sol
calls theSetToken
'sinvoke
function which callsapprove
for thesendToken
if the allowance of the wrapped fCash position is less than themaxAssetAmount
. If thesendToken
is an ERC token with a non-standard approve function, such asUSDT
, then the approval might fail if the allowance of the fCash is more than 0 but less than_maxAssetAmount
.Recommended Mitigation Steps
Consider calling the
_sendToken
'sapprove
function to set the allowance of the fCash position to 0 before approving to_maxAssetAmount
.2. Missing zero-address checks
Line References
NotionalTradeModule.sol#L131
WrappedfCashFactory.sol#L17
wfCashBase.sol#L29
Impact
To ensure that necessary variable addresses aren't set to the zero-address, consider adding zero-address checks for all addresses supplied as input to the constructors.
The text was updated successfully, but these errors were encountered: