F-2024-0011·gas-optimization

Unnecessary gas consumption in _authorizeUpgrade function

Acknowledgedbridgenearrainbow-bridgegithub.com/Near-One/rainbow-token-connector
TL;DR

_authorizeUpgrade has an empty body, consuming gas without doing useful work; emit an event so the call has observable effect.

Severity
INFO
Impact
LOW
Likelihood
LOW
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

In the Solidity contracts, the _authorizeUpgrade function is defined but contains an empty block. While this does not introduce any critical vulnerabilities, it leads to inefficient gas usage. Users or other contracts calling this function will incur gas costs for executing an empty block, which could be avoided.

03Section · Impact

Impact

The function _authorizeUpgrade currently has an empty block, which leads to unnecessary gas consumption without performing any useful operations. This results in inefficiency and minor additional costs for users interacting with the contract.

04Section · Recommendation

Recommendation

Consider emitting an event within the _authorizeUpgrade function to provide meaningful output and make the gas consumption justified. For example:

solidity
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {
emit UpgradeAuthorized(newImplementation);
}

Add the following event definition:

solidity
event UpgradeAuthorized(address indexed newImplementation);

This change will ensure that the function does something meaningful (emitting an event) and provides transparency regarding upgrades while avoiding unnecessary gas consumption.

05Section · Resolution

Resolution

Unresolved.

F-2024-0011

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx