top of page
  • Writer's pictureJeffrey Scholz

Verify Signature Solidity in Foundry

Updated: May 16

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.

We also have a free learn solidity tutorial.

715 views0 comments

Recent Posts

See All

Now that you’ve completed our solidity tutorial, what’s next? You now have enough knowledge to build any of the following projects. Knowledge comes by study, but skill comes with practice. You need bo

bottom of page