From 6118e52c4e506b97f604b84bfdc92b664d65911a Mon Sep 17 00:00:00 2001 From: padraic Date: Wed, 8 Feb 2023 15:02:36 +0000 Subject: [PATCH] Invert BaseBufferExceedsShareReserves revert condition --- contracts/Hyperdrive.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/Hyperdrive.sol b/contracts/Hyperdrive.sol index 4452d7386..a37a299c4 100644 --- a/contracts/Hyperdrive.sol +++ b/contracts/Hyperdrive.sol @@ -280,7 +280,7 @@ contract Hyperdrive is MultiToken { // Since the base buffer may have increased relative to the base // reserves and the bond reserves decreased, we must ensure that the // base reserves are greater than the longsOutstanding. - if (sharePrice.mulDown(shareReserves) >= longsOutstanding) { + if (sharePrice.mulDown(shareReserves) < longsOutstanding) { revert Errors.BaseBufferExceedsShareReserves(); } @@ -381,7 +381,7 @@ contract Hyperdrive is MultiToken { // Since the share reserves are reduced, we need to verify that the base // reserves are greater than or equal to the amount of longs outstanding. - if (sharePrice.mulDown(shareReserves) >= longsOutstanding) { + if (sharePrice.mulDown(shareReserves) < longsOutstanding) { revert Errors.BaseBufferExceedsShareReserves(); }