Omniscia vfat Audit

SickleRegistry Static Analysis Findings

SickleRegistry Static Analysis Findings

SRY-01S: Illegible Numeric Value Representation

Description:

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

Example:

contracts/SickleRegistry.sol
126if (feesArray[i] <= 500) {

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 (6ab7af3bb495b817ffec469255ea679b1813eecb):

The vfat team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.

SRY-02S: Inexistent Event Emission

Description:

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

Example:

contracts/SickleRegistry.sol
51constructor(address admin_, address collector_) Admin(admin_) {
52 collector = collector_;
53}

Recommendation:

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

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The vfat team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.

SRY-03S: Inexistent Sanitization of Input Address

Description:

The linked function accepts an address argument yet does not properly sanitize it.

Impact:

The presence of zero-value addresses, especially in constructor implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.

Example:

contracts/SickleRegistry.sol
51constructor(address admin_, address collector_) Admin(admin_) {
52 collector = collector_;
53}

Recommendation:

We advise some basic sanitization to be put in place by ensuring that the address specified is non-zero.

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The vfat team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.

SRY-04S: Multiple Top-Level Declarations

Description:

The referenced file contains multiple top-level declarations that decrease the legibility of the codebase.

Example:

contracts/SickleRegistry.sol
6library SickleRegistryEvents {
7 event CollectorChanged(address newCollector);
8 event FeesUpdated(bytes32[] feeHashes, uint256[] feesInBP);
9 event ReferralCodeCreated(bytes32 indexed code, address indexed referrer);
10
11 // Multicall caller and target whitelist status changes
12 event CallerStatusChanged(address caller, bool isWhitelisted);
13 event TargetStatusChanged(address target, bool isWhitelisted);
14}
15
16/// @title SickleRegistry contract
17/// @author vfat.tools
18/// @notice Manages the whitelisted contracts and the collector address
19contract SickleRegistry is Admin {

Recommendation:

We advise all highlighted top-level declarations to be split into their respective code files, avoiding unnecessary imports as well as increasing the legibility of the codebase.

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The vfat team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.