diff --git a/contracts/plugins/trading/DutchTrade.sol b/contracts/plugins/trading/DutchTrade.sol index 16a43733de..8d37c21ebb 100644 --- a/contracts/plugins/trading/DutchTrade.sol +++ b/contracts/plugins/trading/DutchTrade.sol @@ -13,6 +13,7 @@ interface IDutchTradeCallee { function dutchTradeCallback( address caller, address buyToken, + // {qBuyTok} uint256 buyAmount, bytes calldata data ) external; @@ -219,7 +220,7 @@ contract DutchTrade is ITrade { broker.reportViolation(); } sell.safeTransfer(bidder, lot()); // {qSellTok} - uint256 balanceBefore = buy.balanceOf(address(this)); + uint256 balanceBefore = buy.balanceOf(address(this)); // {qBuyTok} IDutchTradeCallee(bidder).dutchTradeCallback(bidder, address(buy), amountIn, data); require( amountIn <= buy.balanceOf(address(this)) - balanceBefore, diff --git a/contracts/plugins/trading/DutchTradeRouter.sol b/contracts/plugins/trading/DutchTradeRouter.sol index 304d42a482..f39d356329 100644 --- a/contracts/plugins/trading/DutchTradeRouter.sol +++ b/contracts/plugins/trading/DutchTradeRouter.sol @@ -15,7 +15,7 @@ contract DutchTradeRouter is IDutchTradeCallee { IERC20 sellToken; /// @notice The amount of tokenIn the protocol got {qSellAmt} uint256 sellAmt; - /// @notice The token bought from the trade + /// @notice The token bought from the trade IERC20 buyToken; /// @notice The amount of tokenOut the we got {qBuyAmt} uint256 buyAmt; @@ -26,9 +26,9 @@ contract DutchTradeRouter is IDutchTradeCallee { /// @param trade The DutchTrade that was bid on /// @param bidder The address of the bidder /// @param sellToken The token being sold by the protocol - /// @param soldAmt The amount of sellToken sold + /// @param soldAmt The amount of sellToken sold {qSellToken} /// @param buyToken The token being bought by the protocol - /// @param boughtAmt The amount of buyToken bought + /// @param boughtAmt The amount of buyToken bought {qBuyToken} event BidPlaced( IMain main, DutchTrade trade, @@ -55,7 +55,7 @@ contract DutchTradeRouter is IDutchTradeCallee { /// @notice Callback for DutchTrade /// @param caller The caller of the callback, should be the router /// @param buyToken The token DutchTrade is expecting to receive - /// @param buyAmount The amt the DutchTrade is expecting to receive + /// @param buyAmount The amt the DutchTrade is expecting to receive {qBuyToken} /// @notice Data is not used here function dutchTradeCallback( address caller, @@ -65,7 +65,7 @@ contract DutchTradeRouter is IDutchTradeCallee { ) external { require(caller == address(this), "Invalid caller"); require(msg.sender == address(_currentTrade), "Incorrect callee"); - IERC20(buyToken).safeTransfer(msg.sender, buyAmount); + IERC20(buyToken).safeTransfer(msg.sender, buyAmount); // {qBuyToken} } function _sendBalanceTo(IERC20 token, address to) internal { @@ -88,14 +88,14 @@ contract DutchTradeRouter is IDutchTradeCallee { out.buyAmt = trade.bidAmount(block.number); // {qBuyToken} out.buyToken.safeTransferFrom(bidder, address(this), out.buyAmt); - uint256 sellAmt = out.sellToken.balanceOf(address(this)); // {qSellToken} + uint256 sellAmt = out.sellToken.balanceOf(address(this)); // {qSellToken} uint256 expectedSellAmt = trade.lot(); // {qSellToken} trade.bid(new bytes(0)); - sellAmt = out.sellToken.balanceOf(address(this)) - sellAmt; // {qSellToken} + sellAmt = out.sellToken.balanceOf(address(this)) - sellAmt; // {qSellToken} require(sellAmt >= expectedSellAmt, "insufficient amount out"); - out.sellAmt = sellAmt; // {qSellToken} + out.sellAmt = sellAmt; // {qSellToken} _currentTrade = DutchTrade(address(0)); emit BidPlaced(