In the Withdraw function of BaseVault on line 420, assets are converted into shares and passed to spendAllowance(). However, spendAllowance() again converts these shares into assets.
This double conversion is redundant and causes a slight loss of precision.
Consider defining a different internal method to spend allowance in terms of assets.
[Q-3] Double conversion of Shares <> Assets in withdraw
Description
In the
Withdraw
function ofBaseVault
on line 420, assets are converted into shares and passed tospendAllowance()
. However,spendAllowance()
again converts these shares into assets.This double conversion is redundant and causes a slight loss of precision.
Consider defining a different internal method to spend allowance in terms of assets.