Omniscia Xcaliswap Audit
Minter Code Style Findings
Minter Code Style Findings
MRE-01C: Generic Typographic Mistakes
Type | Severity | Location |
---|---|---|
Code Style | ![]() | Minter.sol:L10, L16, L18 |
Description:
The referenced lines contain typographical mistakes or generic documentational errors (i.e. copy-paste) that should be corrected.
Example:
10// codifies the minting rules as per ve(3,3), abstracted from the token to support any token that allows minting
Recommendation:
We advise them to be corrected enhancing the legibility of the codebase.
Alleviation:
The Xcaliswap team evaluated this exhibit but opted not to apply any changes for it in the current iteration of the protocol.
MRE-02C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | ![]() | Minter.sol:L120 |
Description:
The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require
checks or if-else
constructs.
Example:
119if (_balanceOf < _required) {120 _token.mint(address(this), _required-_balanceOf);121}
Recommendation:
Given that safe arithmetics are toggled on by default in pragma
versions of 0.8.X
, we advise the linked statement to be wrapped in an unchecked
code block thereby optimizing its execution cost.
Alleviation:
The Xcaliswap team evaluated this exhibit but opted not to apply any changes for it in the current iteration of the protocol.
MRE-03C: Inexistent Error Messages
Type | Severity | Location |
---|---|---|
Code Style | ![]() | Minter.sol:L35, L64 |
Description:
The linked require
checks have no error messages explicitly defined.
Example:
35require(msg.sender == admin);
Recommendation:
We advise each to be set so to increase the legibility of the codebase and aid in validating the require
checks' conditions.
Alleviation:
The Xcaliswap team evaluated this exhibit but opted not to apply any changes for it in the current iteration of the protocol.
MRE-04C: Order of Operation Legibility Increase
Type | Severity | Location |
---|---|---|
Code Style | ![]() | Minter.sol:L52, L71, L90 |
Description:
The linked operations are performed without grouping of proper multipliers and divisors significantly reducing their legibility.
Example:
90return weekly * emissions * circulating_supply() / target_base / _token.totalSupply() * boost / 10000;
Recommendation:
We advise the numerators and denominators to be properly grouped (i.e. (a * emissions) / target_base
) to significantly increase the legibility of the codebase.
Alleviation:
The Xcaliswap team evaluated this exhibit but opted not to apply any changes for it in the current iteration of the protocol.
MRE-05C: Repetitive Value Literal
Type | Severity | Location |
---|---|---|
Code Style | ![]() | Minter.sol:L16, L90 |
Description:
The linked value literal is repeated across the codebase multiple times.
Example:
16uint internal constant target_base = 10000; // 2% per week target emission
Recommendation:
We advise it to be set to a constant
variable instead optimizing the legibility of the codebase.
Alleviation:
The Xcaliswap team has fixed this issue.