From ac8490dd891e9c18b08378802a0f27b68960ee6d Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Fri, 23 Feb 2024 11:54:42 -0300 Subject: [PATCH] refactor(StakeManager): change MIN_LOCKUP_PERIOD to 2 weeks --- .gas-snapshot | 46 +++++++++++++++++++------------------- contracts/StakeManager.sol | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 0458804..f5d61c0 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,31 +1,31 @@ CreateVaultTest:testDeployment() (gas: 9774) -CreateVaultTest:test_createVault() (gas: 719374) -ExecuteAccountTest:testDeployment() (gas: 26401) -ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 1098349) -LeaveTest:testDeployment() (gas: 26173) -LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 752180) -LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 10770) -LockTest:testDeployment() (gas: 26401) -LockTest:test_RevertWhen_InvalidLockupPeriod() (gas: 891958) +CreateVaultTest:test_createVault() (gas: 692923) +ExecuteAccountTest:testDeployment() (gas: 26335) +ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 1071591) +LeaveTest:testDeployment() (gas: 26335) +LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 1072210) +LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 10794) +LockTest:testDeployment() (gas: 26335) +LockTest:test_RevertWhen_InvalidLockupPeriod() (gas: 865463) LockTest:test_RevertWhen_SenderIsNotVault() (gas: 10630) -MigrateTest:testDeployment() (gas: 26173) -MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 747548) -MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 10770) +MigrateTest:testDeployment() (gas: 26335) +MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 1069817) +MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 10794) SetStakeManagerTest:testDeployment() (gas: 9774) SetStakeManagerTest:test_RevertWhen_InvalidStakeManagerAddress() (gas: 20481) SetStakeManagerTest:test_SetStakeManager() (gas: 19869) -StakeManagerTest:testDeployment() (gas: 26173) -StakeTest:testDeployment() (gas: 26401) -StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 909883) -StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10672) +StakeManagerTest:testDeployment() (gas: 26107) +StakeTest:testDeployment() (gas: 26335) +StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 883366) +StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10650) StakeTest:test_RevertWhen_StakeTokenTransferFails() (gas: 175040) -StakeTest:test_StakeWithoutLockUpTimeMintsMultiplierPoints() (gas: 963376) +StakeTest:test_StakeWithoutLockUpTimeMintsMultiplierPoints() (gas: 963789) StakedTokenTest:testStakeToken() (gas: 7616) -UnstakeTest:testDeployment() (gas: 26423) -UnstakeTest:test_RevertWhen_FundsLocked() (gas: 1098058) -UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10587) -UnstakeTest:test_UnstakeShouldReturnFunds() (gas: 961933) -UserFlowsTest:testDeployment() (gas: 26401) -UserFlowsTest:test_StakeWithLockUpTimeLocksStake() (gas: 1025811) -UserFlowsTest:test_StakedSupplyShouldIncreaseAndDecreaseAgain() (gas: 1843385) +UnstakeTest:testDeployment() (gas: 26357) +UnstakeTest:test_RevertWhen_FundsLocked() (gas: 1071749) +UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10631) +UnstakeTest:test_UnstakeShouldReturnFunds() (gas: 961918) +UserFlowsTest:testDeployment() (gas: 26335) +UserFlowsTest:test_StakeWithLockUpTimeLocksStake() (gas: 1042001) +UserFlowsTest:test_StakedSupplyShouldIncreaseAndDecreaseAgain() (gas: 1857747) VaultFactoryTest:testDeployment() (gas: 9774) \ No newline at end of file diff --git a/contracts/StakeManager.sol b/contracts/StakeManager.sol index d93fbad..d5b6f8d 100644 --- a/contracts/StakeManager.sol +++ b/contracts/StakeManager.sol @@ -36,7 +36,7 @@ contract StakeManager is Ownable { uint256 public constant EPOCH_SIZE = 1 weeks; uint256 public constant YEAR = 365 days; - uint256 public constant MIN_LOCKUP_PERIOD = 12 weeks; // 3 months + uint256 public constant MIN_LOCKUP_PERIOD = 2 weeks; uint256 public constant MAX_LOCKUP_PERIOD = 4 * YEAR; // 4 years uint256 public constant MP_APY = 1; uint256 public constant MAX_BOOST = 4;