Skip to content

Commit 927a7ee

Browse files
committed
add unit notation
1 parent 41793b7 commit 927a7ee

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

contracts/plugins/trading/DutchTrade.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface IDutchTradeCallee {
1313
function dutchTradeCallback(
1414
address caller,
1515
address buyToken,
16+
// {qBuyTok}
1617
uint256 buyAmount,
1718
bytes calldata data
1819
) external;
@@ -219,7 +220,7 @@ contract DutchTrade is ITrade {
219220
broker.reportViolation();
220221
}
221222
sell.safeTransfer(bidder, lot()); // {qSellTok}
222-
uint256 balanceBefore = buy.balanceOf(address(this));
223+
uint256 balanceBefore = buy.balanceOf(address(this)); // {qBuyTok}
223224
IDutchTradeCallee(bidder).dutchTradeCallback(bidder, address(buy), amountIn, data);
224225
require(
225226
amountIn <= buy.balanceOf(address(this)) - balanceBefore,

contracts/plugins/trading/DutchTradeRouter.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ contract DutchTradeRouter is IDutchTradeCallee {
1515
IERC20 sellToken;
1616
/// @notice The amount of tokenIn the protocol got {qSellAmt}
1717
uint256 sellAmt;
18-
/// @notice The token bought from the trade
18+
/// @notice The token bought from the trade
1919
IERC20 buyToken;
2020
/// @notice The amount of tokenOut the we got {qBuyAmt}
2121
uint256 buyAmt;
@@ -26,9 +26,9 @@ contract DutchTradeRouter is IDutchTradeCallee {
2626
/// @param trade The DutchTrade that was bid on
2727
/// @param bidder The address of the bidder
2828
/// @param sellToken The token being sold by the protocol
29-
/// @param soldAmt The amount of sellToken sold
29+
/// @param soldAmt The amount of sellToken sold {qSellToken}
3030
/// @param buyToken The token being bought by the protocol
31-
/// @param boughtAmt The amount of buyToken bought
31+
/// @param boughtAmt The amount of buyToken bought {qBuyToken}
3232
event BidPlaced(
3333
IMain main,
3434
DutchTrade trade,
@@ -55,7 +55,7 @@ contract DutchTradeRouter is IDutchTradeCallee {
5555
/// @notice Callback for DutchTrade
5656
/// @param caller The caller of the callback, should be the router
5757
/// @param buyToken The token DutchTrade is expecting to receive
58-
/// @param buyAmount The amt the DutchTrade is expecting to receive
58+
/// @param buyAmount The amt the DutchTrade is expecting to receive {qBuyToken}
5959
/// @notice Data is not used here
6060
function dutchTradeCallback(
6161
address caller,
@@ -65,7 +65,7 @@ contract DutchTradeRouter is IDutchTradeCallee {
6565
) external {
6666
require(caller == address(this), "Invalid caller");
6767
require(msg.sender == address(_currentTrade), "Incorrect callee");
68-
IERC20(buyToken).safeTransfer(msg.sender, buyAmount);
68+
IERC20(buyToken).safeTransfer(msg.sender, buyAmount); // {qBuyToken}
6969
}
7070

7171
function _sendBalanceTo(IERC20 token, address to) internal {
@@ -88,14 +88,14 @@ contract DutchTradeRouter is IDutchTradeCallee {
8888
out.buyAmt = trade.bidAmount(block.number); // {qBuyToken}
8989
out.buyToken.safeTransferFrom(bidder, address(this), out.buyAmt);
9090

91-
uint256 sellAmt = out.sellToken.balanceOf(address(this)); // {qSellToken}
91+
uint256 sellAmt = out.sellToken.balanceOf(address(this)); // {qSellToken}
9292

9393
uint256 expectedSellAmt = trade.lot(); // {qSellToken}
9494
trade.bid(new bytes(0));
9595

96-
sellAmt = out.sellToken.balanceOf(address(this)) - sellAmt; // {qSellToken}
96+
sellAmt = out.sellToken.balanceOf(address(this)) - sellAmt; // {qSellToken}
9797
require(sellAmt >= expectedSellAmt, "insufficient amount out");
98-
out.sellAmt = sellAmt; // {qSellToken}
98+
out.sellAmt = sellAmt; // {qSellToken}
9999

100100
_currentTrade = DutchTrade(address(0));
101101
emit BidPlaced(

0 commit comments

Comments
 (0)