sherlock-audit / 2022-11-dodo-judging

0 stars 2 forks source link

virtualfact - Literals with many digits is recommanded using Ether suffix #73

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

virtualfact

informational

Literals with many digits is recommanded using Ether suffix

Summary

routeFeeRate = 1500000000000000 in DODORouteProxy.slitherConstructorVariables() is better to be rewriten using Ether suffix.

Vulnerability Detail

routeFeeRate = 1500000000000000 is with many digits, and difficult to read and review. For example, uint 1_ether = 10000000000000000000 looks like 1 ether, but actually it is 10 ether.

Impact

Informational

Code Snippet

https://github.com/sherlock-audit/2022-11-dodo/blob/main/contracts/SmartRoute/DODORouteProxy.sol?plain=1#L58

uint256 public routeFeeRate = 1500000000000000; 
// dodo route fee receiver
address public routeFeeReceiver;

Tool used

Manual Review

Recommendation

rewirte 1500000000000000 by 1.5 * 1e15 / 1e18