From 4682c723383672a8409d00ef0f75ae1a6c26e54a Mon Sep 17 00:00:00 2001 From: Vaibhav Valecha Date: Fri, 13 Sep 2024 01:55:08 -0500 Subject: [PATCH] fix burnshares --- src/EETH.sol | 2 +- test/EETH.t.sol | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/EETH.sol b/src/EETH.sol index 51a3d0995..4acdf5089 100644 --- a/src/EETH.sol +++ b/src/EETH.sol @@ -80,7 +80,7 @@ contract EETH is IERC20Upgradeable, UUPSUpgradeable, OwnableUpgradeable, IERC20P } function burnShares(address _user, uint256 _share) external { - require(msg.sender == address(liquidityPool) || msg.sender == _user, "Incorrect Caller"); + require(msg.sender == address(liquidityPool), "Incorrect Caller"); require(shares[_user] >= _share, "BURN_AMOUNT_EXCEEDS_BALANCE"); shares[_user] -= _share; totalShares -= _share; diff --git a/test/EETH.t.sol b/test/EETH.t.sol index 591fa8dff..f66ad43f0 100644 --- a/test/EETH.t.sol +++ b/test/EETH.t.sol @@ -54,20 +54,6 @@ contract EETHTest is TestSetup { assertEq(eETHInstance.shares(alice), 75); assertEq(eETHInstance.totalShares(), 75); - - vm.prank(alice); - eETHInstance.burnShares(alice, 25); - - assertEq(eETHInstance.shares(alice), 50); - assertEq(eETHInstance.totalShares(), 50); - - vm.expectRevert("BURN_AMOUNT_EXCEEDS_BALANCE"); - vm.prank(alice); - eETHInstance.burnShares(alice, 100); - - vm.expectRevert("Incorrect Caller"); - vm.prank(bob); - eETHInstance.burnShares(alice, 50); } function test_EEthRebase() public {