```\nfunction cancelOrder(LibOrder.Order memory order) public {\n    require(msg.sender == order.trader || msg.sender == order.broker, "invalid caller");\n\n    bytes32 orderHash = order.getOrderHash();\n    cancelled[orderHash] = true;\n\n    emit Cancel(orderHash);\n}\n```\n