code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

`10 ** 18` can be changed to `1e18` and save some gas #274

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/TroveManagerRedemptions.sol#L440-L440

uint256 redeemedYUSDFraction = _YUSDDrawn.mul(10**18).div(_totalYUSDSupply);

10 ** 18 can be changed to 1e18 to avoid unnecessary arithmetic operation and save gas.

kingyetifinance commented 2 years ago

Duplicate #16

alcueca commented 2 years ago

Taking as main