Skip to content

Commit

Permalink
Consistent paramater naming, add underscore prefix to _tick
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSamWitch committed May 7, 2024
1 parent aff4436 commit 20d1702
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/SamWitchOrderBook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ contract SamWitchOrderBook is ISamWitchOrderBook, ERC1155Holder, UUPSUpgradeable
uint72 _price,
uint _orderId,
uint _quantity,
int128 _tickIncrement // -1 for buy, +1 for sell
int128 _tick // -1 for buy, +1 for sell
) private returns (uint72 price_) {
// Add to the bids section
price_ = _price;
Expand All @@ -833,7 +833,7 @@ contract SamWitchOrderBook is ISamWitchOrderBook, ERC1155Holder, UUPSUpgradeable
) {
// Loop until we find a suitable place to put this
while (true) {
price_ = uint72(uint128(int72(price_) + _tickIncrement));
price_ = uint72(uint128(int72(price_) + _tick));
if (!_tree.exists(price_)) {
_tree.insert(price_);
break;
Expand Down Expand Up @@ -879,7 +879,7 @@ contract SamWitchOrderBook is ISamWitchOrderBook, ERC1155Holder, UUPSUpgradeable

function _addToBook(
uint40 _newOrderId,
uint128 tick,
uint128 _tick,
OrderSide _side,
uint _tokenId,
uint72 _price,
Expand All @@ -889,9 +889,9 @@ contract SamWitchOrderBook is ISamWitchOrderBook, ERC1155Holder, UUPSUpgradeable
uint72 price;
// Price can update if the price level is at capacity
if (_side == OrderSide.Buy) {
price = _addToBookSide(bidsAtPrice[_tokenId], bids[_tokenId], _price, _newOrderId, _quantity, -int128(tick));
price = _addToBookSide(bidsAtPrice[_tokenId], bids[_tokenId], _price, _newOrderId, _quantity, -int128(_tick));
} else {
price = _addToBookSide(asksAtPrice[_tokenId], asks[_tokenId], _price, _newOrderId, _quantity, int128(tick));
price = _addToBookSide(asksAtPrice[_tokenId], asks[_tokenId], _price, _newOrderId, _quantity, int128(_tick));
}
emit AddedToBook(_msgSender(), _side, _newOrderId, _tokenId, price, _quantity);
}
Expand Down

0 comments on commit 20d1702

Please sign in to comment.