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

cast call failing with panic when attempting to debug #6541

Closed
2 tasks done
coffeexcoin opened this issue Dec 7, 2023 · 1 comment · Fixed by #6553
Closed
2 tasks done

cast call failing with panic when attempting to debug #6541

coffeexcoin opened this issue Dec 7, 2023 · 1 comment · Fixed by #6553
Labels
T-bug Type: bug

Comments

@coffeexcoin
Copy link

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (54b3695 2023-12-07T00:29:49.682799000Z)

What command(s) is the bug in?

cast call

Operating System

macOS (Apple Silicon)

Describe the bug

I was attempting to simulate some transactions via cast call to demonstrate the debugging functionality and the application is crashing with "Message: there should be a contract with bytecode":

cast call 0x4d224452801ACEd8B2F0aebE155379bb5D594381 \
`cast calldata "transfer(address,uint256)" "0xF977814e90dA44bFA03b6295A0616a897441aceC" "1"` \
-f 0x5954aB967Bc958940b7EB73ee84797Dc8a2AFbb9 \
--rpc-url $HOME_NODE_URL \
--trace \
--debug \
--etherscan-api-key $ETHERSCAN_KEY

Compiling: SimpleToken 0x4d224452801ACEd8B2F0aebE155379bb5D594381
The application panicked (crashed).
Message:  there should be a contract with bytecode
Location: /Users/runner/work/foundry/foundry/crates/common/src/compile.rs:456

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
[1]    15483 abort      cast call 0x4d224452801ACEd8B2F0aebE155379bb5D594381  -f  --rpc-url  --trace
@mattsse
Copy link
Member

mattsse commented Dec 8, 2023

thanks!

this is indeed a bug caused by how we prepare the sources retrieved from etherscan
will be fixed by foundry-rs/block-explorers#19

mattsse added a commit to foundry-rs/block-explorers that referenced this issue Dec 8, 2023
ref foundry-rs/foundry#6541

this fixes a bug where the source tree can have folder outside the
targeted `root dir` because the path can be absolute (standard json
thing)

ref #19
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 8, 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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants