Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup failed: cannot call deal on precompile 0x0000000000000000000000000000000000000001 #6181

Closed
1 of 2 tasks
utx0 opened this issue Nov 1, 2023 · 3 comments
Closed
1 of 2 tasks
Labels
T-bug Type: bug

Comments

@utx0
Copy link

utx0 commented Nov 1, 2023

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 (799b820 2023-11-01T00:30:43.361383120Z)

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

As of today's versions;

❯ foundryup -v


.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

 ╔═╗ ╔═╗ ╦ ╦ ╔╗╔ ╔╦╗ ╦═╗ ╦ ╦         Portable and modular toolkit
 ╠╣  ║ ║ ║ ║ ║║║  ║║ ╠╦╝ ╚╦╝    for Ethereum Application Development
 ╚   ╚═╝ ╚═╝ ╝╚╝ ═╩╝ ╩╚═  ╩                 written in Rust.

.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

Repo       : https://github.com/foundry-rs/
Book       : https://book.getfoundry.sh/
Chat       : https://t.me/foundry_rs/
Support    : https://t.me/foundry_support/
Contribute : https://github.com/orgs/foundry-rs/projects/2/

.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

foundryup: installing foundry (version nightly, tag nightly)
foundryup: downloading latest forge, cast, anvil, and chisel
############################################################################################################################################################################################################## 100.0%
foundryup: downloading manpages
############################################################################################################################################################################################################## 100.0%
foundryup: installed - forge 0.2.0 (799b820 2023-11-01T00:30:43.361383120Z)
foundryup: installed - cast 0.2.0 (799b820 2023-11-01T00:30:43.352568039Z)
foundryup: installed - anvil 0.2.0 (799b820 2023-11-01T00:30:43.402555828Z)
foundryup: installed - chisel 0.2.0 (799b820 2023-11-01T00:30:43.369868501Z)
foundryup: done!

I am now getting this error when running my tests and am now sure what its about:

[FAIL. Reason: Setup failed: cannot call `deal` on precompile 0x0000000000000000000000000000000000000001] setUp() (gas: 0)

Which is this line of code in the tests:

address public constant userAddress = address(0x001); 
...
vm.deal(testAddresses.userAddress, 100 ether);
@utx0 utx0 added the T-bug Type: bug label Nov 1, 2023
@Evalir
Copy link
Member

Evalir commented Nov 1, 2023

We restrict cheatcode calls to certain addresses as it's considered a bad practice—mainly the addresses 0 to 9 which are cheatcodes. You can use makeAddr to make a new address to do deal instead.

@utx0
Copy link
Author

utx0 commented Nov 1, 2023

We restrict cheatcode calls to certain addresses as it's considered a bad practice—mainly the addresses 0 to 9 which are cheatcodes. You can use makeAddr to make a new address to do deal instead.

Can you expand on why its bad practice, I'm not sure I follow the logic here?

@mds1
Copy link
Collaborator

mds1 commented Nov 1, 2023

I think this was fixed by #6182, so closing

Originally in #4905 we considered disallowing deal since you typically won’t need to send ETH to precompiles, but you can so we ended up allowing it. Guessing it was accidentally changed in the recent refactor but should be fixed now

@mds1 mds1 closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants