mirror of
https://github.com/Instadapp/dsa-connectors-2.0.git
synced 2024-07-29 21:57:39 +00:00
feat: add prettier
This commit is contained in:
parent
cf32e436f1
commit
1e4a1d9574
|
|
@ -1,7 +1,6 @@
|
||||||
//SPDX-License-Identifier: MIT
|
//SPDX-License-Identifier: MIT
|
||||||
pragma solidity ^0.8.2;
|
pragma solidity ^0.8.2;
|
||||||
pragma experimental ABIEncoderV2;
|
import {MarketParams} from "./interfaces/IMorpho.sol";
|
||||||
import { MarketParams } from "./interfaces/IMorpho.sol";
|
|
||||||
|
|
||||||
contract Events {
|
contract Events {
|
||||||
event LogSupplyAssets(
|
event LogSupplyAssets(
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
//SPDX-License-Identifier: MIT
|
//SPDX-License-Identifier: MIT
|
||||||
pragma solidity ^0.8.2;
|
pragma solidity ^0.8.2;
|
||||||
|
|
||||||
import { Id, IMorpho, MarketParams, Position, Market } from "./interfaces/IMorpho.sol";
|
import {Id, IMorpho, MarketParams, Position, Market} from "./interfaces/IMorpho.sol";
|
||||||
import "../../common/stores.sol";
|
import "../../common/stores.sol";
|
||||||
import "../../common/basic.sol";
|
import "../../common/basic.sol";
|
||||||
import "../../common/interfaces.sol";
|
import "../../common/interfaces.sol";
|
||||||
import { MorphoBalancesLib } from "./libraries/periphery/MorphoBalancesLib.sol";
|
import {MorphoBalancesLib} from "./libraries/periphery/MorphoBalancesLib.sol";
|
||||||
import { UtilsLib } from "./libraries/UtilsLib.sol";
|
import {UtilsLib} from "./libraries/UtilsLib.sol";
|
||||||
import { MarketParamsLib } from "./libraries/MarketParamsLib.sol";
|
import {MarketParamsLib} from "./libraries/MarketParamsLib.sol";
|
||||||
|
|
||||||
abstract contract Helpers is Stores, Basic {
|
abstract contract Helpers is Stores, Basic {
|
||||||
using MorphoBalancesLib for IMorpho;
|
using MorphoBalancesLib for IMorpho;
|
||||||
|
|
@ -65,11 +65,7 @@ abstract contract Helpers is Stores, Basic {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform conversion if necessary
|
// Perform conversion if necessary
|
||||||
convertEthToWeth(
|
convertEthToWeth(true, TokenInterface(_marketParams.loanToken), _amt);
|
||||||
true,
|
|
||||||
TokenInterface(_marketParams.loanToken),
|
|
||||||
_amt
|
|
||||||
);
|
|
||||||
|
|
||||||
return (_marketParams, _amt);
|
return (_marketParams, _amt);
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +100,12 @@ abstract contract Helpers is Stores, Basic {
|
||||||
_assets = _maxAvailable;
|
_assets = _maxAvailable;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(uint256 totalSupplyAssets, uint256 totalSupplyShares, , ) = MORPHO_BLUE.expectedMarketBalances(_marketParams);
|
(
|
||||||
|
uint256 totalSupplyAssets,
|
||||||
|
uint256 totalSupplyShares,
|
||||||
|
,
|
||||||
|
|
||||||
|
) = MORPHO_BLUE.expectedMarketBalances(_marketParams);
|
||||||
|
|
||||||
_assets = _toAssetsUp(
|
_assets = _toAssetsUp(
|
||||||
_shareAmt,
|
_shareAmt,
|
||||||
|
|
@ -132,13 +133,10 @@ abstract contract Helpers is Stores, Basic {
|
||||||
|
|
||||||
uint256 _shareAmt = MORPHO_BLUE.position(_id, _onBehalf).supplyShares;
|
uint256 _shareAmt = MORPHO_BLUE.position(_id, _onBehalf).supplyShares;
|
||||||
|
|
||||||
(uint256 totalSupplyAssets, uint256 totalSupplyShares, , ) = MORPHO_BLUE.expectedMarketBalances(_marketParams);
|
(uint256 totalSupplyAssets, uint256 totalSupplyShares, , ) = MORPHO_BLUE
|
||||||
|
.expectedMarketBalances(_marketParams);
|
||||||
|
|
||||||
_assets = _toAssetsUp(
|
_assets = _toAssetsUp(_shareAmt, totalSupplyAssets, totalSupplyShares);
|
||||||
_shareAmt,
|
|
||||||
totalSupplyAssets,
|
|
||||||
totalSupplyShares
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice Calculates the value of `shares` quoted in assets, rounding up.
|
/// @notice Calculates the value of `shares` quoted in assets, rounding up.
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ pragma solidity ^0.8.2;
|
||||||
|
|
||||||
import "./helpers.sol";
|
import "./helpers.sol";
|
||||||
import "./events.sol";
|
import "./events.sol";
|
||||||
import { MarketParamsLib } from "./libraries/MarketParamsLib.sol";
|
import {MarketParamsLib} from "./libraries/MarketParamsLib.sol";
|
||||||
|
|
||||||
abstract contract MorphoBlue is Helpers, Events {
|
abstract contract MorphoBlue is Helpers, Events {
|
||||||
using MarketParamsLib for MarketParams;
|
using MarketParamsLib for MarketParams;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user