References and Demos
This page collects external references and demo repositories that are useful for understanding and implementing ERC-2771 gasless meta-transactions.
Watr reference repository
Specs and core libraries
Practical demo repositories (existing implementations)
dabit3/gasless-transactions-example- Full-stack gasless example with a simple recipient contract that uses
ERC2771Context.
- Full-stack gasless example with a simple recipient contract that uses
TtheBC01/Meta-Transaction-Example- Minimal Hardhat demo focused on the mechanics of forwarder + recipient.
aapsi/Meta-Transaction-ERC2771- More “app-like” example with a forwarder + business contract structure.
When reading examples, watch for these common pitfalls
- EIP-712 domain values must match forwarder deployment (name/version/chainId/verifyingContract).
- Recipient contracts must use
_msgSender()in all identity-sensitive logic. - Relayers must enforce allowlists and rate limits to prevent becoming a public gas faucet.