Skip to content

Commit

Permalink
refactor: move liquidate event after transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite committed Aug 3, 2023
1 parent a70a1e5 commit d1e6746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Blue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ contract Blue is IBlue {
borrowShares[id][borrower] = 0;
}

emit Events.Liquidate(id, msg.sender, borrower, repaid, repaidShares, seized, badDebtShares);

IERC20(market.collateralAsset).safeTransfer(msg.sender, seized);

emit Events.Liquidate(id, msg.sender, borrower, repaid, repaidShares, seized, badDebtShares);

if (data.length > 0) IBlueLiquidateCallback(msg.sender).onBlueLiquidate(seized, repaid, data);

IERC20(market.borrowableAsset).safeTransferFrom(msg.sender, address(this), repaid);
Expand Down

0 comments on commit d1e6746

Please sign in to comment.