update version

This commit is contained in:
q1q0 2023-11-17 13:10:51 -05:00
parent ee2435ab29
commit 19d03f06f3
7 changed files with 567 additions and 3327 deletions

View File

@ -1,6 +1,6 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma abicoder v2;
pragma experimental ABIEncoderV2;
interface TokenInterface {
function approve(address, uint256) external;

View File

@ -1,6 +1,6 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// pragma experimental ABIEncoderV2;
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
contract Events {

View File

@ -1,6 +1,6 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// pragma experimental ABIEncoderV2;
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./interface.sol";
import "../../common/stores.sol";
@ -35,7 +35,7 @@ abstract contract Helpers is Stores, Basic {
uint256 internal constant MARKET_PARAMS_BYTES_LENGTH = 5 * 32;
/// @notice Returns the id of the market `marketParams`.
function id(MarketParams memory marketParams) internal pure returns (Id marketParamsId) {
function id(MarketParams memory marketParams) internal pure returns (bytes32 marketParamsId) {
assembly {
marketParamsId := keccak256(marketParams, MARKET_PARAMS_BYTES_LENGTH)
}

View File

@ -1,7 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
type Id is bytes32;
// type Id is bytes32;
struct MarketParams {
address loanToken;
@ -59,6 +60,6 @@ interface IMorpho {
function withdrawCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, address receiver) external;
function position(Id id, address user) external view returns(Position memory);
function position(bytes32 id, address user) external view returns(Position memory);
}

View File

@ -1,5 +1,6 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./helpers.sol";
import "./events.sol";
@ -208,7 +209,7 @@ abstract contract MorphoBlue is Helpers, Events {
uint256 _amt = getUint(_getId, _assets);
if (_amt == uint256(-1)) {
Id _id = id(_marketParams);
bytes32 _id = id(_marketParams);
Position memory _pos = MORPHO_BLUE.position(_id, _onBehalf);
_amt = _pos.collateral;
}
@ -255,8 +256,8 @@ abstract contract MorphoBlue is Helpers, Events {
bool _isMax
) = _performEthToWethConversion(_marketParams.loanToken, _assets, _getId);
if (_isMax) {
Id _id = id(_marketParams);
Position memory _pos = MORPHO_BLUE.position(_id, _onBehalf);
bytes32 _id = id(_marketParams);
Position memory _pos = MORPHO_BLUE.position(_id, address(this));
_amt = _pos.collateral;
}
address originToken = _marketParams.loanToken;

3866
yarn.lock

File diff suppressed because it is too large Load Diff