AaveYield.getTokensForShares()
, AaveYield.getSharesForTokens()
Implementation can be simpler and save some gas
#128
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Handle
WatchPug
Vulnerability details
Based on the current implementation, shares are in aToken, which is 1:1 to the underlying token.
Therefore,
getTokensForShares()
andgetSharesForTokens()
can be much simplier.https://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/yield/AaveYield.sol#L256-L265
can be changed to:
https://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/yield/AaveYield.sol#L273-L275
can be changed to:
The text was updated successfully, but these errors were encountered: