foundry-rs / foundry-rs/foundry

feat(`cheatcodes`): add `vm.expectTransfer`

Open
#8,845 1 comment 0 reactions 0 assignees View on GitHub
A-cheatcodes C-forge T-post-V1 T-to-discuss
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

Currently there are multiple flavors of `expectCall`, but all of them treat empty `data` as a request to not check the calldata content. The problem is that there's no way to check if calldata is empty, e.g. because a native token transfer was made. The current `expectCall` API surface doesn't leave much space for adding this feature.

I propose adding a new set of `expectTransfer` functions. They would be identical to `expectCall` with all their variants, but they wouldn't have the `data` parameter, and they would expect that the address is called with zero-length calldata.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.