Skip to content

Commit eb61f73

Browse files
committed
(docs) refactor comments
1 parent d032ae8 commit eb61f73

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

contracts/Basket.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ contract Basket is StandardToken {
4848

4949
// Modifiers
5050
modifier onlyArranger {
51-
require(msg.sender == arranger); // "Only the Arranger can call this function"
51+
require(msg.sender == arranger); // Check: "Only the Arranger can call this function"
5252
_;
5353
}
5454

@@ -79,7 +79,7 @@ contract Basket is StandardToken {
7979
address _arrangerFeeRecipient,
8080
uint _arrangerFee // in wei, i.e. 1e18 = 1 ETH
8181
) public {
82-
// "Constructor: invalid number of tokens and weights"
82+
// Check: "Constructor: invalid number of tokens and weights"
8383
require(_tokens.length > 0 && _tokens.length == _weights.length);
8484

8585
name = _name;
@@ -109,7 +109,7 @@ contract Basket is StandardToken {
109109
// charging suppliers a fee for every new basket minted
110110
// skip fees if tokens are minted through swaps
111111
if (arrangerFee > 0) {
112-
// "Insufficient ETH for arranger fee to bundle"
112+
// Check: "Insufficient ETH for arranger fee to bundle"
113113
require(msg.value >= arrangerFee.mul(_quantity).div(10 ** decimals));
114114
arrangerFeeRecipient.transfer(msg.value);
115115
} else {
@@ -144,7 +144,7 @@ contract Basket is StandardToken {
144144
address _sender,
145145
address _recipient
146146
) internal returns (bool success) {
147-
require(balances[_sender] >= _quantity); // Insufficient basket balance to debundle");
147+
require(balances[_sender] >= _quantity); // Check: "Insufficient basket balance to debundle"
148148
// decrease holder balance and total supply by _quantity
149149
balances[_sender] = balances[_sender].sub(_quantity);
150150
totalSupply_ = totalSupply_.sub(_quantity);
@@ -195,7 +195,7 @@ contract Basket is StandardToken {
195195
/// @param _newRecipient New fee recipient
196196
/// @return success Operation successful
197197
function changeArrangerFeeRecipient(address _newRecipient) public onlyArranger returns (bool success) {
198-
// "New receipient can not be 0x0 or the same as the current recipient"
198+
// Check: "New receipient can not be 0x0 or the same as the current recipient"
199199
require(_newRecipient != address(0) && _newRecipient != arrangerFeeRecipient);
200200
address oldRecipient = arrangerFeeRecipient;
201201
arrangerFeeRecipient = _newRecipient;
@@ -216,6 +216,6 @@ contract Basket is StandardToken {
216216
}
217217

218218
/// @dev Fallback to reject any ether sent to contract
219-
// "Baskets do not accept ETH transfers"
219+
// Check: "Baskets do not accept ETH transfers"
220220
function () public payable { revert(); }
221221
}

contracts/BasketEscrow.sol

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ contract BasketEscrow {
6767

6868
// Modifiers
6969
modifier onlyAdmin {
70-
require(msg.sender == admin); // "Only the admin can call this function"
70+
require(msg.sender == admin); // Check: "Only the admin can call this function"
7171
_;
7272
}
7373

@@ -164,11 +164,11 @@ contract BasketEscrow {
164164
internal
165165
returns (uint newOrderIndex)
166166
{
167-
require(_tokenGet == ETH_ADDRESS || basketRegistry.checkBasketExists(_tokenGet)); // "Order not for ETH or invalid basket"
168-
require(_tokenGive == ETH_ADDRESS || basketRegistry.checkBasketExists(_tokenGive)); // "Order not for ETH or invalid basket"
167+
require(_tokenGet == ETH_ADDRESS || basketRegistry.checkBasketExists(_tokenGet)); // Check: "Order not for ETH or invalid basket"
168+
require(_tokenGive == ETH_ADDRESS || basketRegistry.checkBasketExists(_tokenGive)); // Check: "Order not for ETH or invalid basket"
169169

170170
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expiration, _nonce);
171-
require(orders[_orderCreator][hash] == 0); // "Duplicate order"
171+
require(orders[_orderCreator][hash] == 0); // Check: "Duplicate order"
172172

173173
orders[_orderCreator][hash] = orderIndex;
174174
balances[_orderCreator][_tokenGive] = balances[_orderCreator][_tokenGive].add(_amountGive);
@@ -251,8 +251,8 @@ contract BasketEscrow {
251251
{
252252
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expiration, _nonce);
253253
uint cancelledOrderIndex = orders[_orderCreator][hash];
254-
require(cancelledOrderIndex > 0); // "Order does not exist"
255-
require(filledOrders[_orderCreator][hash] != true); // "Order has been filled"
254+
require(cancelledOrderIndex > 0); // Check: "Order does not exist"
255+
require(filledOrders[_orderCreator][hash] != true); // Check: "Order has been filled"
256256

257257
orders[_orderCreator][hash] = 0;
258258
balances[_orderCreator][_tokenGive] = balances[_orderCreator][_tokenGive].sub(_amountGive);
@@ -335,9 +335,9 @@ contract BasketEscrow {
335335
{
336336
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expiration, _nonce);
337337
uint filledOrderIndex = orders[_orderCreator][hash];
338-
require(filledOrderIndex > 0); // "Order does not exist"
339-
require(filledOrders[_orderCreator][hash] != true); // "Order has been filled"
340-
require(now <= _expiration); // "Order has expired"
338+
require(filledOrderIndex > 0); // Check: "Order does not exist"
339+
require(filledOrders[_orderCreator][hash] != true); // Check: "Order has been filled"
340+
require(now <= _expiration); // Check: "Order has expired"
341341

342342
filledOrders[_orderCreator][hash] = true;
343343
balances[_orderCreator][_tokenGive] = balances[_orderCreator][_tokenGive].sub(_amountGive);
@@ -390,6 +390,6 @@ contract BasketEscrow {
390390
}
391391

392392
/// @dev Fallback to reject any ether sent directly to contract
393-
// "BasketEscrow does not accept ETH transfers"
393+
// Check: "BasketEscrow does not accept ETH transfers"
394394
function () public payable { revert(); }
395395
}

contracts/BasketFactory.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ contract BasketFactory {
3939

4040
// Modifiers
4141
modifier onlyAdmin {
42-
require(msg.sender == admin); // "Only the admin can call this function"
42+
require(msg.sender == admin); // Check: "Only the admin can call this function"
4343
_;
4444
}
4545

@@ -85,7 +85,7 @@ contract BasketFactory {
8585
returns (address newBasket)
8686
{
8787
// charging arrangers a fee to deploy new basket
88-
require(msg.value >= productionFee); // "Insufficient ETH for basket creation fee"
88+
require(msg.value >= productionFee); // Check: "Insufficient ETH for basket creation fee"
8989
productionFeeRecipient.transfer(msg.value);
9090

9191
Basket b = new Basket(
@@ -130,6 +130,6 @@ contract BasketFactory {
130130
}
131131

132132
/// @dev Fallback to reject any ether sent to contract
133-
// "BasketFactory does not accept ETH transfers"
133+
// Check: "BasketFactory does not accept ETH transfers"
134134
function () public payable { revert(); }
135135
}

contracts/BasketRegistry.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ contract BasketRegistry {
6363

6464
// Modifiers
6565
modifier onlyBasket {
66-
require(basketIndexFromAddress[msg.sender] > 0); // "Only a basket can call this function"
66+
require(basketIndexFromAddress[msg.sender] > 0); // Check: "Only a basket can call this function"
6767
_;
6868
}
6969
modifier onlyBasketFactory {
70-
require(basketFactoryMap[msg.sender] == true); // "Only a basket factory can call this function"
70+
require(basketFactoryMap[msg.sender] == true); // Check: "Only a basket factory can call this function"
7171
_;
7272
}
7373

@@ -88,7 +88,7 @@ contract BasketRegistry {
8888
/// @param _basketFactory Basket factory address
8989
/// @return success Operation successful
9090
function whitelistBasketFactory(address _basketFactory) public returns (bool success) {
91-
require(msg.sender == admin); // "Only an admin can call this function"
91+
require(msg.sender == admin); // Check: "Only an admin can call this function"
9292
basketFactoryMap[_basketFactory] = true;
9393
emit LogWhitelistBasketFactory(_basketFactory);
9494
return true;
@@ -188,6 +188,6 @@ contract BasketRegistry {
188188
}
189189

190190
/// @dev Fallback to reject any ether sent to contract
191-
// "BasketRegistry does not accept ETH transfers"
191+
// CHeck: "BasketRegistry does not accept ETH transfers"
192192
function () public payable { revert(); }
193193
}

0 commit comments

Comments
 (0)