code-423n4 / 2021-10-union-findings

0 stars 0 forks source link

Code Style: constants should be named in all caps #61

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

WatchPug

Vulnerability details

Here are some examples that the code style does not follow the best practices:

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/token/Comptroller.sol#L36-L37

uint256 public constant nonMemberRatio = 75 * 10**16; // 75%;
uint256 public constant memberRatio = 10**18; // 100%;

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/WadRayMath.sol#L11-L11

uint256 internal constant halfWAD = WAD / 2;

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/market/FixedInterestRateModel.sol#L10-L10

bool public constant override isInterestRateModel = true;

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/token/UnionToken.sol#L26-L26

uint256 public constant minimumTimeBetweenMints = 1 days * 365;

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/token/UnionToken.sol#L34-L34

uint256 public constant mintCap = 4;

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/user/CreditLimitByMedian.sol#L12-L12

bool public constant override isCreditLimitModel = true;

https://github.com/code-423n4/2021-10-union/blob/4176c366986e6d1a6b3f6ec0079ba547b040ac0f/contracts/user/SumOfTrust.sol#L12-L12

bool public constant override isCreditLimitModel = true;
GalloDaSballo commented 3 years ago

Agree with the finding