From 823f681ecc806b9f332e9c0e19ef6de8fd6e6c30 Mon Sep 17 00:00:00 2001 From: LeTamanoir Date: Sun, 24 Sep 2023 22:00:38 +0200 Subject: [PATCH] rephrase comments --- src/AbstractPriceSensor.sol | 12 ++++++------ test/utils/TestImplementation.sol | 5 ----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/AbstractPriceSensor.sol b/src/AbstractPriceSensor.sol index 4a54ca4..58e3d52 100644 --- a/src/AbstractPriceSensor.sol +++ b/src/AbstractPriceSensor.sol @@ -37,15 +37,15 @@ abstract contract AbstractPriceSensor is IPriceSensor { newBestOfferId ); - // newBestOffer.gives order.offer.gives() - // newBestPrice = ------------------ >= oldPrice = ------------------- - // newBestOffer.wants order.offer.wants() + // newBestOffer.wants order.offer.wants() + // newBestPrice = ------------------ >= oldPrice = ------------------- + // newBestOffer.gives order.offer.gives() // - // if newBestPrice is greater than oldPrice, then the stop loss was reached + // if newBestPrice is lower than oldPrice, then the stop loss was reached if ( - newBestOffer.gives * order.offer.wants() < - order.offer.gives() * newBestOffer.wants + order.offer.gives() * newBestOffer.wants >= + newBestOffer.gives * order.offer.wants() ) { __callbackOnStopLoss__(order); } diff --git a/test/utils/TestImplementation.sol b/test/utils/TestImplementation.sol index b008399..55ec7a7 100644 --- a/test/utils/TestImplementation.sol +++ b/test/utils/TestImplementation.sol @@ -10,8 +10,6 @@ import {IERC20} from "mgv_src/IERC20.sol"; import {AbstractPriceSensor} from "../../src/AbstractPriceSensor.sol"; contract TestImplementation is AbstractPriceSensor, Direct { - event TestEvent(uint256 indexed offerId); - /// The outbound token of the sensor IERC20 private immutable _outbound_tkn; /// The inbound token of the sensor @@ -68,9 +66,6 @@ contract TestImplementation is AbstractPriceSensor, Direct { function __callbackOnStopLoss__( MgvLib.SingleOrder calldata order ) internal virtual override { - // Do something with the sensor data - emit TestEvent(order.offerId); - // Call the default parent function (for logging) super.__callbackOnStopLoss__(order); } }