Omniscia Tokemak Network Audit

EventProxy Code Style Findings

EventProxy Code Style Findings

EPY-01C: Deprecated if-revert Pattern

TypeSeverityLocation
Gas OptimizationInformationalEventProxy.sol:L117, L124

Description:

The linked pattern has been deprecated and can be replaced by a single require instruction.

Example:

contracts/event-proxy/EventProxy.sol
117if (index < 256 ** 2 - 1) {
118 // Shifts array over -1
119 for (uint256 i = index; i < destination.length-1; i++) {
120 destination[i] = destination[i + 1];
121 }
122 destination.pop();
123} else {
124 revert("DESTINATION_DOES_NOT_EXIST");
125}

Recommendation:

We advise the if structure to be removed and the if-revert clause to be replaced by a require statement.

Alleviation:

The if-revert pattern has been properly replaced by a single require check.