Omniscia Badai Tech Audit

BadAI Static Analysis Findings

BadAI Static Analysis Findings

BAI-01S: Illegible Numeric Value Representation

TypeSeverityLocation
Code StyleBadAI.sol:L16

Description:

The linked representation of a numeric literal is sub-optimally represented decreasing the legibility of the codebase.

Example:

contracts/tokens/BadAI.sol
16_mint(msg.sender, 1000000000 ether);

Recommendation:

To properly illustrate the value's purpose, we advise the following guidelines to be followed. For values meant to depict fractions with a base of 1e18, we advise fractions to be utilized directly (i.e. 1e17 becomes 0.1e18) as they are supported. For values meant to represent a percentage base, we advise each value to utilize the underscore (_) separator to discern the percentage decimal (i.e. 10000 becomes 100_00, 300 becomes 3_00 and so on). Finally, for large numeric values we simply advise the underscore character to be utilized again to represent them (i.e. 1000000 becomes 1_000_000).

Alleviation (d639d227f8b8d90dbd9813ab9d7a5cbee34dd9b1):

The referenced value literal has been updated in its representation to 1_000_000_000 in accordance with the recommendation's underscore style, addressing this exhibit.

BAI-02S: Inexistent Event Emission

Description:

The linked function adjusts a sensitive contract variable yet does not emit an event for it.

Example:

contracts/tokens/BadAI.sol
20function updateTokenURI(string memory newURI) external onlyOwner {
21 tokenURI = newURI;
22}

Recommendation:

We advise an event to be declared and correspondingly emitted to ensure off-chain processes can properly react to this system adjustment.

Alleviation (d639d227f8b8d90dbd9813ab9d7a5cbee34dd9b1):

The TokenURIUpdated event was introduced to the codebase and is correspondingly emitted in the BadAI::updateTokenURI function, addressing this exhibit in full.