Omniscia Seen Haus Audit

AuctionRunnerFacet Code Style Findings

AuctionRunnerFacet Code Style Findings

ARF-01C: Inexistent Visibility Specifier

TypeSeverityLocation
Code StyleInformationalAuctionRunnerFacet.sol:L20

Description:

The linked variable has no visibility specifier explicitly set.

Example:

contracts/market/handlers/facets/AuctionRunnerFacet.sol
19// Threshold to auction extension window
20uint256 constant extensionWindow = 15 minutes;

Recommendation:

We advise one to be set so to avoid potential compilation discrepancies in the future as the current behaviour is for the compiler to assign one automatically which may differ between pragma versions.

Alleviation:

The public visibility specifier was introduced for the linked variable.

ARF-02C: Redundant Value Assignment

TypeSeverityLocation
Gas OptimizationInformationalAuctionRunnerFacet.sol:L148

Description:

The value of endTime is written to redundantly as it is not re-used.

Example:

contracts/market/handlers/facets/AuctionRunnerFacet.sol
137// If this was the first successful bid...
138 if (auction.state == State.Pending) {
139
140 // First bid updates auction state to Running
141 auction.state = State.Running;
142
143 // For auctions where clock is triggered by first bid, update start time
144 if (auction.clock == Clock.Trigger) {
145
146 // Set start time
147 auction.start = block.timestamp;
148 endTime = auction.start + auction.duration;
149
150 }
151
152 // Notify listeners of state change
153 emit AuctionStarted(consignment.id);
154
155 } else {
156
157 // Should not apply to first bid
158 // For bids placed within the extension window
159 // Extend the duration so that auction still lasts for the length of the extension window
160 if ((block.timestamp + extensionWindow) >= endTime) {
161 auction.duration += (extensionWindow - (endTime - block.timestamp));
162 emit AuctionExtended(_consignmentId);
163 }
164
165 }
166
167 mhs.auctions[_consignmentId] = auction;
168
169 // Announce the bid
170 emit BidAccepted(_consignmentId, auction.buyer, auction.bid);
171
172}

Recommendation:

We advise the assignment to be omitted from the codebase.

Alleviation:

The redundant value assignment has been safely omitted from the codebase.