Function: mature(uint256 duration, uint256 timestamp)
This function matures positions for a specific timestamp.
Inputs
duration
Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Duration of staking in seconds.
timestamp
Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Maturity timestamp to process.
Branches and code coverage
Intended branches
Round down the timestamp and check if the timestamp is smaller than or equal to
block.timestamp
.Snapshot current fee growth for the duration.
Mature the position if it hasn't been matured yet.
Negative behavior
If rounded-down timestamp is bigger than
block.timestamp
, the transaction will be reverted.