OrderBook

First Flight #43
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

Low: Missing OrderAmended Event Reduces Transparency and UX

Description

The contract allows sellers to adjust their orders by changing the amount or price. However, it does not emit an event when an order is amended. This reduces transparency and complicates tracking for off-chain services like indexers, analytics dashboards, or monitoring bots.

Without an OrderAmended event, there is no straightforward way for external systems to detect and respond to order updates, impacting the ecosystem's ability to monitor market changes in real-time.


Root + Impact

Normal Behavior:
When a seller amends an order, the internal order struct is updated to reflect the new amount or price.

Issue:
There is no event emitted after these updates.
External indexers and watchers have no on-chain signal that an order was changed, forcing them to continuously poll state which is inefficient and unreliable.

// @> Missing event emission after internal order adjustments.
order.price = newPrice;
order.amount = newAmount;
// No emit OrderAmended(...) here

This leads to:

  • Poor UX for dApps relying on real-time data,

  • Increased infrastructure load on indexers,

  • Potential for stale or misleading order book displays.


Risk

Likelihood

  • This occurs every time an order is amended since no event is ever emitted.

Impact

  • Primarily affects the user experience and the ecosystem tools that rely on event streams.

  • Can lead to outdated or incorrect UIs, reducing trader trust and utility.


Proof of Concept

function amendOrder(uint256 orderId, uint256 newAmount, uint256 newPrice) external {
Order storage order = orders[orderId];
require(msg.sender == order.seller, "Only seller can amend");
order.amount = newAmount;
order.price = newPrice;
// @> Should emit OrderAmended(orderId, newAmount, newPrice)
}

This example shows how the amendment changes the state without emitting any event, leaving external systems unaware of the modification.


Recommended Mitigation

+ event OrderAmended(uint256 indexed orderId, uint256 newAmount, uint256 newPrice);
function amendOrder(...) external {
...
+ emit OrderAmended(orderId, newAmount, newPrice);
}

This ensures that off-chain systems can reliably detect and react to order updates, improving overall transparency and user experience.

Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

Poor event indexing and asset token symbol not displayed

Events not properly indexed. Filtering and querying from analytic tools will be very in-efficient

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.