Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

[Epic] Smart Contract Optimizations #195

Open 0xdcota opened 1 year ago

0xdcota commented 1 year ago

In meeting Smart Contract meeting December 15, 2022, we agreed to start lumping in an Epic the optimizations we are aware can be done.

Smart contract optimization opportunities:

Description Where Completed? Comments
DepositCap call totalAssets() Described here
totalAssets() function in BaseVault totalAssets function goes through every provider and is very inefficient.
Using SafeERC20 instead of casting when used several times When safetransfer is used only once, it is not necessary to add the "using SafeERC20 for address"; if used many times, it is worth it ✔️ This was completed during 3Sigma audit
pedrovalido commented 1 year ago

As discussed, I've also added the totalAssets() function as needing optimization