Skip to content

Commit

Permalink
chore: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
detectivekim committed Aug 28, 2024
1 parent 7f84d1f commit 91eb0e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Controller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ contract Controller is IController, ILocker, ReentrancyGuard {
}

function _limit(LimitOrderParams memory params) internal returns (OrderId id) {
(bool isQuoteRemaining, uint256 spentBaseAmount) = _spend(
(bool isQuoteRemained, uint256 spentQuoteAmount) = _spend(
SpendOrderParams({
id: params.takeBookId,
limitPrice: params.limitPrice,
Expand All @@ -305,8 +305,8 @@ contract Controller is IController, ILocker, ReentrancyGuard {
hookData: params.takeHookData
})
);
params.quoteAmount -= spentBaseAmount;
if (isQuoteRemaining) {
params.quoteAmount -= spentQuoteAmount;
if (isQuoteRemained) {
id = _make(
MakeOrderParams({
id: params.makeBookId,
Expand Down Expand Up @@ -349,18 +349,18 @@ contract Controller is IController, ILocker, ReentrancyGuard {
if (params.maxBaseAmount < spentBaseAmount) revert ControllerSlippage();
}

function _spend(SpendOrderParams memory params) internal returns (bool isBaseRemaining, uint256 spentBaseAmount) {
function _spend(SpendOrderParams memory params) internal returns (bool isBaseRemained, uint256 spentBaseAmount) {
uint256 takenQuoteAmount;
IBookManager.BookKey memory key = bookManager.getBookKey(params.id);

while (spentBaseAmount < params.baseAmount) {
if (bookManager.isEmpty(params.id)) {
isBaseRemaining = true;
isBaseRemained = true;
break;
}
Tick tick = bookManager.getHighest(params.id);
if (params.limitPrice > tick.toPrice()) {
isBaseRemaining = true;
isBaseRemained = true;
break;
}
uint256 maxAmount;
Expand Down

0 comments on commit 91eb0e4

Please sign in to comment.