diff --git a/src/Liquifier.sol b/src/Liquifier.sol index 7d1d5ec3..01f71abc 100644 --- a/src/Liquifier.sol +++ b/src/Liquifier.sol @@ -291,7 +291,11 @@ contract Liquifier is Initializable, UUPSUpgradeable, OwnableUpgradeable, Pausab pausers[_address] = _isPauser; } - function updateQuoteStEthWithCurve(bool _quoteStEthWithCurve) external onlyOwner { + function updateDiscountInBasisPoints(address _token, uint16 _discountInBasisPoints) external onlyAdmin { + tokenInfos[_token].discountInBasisPoints = _discountInBasisPoints; + } + + function updateQuoteStEthWithCurve(bool _quoteStEthWithCurve) external onlyAdmin { quoteStEthWithCurve = _quoteStEthWithCurve; } diff --git a/test/Liquifier.t.sol b/test/Liquifier.t.sol index be5a4b49..7f6936d7 100644 --- a/test/Liquifier.t.sol +++ b/test/Liquifier.t.sol @@ -85,8 +85,10 @@ contract LiquifierTest is TestSetup { vm.deal(alice, 100 ether); - vm.prank(liquifierInstance.owner()); + vm.startPrank(liquifierInstance.owner()); liquifierInstance.updateQuoteStEthWithCurve(true); + liquifierInstance.updateDiscountInBasisPoints(address(stEth), 500); // 5% + vm.stopPrank(); vm.startPrank(alice); stEth.submit{value: 10 ether}(address(0)); @@ -94,7 +96,7 @@ contract LiquifierTest is TestSetup { liquifierInstance.depositWithERC20(address(stEth), 10 ether, address(0)); vm.stopPrank(); - assertGe(eETHInstance.balanceOf(alice), 10 ether - 0.1 ether); + assertApproxEqAbs(eETHInstance.balanceOf(alice), 10 ether - 0.5 ether, 0.1 ether); } function test_deopsit_stEth_and_swap() internal {