QA Report #79
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
It is a bit misleading to name the parameter 'from' here:
because the actual allowance is increased/decreased from the contract itself. A more intuitive name would be a 'sender' or 'caller', or something like that.
decimals() is not used in any meaningful way. A comment says:
"This value should be equal to the decimals of the token used to deposit into the pool."
so I think you can at least query aToken.UNDERLYING_ASSET_ADDRESS().decimals() in the constructor to ensure that the decimals match.
This might not be compatible with IYieldSource, but I think it would be helpful to have an extra function redeemShares, so that users can specify their balance of shares directly when redeeming.
function redeemToken could validate that _redeemAmount > 0 to prevent spam of useless invocations.
safeApprove is deprecated: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol#L45
I think you can just use a regular 'approve' in the constructor to set the initial approval.
The text was updated successfully, but these errors were encountered: