Function: permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
Permits spender to spend value tokens on behalf of owner with a valid signature.
Inputs
ownerControl: Fully controlled by the caller.
Constraints: Ensured that the owner is the recovered address from the computed signature (in
isValidSignatureNow).Impact: The owner of the tokens to be approved.
spenderControl: Fully controlled by the caller.
Constraints: Ensured that
spenderis included in the computed signature (inisValidSignatureNow).Impact: The spender of the tokens to be approved.
valueControl: Fully controlled by the caller.
Constraints: Ensured that
valueis the approved amount of tokens (inisValidSignatureNow).Impact: The amount of tokens to be approved.
deadlineControl: Fully controlled by the caller.
Constraints: Ensured that the
deadlineis respected.Impact: The deadline of the signature.
vControl: Fully controlled by the caller.
Constraints: Ensured that
vis valid in the computed signature (inisValidSignatureNow).Impact: Component of the ECDSA signature.
rControl: Fully controlled by the caller.
Constraints: Ensured that
ris valid in the computed signature (inisValidSignatureNow).Impact: Component of the ECDSA signature.
sControl: Fully controlled by the caller.
Constraints: Ensured that
sis valid in the computed signature (inisValidSignatureNow).Impact: Component of the ECDSA signature.
Branches and code coverage (including function calls)
Intended branches
Ensure that the signature is valid.
Use a nonce for replay protection.
Approve the desired amount of tokens.
Negative behavior
Should not allow using signatures that have been revoked (due to ERC-1271). That is enforced in
isValidSignatureNow.Should not allow the usage of expired signatures.