Function: stake(address to, uint256 amount)
This stakes PDT.
Inputs
toControl: Completely controlled by the caller.
Constraints: None.
Impact: The address that will receive credit for staking.
amountControl: Completely controlled by the caller.
Constraints: Cannot be zero.
Impact: The amount of PDT to stake.
Branches and code coverage
Intended branches
StakeDetails updated after staking.
Liquidity is maintained (i.e., sum of all user weights always equals the contract weight).
Negative behavior
Revert if current epoch has ended.
Revert if
msg.senderdoes not have enough balance or did not set enough allowance for the contract.