Omniscia Evergon Labs Audit

AccessManagerOmnichainInternal Code Style Findings

AccessManagerOmnichainInternal Code Style Findings

AML-01C: Combination of Logical Clauses

Description:

The referenced if clauses' first segment is the same permitting them to be grouped under the same higher level condition.

Example:

contracts/dataIndex/omnichain/AccessManagerOmnichainInternal.sol
51if (dpChainId == localChainId && dmChainId == localChainId) {
52 _approveLocalDataManagerForLocalDataPoint(dp, dm, approved);
53} else if (dpChainId != localChainId && dmChainId == localChainId) {
54 _approveLocalDataManagerForRemoteDataPoint(dp, dm, approved);
55} else if (dpChainId == localChainId && dmChainId != localChainId) {
56 _approveRemoteDataManagerForLocalDataPoint(dp, dm, approved);
57} else {
58 revert("Approval of remote DataManager for remote DataPoint is not supported");
59}

Recommendation:

We advise this to be done so, optimizing the code's gas cost.

Alleviation (c6b23c23d8bcd8cce85049ad959cbd711a37126b):

The code was refactored per our recommendation, optimizing its gas cost as well as legibility.

AML-02C: Deprecated Revert Statements

TypeSeverityLocation
Code StyleAccessManagerOmnichainInternal.sol:
I-1: L58
I-2: L124

Description:

The referenced revert statements utilize a text literal which has been deprecated.

Example:

contracts/dataIndex/omnichain/AccessManagerOmnichainInternal.sol
58revert("Approval of remote DataManager for remote DataPoint is not supported");

Recommendation:

We advise them to utilize user-defined error declarations optimizing their legibility.

Alleviation (c6b23c23d8bcd8cce85049ad959cbd711a37126b):

A proper error declaration is emitted in the relevant revert statements, addressing this exhibit.