diff --git a/src/Morpho.sol b/src/Morpho.sol index a91eefdca..cabaa4f60 100644 --- a/src/Morpho.sol +++ b/src/Morpho.sol @@ -74,6 +74,8 @@ contract Morpho is IMorpho { mapping(address => mapping(address => bool)) public isAuthorized; /// @inheritdoc IMorpho mapping(address => uint256) public nonce; + /// @inheritdoc IMorpho + mapping(Id => Market) public idToMarket; /* CONSTRUCTOR */ @@ -148,6 +150,7 @@ contract Morpho is IMorpho { require(lastUpdate[id] == 0, ErrorsLib.MARKET_CREATED); lastUpdate[id] = block.timestamp; + idToMarket[id] = market; emit EventsLib.CreateMarket(id, market); } diff --git a/src/interfaces/IMorpho.sol b/src/interfaces/IMorpho.sol index 2f0d44be2..06444c2c6 100644 --- a/src/interfaces/IMorpho.sol +++ b/src/interfaces/IMorpho.sol @@ -83,6 +83,12 @@ interface IMorpho is IFlashLender { /// @notice The `user`'s current nonce. Used to prevent replay attacks with EIP-712 signatures. function nonce(address user) external view returns (uint256); + /// @notice The market configuration corresponding to `id`. + function idToMarket(Id id) + external + view + returns (address borrowableAsset, address collateralAsset, address oracle, address irm, uint256 lltv); + /// @notice Sets `newOwner` as owner of the contract. function setOwner(address newOwner) external;