Skip to content

hedera-dev/tutorial-foundry-test-event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Test a Solidity Event with Foundry

Foundry supports the use of cheatcodes. Cheatcodes allow you to go beyond testing the outputs of your smart contracts. They allow developers to manipulate the state of the blockchain, test for reverts, and events. In this tutorial, we will focus on the cheatcode vm.expectEmit to test a solidity event.

What you will accomplish

  • ✅ Use the vm.expectEmit Cheatcode
  • ✅ Test a Solidity event

Get started

The repo, github.com/hedera-dev/test-an-event-with-foundry, is intended to be used alongside this tutorial.

Important

This project has submodules. You must initialize the submodule configuration file and fetch all submodule data from the project. To do this run the following command:

git clone --recurse-submodules git@github.com:hedera-dev/test-an-event-with-foundry.git

Completed Branch

To skip ahead to the final state, use the completed branch. This gives you the final state with which you can compare your implementation to the completed steps of the tutorial.

About

Learn how to test a solidity event within a Hedera smart contract using Foundry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors