staking/contracts
Ricardo Guilherme Schmidt 9a4e3f4607
refactor(StakeManager): replace epoch.startTime with a global startTime
As now all epochEnd() are multiples of EPOCH_SIZE, we can drop the startTime from the struct Epoch, and avoid storing an information that can be cheaply calculated on the fly.

- Refactored the StakeManager contract to optimize the finalization of epochs and execution of accounts and epochs.
- Replaced the Epoch.startTime with a new global variable startTime to keep track of the start time of the contract.
- Modified the finalizeEpoch function to use a temporary variable for the current epoch and calculate the epoch reward only for the current epoch.
- Updated the migrationInitialize function to set the start time using the new startTime variable.
- Modified the epochEnd function to calculate the end time of the current epoch using the startTime variable.
- Modified the newEpoch function to calculate the number of the next epoch based on the startTime variable.

refactor(StakeManager): set startTime as immutable, load startTime from previousManager at constructor, verify startTime is correct on initializeMigration
2024-09-25 13:33:47 -03:00
..
StakeManager.sol refactor(StakeManager): replace epoch.startTime with a global startTime 2024-09-25 13:33:47 -03:00
StakeVault.sol fix: StakeManager migration fixes and certora rules 2024-02-20 09:08:00 +01:00
VaultFactory.sol feat: introduce `VaultFactory` (#38) 2023-11-07 09:49:22 +01:00