Skip to content

Commit

Permalink
docs: implement suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite committed Jul 5, 2023
1 parent d9cb441 commit 9b9ed18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Blue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b9ed18

Please sign in to comment.