Skip to content

Conversation

@Menefail
Copy link

@Menefail Menefail commented Jan 13, 2026

Added a TradeExecuted event emitted whenever a trade is executed, improving on‑chain tracking.


Note

Adds on-chain trade logging to the exchange.

  • Declares TradeExecuted(address indexed buyer, address indexed seller, uint256 amount) in contracts/Exchange.sol
  • Emits TradeExecuted within executeTrade(buyer, seller, amount) after existing trade logic

Written by Cursor Bugbot for commit d118a7d. This will update automatically on new commits. Configure here.

Added a TradeExecuted event emitted whenever a trade is executed, improving on‑chain tracking.
function executeTrade(address buyer, address seller, uint256 amount) external {
// existing logic ...
emit TradeExecuted(buyer, seller, amount);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function emits trade event without executing any trade

High Severity

The executeTrade function emits a TradeExecuted event but contains no actual trade execution logic — only a placeholder comment // existing logic .... This means calling the function does nothing except emit an event, which misrepresents that a trade occurred when none did. Anyone can call this function and generate misleading on-chain trade records, potentially corrupting analytics and monitoring systems that rely on these events.

Fix in Cursor Fix in Web

function executeTrade(address buyer, address seller, uint256 amount) external {
// existing logic ...
emit TradeExecuted(buyer, seller, amount);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caller can emit trades attributed to arbitrary addresses

High Severity

The executeTrade function accepts buyer and seller as parameters without validating that msg.sender is one of the parties involved. This allows any caller to emit TradeExecuted events attributing trades to arbitrary addresses they don't control. This enables spoofing of trade records on-chain, potentially manipulating analytics, reputation systems, or any downstream logic that relies on trade attribution.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant