Function: _permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
This validates a signature for a permit and calls _approve.
Inputs
ownerControl: Fully controlled by the caller.
Constraints: Checked that it is the recovered address from the signature in the
isValidSignatureNowcall.Impact: The owner of the funds to be approved.
spenderControl: Fully controlled by the caller.
Constraints: None.
Impact: The spender of the funds to be approved.
valueControl: Fully controlled by the caller.
Constraints: None.
Impact: The amount of funds to be approved.
deadlineControl: Fully controlled by the caller.
Constraints: Checked that it is in the future.
Impact: The deadline for the signature to be valid.
vControl: Fully controlled by the caller.
Constraints: Must recover in a valid signature.
Impact: The v part of the signature.
rControl: Fully controlled by the caller.
Constraints: Must recover in a valid signature.
Impact: The r part of the signature.
sControl: Fully controlled by the caller.
Constraints: Must recover in a valid signature.
Impact: The s part of the signature.
Branches and code coverage (including function calls)
Intended branches
Check that the owner is the recovered address from the signature. That is ensured in the
isValidSignatureNowcall.Check that the deadline is in the future.
Call
_approvewith the owner, spender, and value, so that tokens are approved.Assure that all other aspects of the signature are valid. That is ensured in the
isValidSignatureNowcall.
Negative behavior
Do NOT allow reusing the signature. That is ensured through the nonce.