Function: stakeWithPermit(uint256 eUSDIn, uint256 minStakedeUSDOut, address beneficiary, uint256 deadline, uint8 v, byte[32] r, byte[32] s)
Allows users to stake their eUSD tokens using a permit signature.
Inputs
eUSDInConstraints: Not zero --- should be at least
MIN_INITIAL_STAKEduring the first stake.Impact: The amount of eUSD tokens to stake.
minStakedeUSDOutConstraints: N/A.
Impact: The minimum amount of stakedeUSD tokens to receive.
beneficiaryConstraints: N/A.
Impact: The beneficiary of the stakedeUSD tokens.
deadlineConstraints: N/A.
Impact: The deadline for the permit signature.
vConstraints: Must be valid
secp256k1signature fromowneraccount over EIP-712--formatted function arguments.Impact: The
vvalue of the permit signature.
rConstraints: Must be valid
secp256k1signature fromowneraccount over EIP-712--formatted function arguments.Impact: The
rvalue of the permit signature.
sConstraints: Must be valid
secp256k1signature fromowneraccount over EIP712-formatted function arguments.Impact: The
svalue of the permit signature.
Branches and code coverage (including function calls)
Intended branches
Stake tokens successfully with signature.
Negative behavior
The contract call is reverted when the signature is expired.
The contract call is reverted when the signer is not the owner or
address(0).
Function call analysis
stakeWithPermit -> eUSD.permit(_msgSender(), address(this), eUSDIn, deadline, v, r, s)External/Internal? External.
Argument control?
eUSDIn,deadline,v,r, ands.Impact: Sets
eUSDInas allowance ofaddress(this)account over_msgSender()account's WETH10 token, given_msgSender()account's signed approval.
stakeWithPermit -> _stake(eUSDIn, minStakedeUSDOut, beneficiary)External/Internal? Internal.
Argument control?
eUSDIn,minStakedeUSDOut, andbeneficiary.Impact: N/A.