feat: No more fee taking
- This required an extra transfer into the router at the end of the swap sequence, costing an unnecessary 40k gas or more for certain protocols.
This commit is contained in:
committed by
Diana Carvalho
parent
5fe2c2715c
commit
6f2e5ac10e
@@ -10,8 +10,6 @@ import {SafeCallback} from "@uniswap/v4-periphery/src/base/SafeCallback.sol";
|
||||
contract TychoRouterTest is TychoRouterTestSetup {
|
||||
bytes32 public constant EXECUTOR_SETTER_ROLE =
|
||||
0x6a1dd52dcad5bd732e45b6af4e7344fa284e2d7d4b23b5b09cb55d36b0685c87;
|
||||
bytes32 public constant FEE_SETTER_ROLE =
|
||||
0xe6ad9a47fbda1dc18de1eb5eeb7d935e5e81b4748f3cfc61e233e64f88182060;
|
||||
bytes32 public constant PAUSER_ROLE =
|
||||
0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a;
|
||||
bytes32 public constant FUND_RESCUER_ROLE =
|
||||
@@ -133,32 +131,6 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
||||
vm.stopPrank();
|
||||
}
|
||||
|
||||
function testFeeSetting() public {
|
||||
vm.startPrank(FEE_SETTER);
|
||||
assertEq(tychoRouter.fee(), 0);
|
||||
tychoRouter.setFee(100);
|
||||
assertEq(tychoRouter.fee(), 100);
|
||||
vm.stopPrank();
|
||||
|
||||
vm.startPrank(BOB);
|
||||
vm.expectRevert();
|
||||
tychoRouter.setFee(200);
|
||||
vm.stopPrank();
|
||||
}
|
||||
|
||||
function testFeeReceiverSetting() public {
|
||||
vm.startPrank(FEE_SETTER);
|
||||
assertEq(tychoRouter.feeReceiver(), address(0));
|
||||
tychoRouter.setFeeReceiver(FEE_RECEIVER);
|
||||
assertEq(tychoRouter.feeReceiver(), FEE_RECEIVER);
|
||||
vm.stopPrank();
|
||||
|
||||
vm.startPrank(BOB);
|
||||
vm.expectRevert();
|
||||
tychoRouter.setFeeReceiver(FEE_RECEIVER);
|
||||
vm.stopPrank();
|
||||
}
|
||||
|
||||
function testPause() public {
|
||||
vm.startPrank(PAUSER);
|
||||
assertEq(tychoRouter.paused(), false);
|
||||
|
||||
Reference in New Issue
Block a user