From 9b9ed18cca94763e7fc9cf399766ee94bd9120de Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Wed, 5 Jul 2023 19:27:52 +0200 Subject: [PATCH] docs: implement suggestion --- src/Blue.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Blue.sol b/src/Blue.sol index 5554ee7f5..164870bad 100644 --- a/src/Blue.sol +++ b/src/Blue.sol @@ -146,12 +146,14 @@ contract Blue { // Collateral management. - /// @dev The interests are not accrued since no health check is required when supplying collateral. + /// @dev Don't accrue interests because it's not required and it saves gas. function supplyCollateral(Market calldata market, uint amount) external { Id id = Id.wrap(keccak256(abi.encode(market))); require(lastUpdate[id] != 0, "unknown market"); require(amount > 0, "zero amount"); + // Don't accrue interests because it's not required and it saves gas. + collateral[id][msg.sender] += amount; market.collateralAsset.safeTransferFrom(msg.sender, address(this), amount);