top of page
  • Writer's pictureJeffrey Scholz

Verify Signature Solidity in Foundry

Updated: Mar 12

Here is a minimal (copy and paste) example of how to safely create and verify ECDSA signatures with OpenZeppelin in the Foundry environment.



Contract: Verifier.sol

Test (Verifier.t.sol)

This will work even if you change the data type from "string" to something else.


Note that OpenZeppelin supports two ways to represent the signature. It's generally more convenient to use the bytes version because this is only one extra piece of data to pass around. Note however that ERC20-Permit uses the three part signature (r, s, v).


Learn More

This article is used as reference material in our Solidity Bootcamp.

107 views0 comments

Recent Posts

See All
bottom of page