From 60225953613fdd7caab6101c76bfbeae843d8eb0 Mon Sep 17 00:00:00 2001 From: memerson Date: Sun, 5 Feb 2023 13:52:20 +0200 Subject: [PATCH] Revert "C4-136, C4-690: Adding duration and delegation fee bounds (#245)" (#267) This reverts commit 8b92375aea88ccc5dcc00640a1c6f15e12126f1d. --- contracts/contract/MinipoolManager.sol | 8 -------- test/unit/MinipoolManager.t.sol | 10 +++++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/contracts/contract/MinipoolManager.sol b/contracts/contract/MinipoolManager.sol index cb6f641..1b2cadc 100644 --- a/contracts/contract/MinipoolManager.sol +++ b/contracts/contract/MinipoolManager.sol @@ -223,14 +223,6 @@ contract MinipoolManager is Base, ReentrancyGuard, IWithdrawer { revert InsufficientAVAXForMinipoolCreation(); } - if (duration < 2 weeks || duration > 365 days) { - revert DurationOutOfBounds(); - } - - if (delegationFee < 0.02 ether || delegationFee > 1 ether) { - revert DelegationFeeOutOfBounds(); - } - Staking staking = Staking(getContractAddress("Staking")); staking.increaseAVAXStake(msg.sender, msg.value); staking.increaseAVAXAssigned(msg.sender, avaxAssignmentRequest); diff --git a/test/unit/MinipoolManager.t.sol b/test/unit/MinipoolManager.t.sol index eda0058..b8914d7 100644 --- a/test/unit/MinipoolManager.t.sol +++ b/test/unit/MinipoolManager.t.sol @@ -52,7 +52,7 @@ contract MinipoolManagerTest is BaseTest { function testCreateMinipool() public { address nodeID = address(1); uint256 duration = 2 weeks; - uint256 delegationFee = 0.02 ether; + uint256 delegationFee = 20; uint256 avaxAssignmentRequest = 1000 ether; uint256 nopAvaxAmount = 1000 ether; @@ -676,7 +676,7 @@ contract MinipoolManagerTest is BaseTest { function testGetMinipool() public { address nodeID = address(1); uint256 duration = 2 weeks; - uint256 delegationFee = 0.02 ether; + uint256 delegationFee = 20; uint256 avaxAssignmentRequest = 1000 ether; uint256 nopAvaxAmount = 1000 ether; @@ -708,7 +708,7 @@ contract MinipoolManagerTest is BaseTest { nodeID = randAddress(); ggp.approve(address(staking), ggpStakeAmt); staking.stakeGGP(ggpStakeAmt); - minipoolMgr.createMinipool{value: depositAmt}(nodeID, 14 days, 0.02 ether, avaxAssignmentRequest); + minipoolMgr.createMinipool{value: depositAmt}(nodeID, 0, 0, avaxAssignmentRequest); } vm.stopPrank(); @@ -737,7 +737,7 @@ contract MinipoolManagerTest is BaseTest { nodeID = randAddress(); ggp.approve(address(staking), ggpStakeAmt); staking.stakeGGP(ggpStakeAmt); - minipoolMgr.createMinipool{value: depositAmt}(nodeID, 14 days, 0.02 ether, avaxAssignmentRequest); + minipoolMgr.createMinipool{value: depositAmt}(nodeID, 0, 0, avaxAssignmentRequest); } vm.stopPrank(); assertEq(minipoolMgr.getMinipoolCount(), 10); @@ -1064,7 +1064,7 @@ contract MinipoolManagerTest is BaseTest { vm.startPrank(nodeOp); ggp.approve(address(staking), 100 ether); staking.stakeGGP(100 ether); - minipoolMgr.createMinipool{value: 1000 ether}(nodeID, 14 days, 0.02 ether, avaxAssignmentRequest); + minipoolMgr.createMinipool{value: 1000 ether}(nodeID, 0, 0, avaxAssignmentRequest); vm.stopPrank(); } index = minipoolMgr.getIndexOf(nodeID);