Skip to content

Commit

Permalink
add two features: pricing stETH using CurvePool, fixed fee to stETH d…
Browse files Browse the repository at this point in the history
…eposit
  • Loading branch information
seongyun-ko committed Oct 16, 2024
1 parent f052425 commit 6bb7c5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Liquifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 4 additions & 2 deletions test/Liquifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,18 @@ 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));
stEth.approve(address(liquifierInstance), 10 ether);
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 {
Expand Down

0 comments on commit 6bb7c5a

Please sign in to comment.