Omniscia Hot Cross Audit
CrossMint1155 Static Analysis Findings
CrossMint1155 Static Analysis Findings
CM5-01S: Boolean Literal Equality
| Type | Severity | Location |
|---|---|---|
| Code Style | Informational | CrossMint1155.sol:L34, L159 |
Description:
The linked statements perform a literal equality of a bool variable with true.
Example:
33modifier existsOnly(uint256 id) {34 require(exists[id] == true, "CrossMint1155: Only existing tokens");35 _;36}Recommendation:
We advise the literal equality to be omitted as the variables can be utilized as is. Additionally, we advise an internal or private function to be coded that conducts the require check and is utilized by the modifier and respective function.
Alleviation:
Our recommendation was followed and an assertIdExists function was declared that properly utilizes the bool value as is within the require statement.
CM5-02S: Variable Shadowing
| Type | Severity | Location |
|---|---|---|
| Language Specific | Informational | CrossMint1155.sol:L59 |
Description:
The linked variable shadows the declaration of an inherited contract.
Example:
56constructor(57 string memory _name,58 string memory _symbol,59 string memory uri,60 address owner61) MinterControl(owner, msg.sender) ERC1155(uri) {62 name = _name;63 symbol = _symbol;64
65 _setBaseURI(uri);66}Recommendation:
We strongly recommend it to be renamed to avoid the colission, such as by prefixing them or suffixing them with an underscore (_).
Alleviation:
The uri variable was properly suffixed with an underscore (_) thereby preventing a collision from occuring.