Skip to content

Commit

Permalink
Use msg.sender instead local var for gas improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Mar 1, 2023
1 parent e87949c commit 55f44a1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libraries/external/BorrowerActions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,9 @@ library BorrowerActions {
) external returns (
uint256 newLup_
) {
address borrowerAddress = msg.sender;
Borrower memory borrower = loans_.borrowers[borrowerAddress];
Borrower memory borrower = loans_.borrowers[msg.sender];

bool inAuction = _inAuction(auctions_, borrowerAddress);
bool inAuction = _inAuction(auctions_, msg.sender);

// revert if loan is in auction
if (inAuction) revert AuctionActive();
Expand All @@ -445,15 +444,15 @@ library BorrowerActions {
auctions_,
deposits_,
borrower,
borrowerAddress,
msg.sender,
poolState_.debt,
poolState_.rate,
newLup_,
false, // loan not in auction
true // stamp Neutral Price of the loan
);

emit LoanStamped(borrowerAddress);
emit LoanStamped(msg.sender);
}

/**********************/
Expand Down

0 comments on commit 55f44a1

Please sign in to comment.