Velvet-Capital / Velvet-v4

V4 (thena+venus) on top of v3
Other
0 stars 0 forks source link

Removal of strict zero check #33

Closed langnavina97 closed 1 month ago

langnavina97 commented 1 month ago

As pointed out in the last Audit Competition (Hats Finance) it's not recommended to have strict zero balance checks after a swap since dust is very common in DeFi protocols

After selling the tokens in updateTokens (removing one portfolio tokens) we still have the zero check..

if (_getTokenBalanceOf(_portfolioToken, _vault) != 0)
          revert ErrorLibrary.NonPortfolioTokenBalanceIsNotZero();