Omniscia Tangible Audit

UsdUsdOracle Code Style Findings

UsdUsdOracle Code Style Findings

UUO-01C: Generic Typographic Mistake

TypeSeverityLocation
Code StyleUsdUsdOracle.sol:L11

Description:

The referenced line contains a typographical mistake (i.e. private variable without an underscore prefix) or generic documentational error (i.e. copy-paste) that should be corrected.

Example:

contracts/priceOracles/UsdUsdOracle.sol
11address private pendingOwner;

Recommendation:

We advise this to be done so to enhance the legibility of the codebase.

Alleviation (2135afa89ec939270a06c8788220323822605345):

The underscore prefix has been properly introduced to the referenced private variable, addressing this exhibit.

UUO-02C: Inefficient Usage of Storage Variable

Description:

The referenced statement makes use of the owner variable from storage even though it has been validated as part of the Owned::onlyOwner modifier.

Example:

contracts/priceOracles/UsdUsdOracle.sol
24function transferOwnership(address _to) external onlyOwner {
25 pendingOwner = _to;
26
27 emit OwnershipTransferRequested(owner, _to);
28}

Recommendation:

We advise the code to use the msg.sender, optimizing the gas cost of the statement.

Alleviation (2135afa89ec939270a06c8788220323822605345):

The referenced event emission has been optimized, using the msg.sender instead of the owner variable and thus greatly optimizing the code's gas cost.

UUO-03C: Repetitive Value Literal

Description:

The linked value literal is repeated across the codebase multiple times.

Example:

contracts/priceOracles/UsdUsdOracle.sol
124return 1;

Recommendation:

We advise it to be set to a constant variable instead optimizing the legibility of the codebase.

Alleviation (2135afa89e):

All instances of 1 have been adequately replaced by one of the newly introduced contract-level constant declarations (ONE_INT256, ONE_UINT80, ONE_UINT256). However, the ZERO_UINT8 variable is incorrectly assigned to the value of 1 thus causing the contract to misbehave as it would yield incorrect price measurements at all times.

Alleviation (c51ba845fd):

The ZERO_UINT8 constant variable has been properly set to 0 per our recommendation, rendering this exhibit fully alleviated.