Skip to content

Commit f4c32dd

Browse files
authored
Merge pull request #841 from morpho-org/docs/burn-shares
docs: burn shares
2 parents 169044e + 01de977 commit f4c32dd

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

src/adapters/MorphoMarketV1Adapter.sol

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ import {
2626
/// @dev Markets get removed from the marketIds when the allocation is zero, but it doesn't mean that the adapter has
2727
/// zero shares on the market.
2828
/// @dev This adapter can only be used for markets with the adaptive curve irm.
29+
/// @dev Donated shares are lost forever.
30+
///
31+
/// BURN SHARES
32+
/// @dev When submitting burnShares, it's recommended to put the caps of the market to zero to avoid losing more.
33+
/// @dev Burning shares takes time, so reactive depositors might be able to exit before the share price reduction.
34+
/// @dev It is possible to burn the shares of a market whose IRM reverts.
35+
/// @dev Burnt shares are lost forever.
2936
contract MorphoMarketV1Adapter is IMorphoMarketV1Adapter {
3037
using MarketParamsLib for MarketParams;
3138
using SharesMathLib for uint256;
@@ -106,7 +113,6 @@ contract MorphoMarketV1Adapter is IMorphoMarketV1Adapter {
106113
emit BurnShares(marketId, supplySharesBefore);
107114
}
108115

109-
/// @dev Does not log anything because the ids (logged in the parent vault) are enough.
110116
/// @dev Returns the ids of the allocation and the change in allocation.
111117
function allocate(bytes memory data, uint256 assets, bytes4, address) external returns (bytes32[] memory, int256) {
112118
MarketParams memory marketParams = abi.decode(data, (MarketParams));
@@ -133,7 +139,6 @@ contract MorphoMarketV1Adapter is IMorphoMarketV1Adapter {
133139
return (ids(marketParams), int256(newAllocation) - int256(oldAllocation));
134140
}
135141

136-
/// @dev Does not log anything because the ids (logged in the parent vault) are enough.
137142
/// @dev Returns the ids of the deallocation and the change in allocation.
138143
function deallocate(bytes memory data, uint256 assets, bytes4, address)
139144
external

src/adapters/interfaces/IMorphoMarketV1Adapter.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ interface IMorphoMarketV1Adapter is IAdapter {
1010

1111
event SetSkimRecipient(address indexed newSkimRecipient);
1212
event Skim(address indexed token, uint256 assets);
13-
event SubmitBurnShares(bytes32 indexed id, uint256 executableAt);
14-
event RevokeBurnShares(bytes32 indexed id);
15-
event BurnShares(bytes32 indexed id, uint256 supplyShares);
13+
event SubmitBurnShares(bytes32 indexed marketId, uint256 executableAt);
14+
event RevokeBurnShares(bytes32 indexed marketId);
15+
event BurnShares(bytes32 indexed marketId, uint256 supplyShares);
1616
event Allocate(bytes32 indexed marketId, uint256 newAllocation, uint256 mintedShares);
1717
event Deallocate(bytes32 indexed marketId, uint256 newAllocation, uint256 burnedShares);
1818

@@ -40,14 +40,14 @@ interface IMorphoMarketV1Adapter is IAdapter {
4040
function marketIdsLength() external view returns (uint256);
4141
function allocation(MarketParams memory marketParams) external view returns (uint256);
4242
function expectedSupplyAssets(bytes32 marketId) external view returns (uint256);
43-
function burnSharesExecutableAt(bytes32 id) external view returns (uint256);
43+
function burnSharesExecutableAt(bytes32 marketId) external view returns (uint256);
4444
function ids(MarketParams memory marketParams) external view returns (bytes32[] memory);
4545

4646
/* NON-VIEW FUNCTIONS */
4747

48-
function submitBurnShares(bytes32 id) external;
49-
function revokeBurnShares(bytes32 id) external;
50-
function burnShares(bytes32 id) external;
48+
function submitBurnShares(bytes32 marketId) external;
49+
function revokeBurnShares(bytes32 marketId) external;
50+
function burnShares(bytes32 marketId) external;
5151
function setSkimRecipient(address newSkimRecipient) external;
5252
function skim(address token) external;
5353
}

0 commit comments

Comments
 (0)