Skip to content

tx.origin prank does not persist through nested message calls #1210

@strawberry-fury

Description

@strawberry-fury

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (6130af7 2022-04-06T00:03:48.094239707+00:00)

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

Minimal code and steps to replicate:
https://gist.github.com/strawberry-fury/ade15e042494d9fa6a1bfac7bfbce660
After running forge init in an empty directory, put the above code in a .sol file in src/, then run forge test.
The test will fail because the assertEq on line 43 fails, but in reality it shouldn't.

If Line 31 (transfer() on the dummy ERC20) is commented out, the test passes.
This leads me to believe that it's due to the behavior that after any message call finishes, the tx.origin prank is over.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions