Function: stake(uint256 amount)
This function emits the Stake event and transfers the paymentToken to the bfx.
Inputs
amountControl: Completely controlled by the caller.
Constraints: The value must not be smaller than
MIN_STAKE, and the caller must have enoughpaymentTokento transfer.Impact: The amount to transfer.
Branches and code coverage
Intended branches
Transfer the
paymentTokenfrommsg.senderto this contract.Increase
nextStakeIdwhen the transfer succeeds.
Negative behavior
Revert when the amount is smaller than
MIN_STAKE.Revert when the transfer fails.