Omniscia Etherlink Audit

WXTZToken Code Style Findings

WXTZToken Code Style Findings

WXT-01C: Inefficient Ownership Initialization

Description:

The WXTZToken::constructor will initialize ownership to the msg.sender before immediately transferring it to the _delegate which is inefficient.

Example:

contracts/WXTZToken.sol
30struct InitializationComponents {
31 address lzEndpoint;
32 address delegate;
33}
34
35/**
36 * @dev The contract constructor
37 */
38constructor(
39 address _lzEndpoint,
40 address _delegate

Recommendation:

We advise ownership of the contract to be initialized for the _delegate directly, optimizing the contract's deployment cost.

Alleviation:

The inefficient ownership initialization was addressed by updating the compilation structure to use the IR pipeline, permitting the _delegate argument to be used directly in the Ownable initialization statement.

WXT-02C: Inexistent Error Messages

TypeSeverityLocation
Code StyleWXTZToken.sol:L64, L86

Description:

The linked require checks have no error messages explicitly defined.

Example:

contracts/WXTZToken.sol
64* @param wad The amount of WXTZ to exchange for XTZ

Recommendation:

We advise each to be set so to increase the legibility of the codebase and aid in validating the require checks' conditions.

Alleviation:

Explicit and verbose error messages have been introduced in both require statements, addressing this exhibit.

WXT-03C: Repetitive Value Literals

TypeSeverityLocation
Code StyleWXTZToken.sol:L26, L85

Description:

The linked value literals are repeated across the codebase multiple times.

Example:

contracts/WXTZToken.sol
26require(block.chainid == 128123 || block.chainid == 42793);

Recommendation:

We advise each to be set to its dedicated constant variable instead, optimizing the legibility of the codebase.

In case some of the constant declarations have already been introduced, we advise them to be properly re-used across the code.

Alleviation:

The value literals are no longer present in the codebase as a result of remediations for WXT-02M, rendering the exhibit no longer applicable.