code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

Improve readability of constants #37

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

gpersoon

Vulnerability details

Impact

The value of BLOCK_TIME = 132e17 // 13.2 seconds, which is not straightforward read. In solidity it can also be written as: 13.2e18, which is easier to read.

Proof of Concept

https://github.com/code-423n4/2021-09-wildcredit/blob/main/contracts/InterestRateModel.sol#L17 uint private constant BLOCK_TIME = 132e17; // 13.2 seconds

Tools Used

Recommended Mitigation Steps

Replace uint private constant BLOCK_TIME = 132e17; // 13.2 seconds with uint private constant BLOCK_TIME = 13.2e18; // 13.2 seconds