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

1 stars 0 forks source link

More readable constants #51

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

gpersoon

Vulnerability details

Impact

A few constant values are somewhat difficult to read, although they are explained with a comment. They can be rewritten to be easier to read.

Proof of Concept

Factory.sol: uint256 public override minLicenseFee = 1e15; // 1e15 0.1% Factory.sol: require(newOwnerSplit <= 2e17); // 20%

Tools Used

Recommended Mitigation Steps

Replace 1e15; // 1e15 0.1% with 0.001e18;

Replace 2e17); // 20% with 0.2e18;

GalloDaSballo commented 2 years ago

I like the idea of basing all the math on 1e18 as that's a commonly used value, I'd consider just adding it as a comment as well