Omniscia Nuklai Audit

VerifierManager Code Style Findings

VerifierManager Code Style Findings

VMR-01C: Inexistent Event Indexing

Description:

The FragmentPending, and FragmentResolved events of the VerifierManager contract do not contain any indexed arguments.

Example:

contracts/verifier/VerifierManager.sol
26event FragmentPending(uint256 id);
27event FragmentResolved(uint256 id, bool accept);

Recommendation:

We advise them to be introduced, particularly in relation to the id to ensure off-chain processes can optimally filter these events.

Alleviation (fb50b5c39665f7df086b2de1fdbf93ba2d836bf9):

The indexed keyword has been properly introduced to the id values as advised, optimizing their off-chain usability.

VMR-02C: Loop Iterator Optimization

Description:

The linked for loop increments / decrements the iterator "safely" due to Solidity's built-in safe arithmetics (post-0.8.X).

Example:

contracts/verifier/VerifierManager.sol
89for (uint256 i; i < tags.length; i++) {

Recommendation:

We advise the increment / decrement operation to be performed in an unchecked code block as the last statement within the for loop to optimize its execution cost.

Alleviation (fb50b5c39665f7df086b2de1fdbf93ba2d836bf9):

The referenced loop iterator's increment statement has been relocated at the end of the for loop's body and has been unwrapped in an unchecked code block, optimizing its gas cost.