Function: verifyWithdraw(address sender, EventTypes.WithdrawData data)
This verifies the legitimacy of a signature.
Inputs
sender
Control: Fully controlled by calling function.
Constraints: None. Returns whether it is equal to the recovered signature's signer.
Impact: The sender of the message; should be the signer of the message basically.
data
Control: Fully controlled by the calling function.
Constraints: None.
Impact: The data struct that contains the signed message and its signature.
Branches and code coverage
Intended branches
Construct the
EIP712Domain
hash based on the EIP-712 implementation; currently not entirely respected, as thechain.id
is from the arbitrary data rather than theblock.chainid
.Include the fee in the hash. Currently not implemented.
Include the
accountId
in the hash. Currently not implemented.Recover the signer and assure it matches the
sender
. Currently not properly enforced, as ECDSA is not used.Assure a nonce is used against signature replayability.
Negative behavior
Should not allow withdrawing signatures with timestamps in the past. Currently not enforced.
Should not allow signature malleability. Currently not enforced, as obsolete
ecrecover
is used. ECDSA should be used, which properly accounts for this issue.Nobody other than the owner should be able to call this function.