Skip to content

Commit

Permalink
Merge pull request #52 from morpho-labs/perf/remove-accrue-interest-s…
Browse files Browse the repository at this point in the history
…upplycollat

Remove accrue interest supplycollat
  • Loading branch information
MerlinEgalite authored Jul 6, 2023
2 parents 79848ae + 9b9ed18 commit 91e050d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Blue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@ contract Blue {

// Collateral management.

/// @dev Don't accrue interests because it's not required and it saves gas.
function supplyCollateral(Market calldata market, uint amount) external {
Id id = market.toId();
require(lastUpdate[id] != 0, "unknown market");
require(amount != 0, "zero amount");

accrueInterests(id);
// Don't accrue interests because it's not required and it saves gas.

collateral[id][msg.sender] += amount;

Expand Down

0 comments on commit 91e050d

Please sign in to comment.