Skip to content

Commit

Permalink
fix: reallocate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Dec 17, 2024
1 parent 0fc942a commit 53f5934
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,12 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
for (uint256 i; i < allocations.length; ++i) {
MarketAllocation memory allocation = allocations[i];
Id id = allocation.marketParams.id();
if (!config[id].enabled) revert ErrorsLib.MarketNotEnabled(id);

(uint256 supplyAssets, uint256 supplyShares,) = _accruedSupplyBalance(allocation.marketParams, id);
uint256 withdrawn = supplyAssets.zeroFloorSub(allocation.assets);

if (withdrawn > 0) {
if (!config[id].enabled) revert ErrorsLib.MarketNotEnabled(id);

// Guarantees that unknown frontrunning donations can be withdrawn, in order to disable a market.
uint256 shares;
if (allocation.assets == 0) {
Expand Down

0 comments on commit 53f5934

Please sign in to comment.