Open code423n4 opened 3 years ago
cmichel
The tokenSupply is increased instead of set to the value directly. This performs an unnecessary addition as tokenSupply is always initialized to zero.
tokenSupply
// @audit just do: tokenSupply = ...; as tokenSupply starts at 0 tokenSupply += moneyMarkets[marketId].getSupplyView(tokenAddress);
Agree that equal has the same meaning and saves gas
Handle
cmichel
Vulnerability details
The
tokenSupply
is increased instead of set to the value directly. This performs an unnecessary addition astokenSupply
is always initialized to zero.