Omniscia Seen Haus Audit
AuctionRunnerFacet Code Style Findings
AuctionRunnerFacet Code Style Findings
ARF-01C: Inexistent Visibility Specifier
Type | Severity | Location |
---|---|---|
Code Style | Informational | AuctionRunnerFacet.sol:L20 |
Description:
The linked variable has no visibility specifier explicitly set.
Example:
contracts/market/handlers/facets/AuctionRunnerFacet.sol
19// Threshold to auction extension window20uint256 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
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | AuctionRunnerFacet.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 Running141 auction.state = State.Running;142
143 // For auctions where clock is triggered by first bid, update start time144 if (auction.clock == Clock.Trigger) {145
146 // Set start time147 auction.start = block.timestamp;148 endTime = auction.start + auction.duration;149
150 }151
152 // Notify listeners of state change153 emit AuctionStarted(consignment.id);154
155 } else {156
157 // Should not apply to first bid158 // For bids placed within the extension window159 // Extend the duration so that auction still lasts for the length of the extension window160 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 bid170 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.