Open code423n4 opened 3 years ago
jvaqa
Gas Optimization: Utils.sol Make An Unnecessary Multiplication And Division By An Identical Value
The value "(T1 B1) / T1" is identical to the value "B1", so you can simplify the expression "B1 + (T1 B1) / T1" to "B1 + B1".
In Utils.sol, replace this:
uint _redemptionValue = B1 + (T1 * B1) / T1;
With this:
uint _redemptionValue = B1 + B1;
https://github.com/vetherasset/vaderprotocol-contracts/pull/164/commits/1fb07632dc4f1252d769566a4353607130604283
Handle
jvaqa
Vulnerability details
Impact
Gas Optimization: Utils.sol Make An Unnecessary Multiplication And Division By An Identical Value
The value "(T1 B1) / T1" is identical to the value "B1", so you can simplify the expression "B1 + (T1 B1) / T1" to "B1 + B1".
Recommended Mitigation Steps
In Utils.sol, replace this:
uint _redemptionValue = B1 + (T1 * B1) / T1;
With this:
uint _redemptionValue = B1 + B1;