Function: mint(uint256 principal, uint256 duration)
This function creates a new staking position.
Inputs
principal
Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Amount of sUSDf to stake.
duration
Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Duration of staking in seconds.
Branches and code coverage
Intended branches
Check if the principal is bigger than zero.
Check if the duration is supported.
Check if the duration is enabled for mint.
Update duration liquidity for tracking.
Create position and transfer principal from the caller to the contract.
Mint NFT to the caller.
Negative behavior
If the principal is smaller than or equal to zero, the transaction will be reverted.
If the duration is not supported, the transaction will be reverted.
If the duration is not enabled, the transaction will be reverted.