You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'm having trouble getting my script to work and I'm looking for help on how to find logs/traces. Here is a summary of the issue:
I have a script like this:
import {Test} from"forge-std/Test.sol";
contractMyScriptisTest {
function run() public {
console2.log("Start");
vm.startBroadcast();
doStuff();
vm.stopBroadcast();
console2.log("Finish");
}
}
I try to run this script using the forge script command, and have tried using mumbai (without broadcast flag) and ganache (with broadcast flag) networks (both are giving me the same issue). Here are the commands:
Depending on what I put in doStuff() the script either passes or fails, so of course there is an issue with the solidity code, but the reason I posted this bug report is because I have no visibility into what is going wrong. And I need some help from traces/logs because the code that is breaking is rather large and not easy to step thru manually.
[assume using mumbai command for the next section]
In the successful case (doStuff() is very simple) I get a response like this:
# ...some traces..
Script ran successfully.
== Logs ==
# ...some logs...
==========================
Simulated On-chain Traces:
[22605] ERC1967Proxy::mint(20000000000000000000)
└─ ← ()
==========================
Estimated total gas used for script: 29386
Estimated amount required: 0.000088158000528948 ETH
==========================
SIMULATION COMPLETE. To broadcast these transactions, add --broadcast and wallet configuration(s) to the previous command. See forge script --help for more.
But in the failing case (complex doStuff()) I get a response like this:
# ...some traces..
Script ran successfully.
== Logs ==
# ...some logs...
==========================
Simulated On-chain Traces:
The application panicked (crashed).
Message: Internal EVM error:
Execution reverted: EvmError: Revert (gas: 265926)
Location: cli/src/cmd/forge/script/executor.rs:124
This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
There is no information to help me debug. Is there any way I can get some more insight into where the script is failing?
The text was updated successfully, but these errors were encountered:
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (29ff0b0 2022-08-21T00:04:31.695466171Z)
What command(s) is the bug in?
forge script
Operating System
Linux
Describe the bug
Hi there, I'm having trouble getting my script to work and I'm looking for help on how to find logs/traces. Here is a summary of the issue:
I have a script like this:
I try to run this script using the
forge script
command, and have tried using mumbai (without broadcast flag) and ganache (with broadcast flag) networks (both are giving me the same issue). Here are the commands:Depending on what I put in
doStuff()
the script either passes or fails, so of course there is an issue with the solidity code, but the reason I posted this bug report is because I have no visibility into what is going wrong. And I need some help from traces/logs because the code that is breaking is rather large and not easy to step thru manually.[assume using mumbai command for the next section]
In the successful case (
doStuff()
is very simple) I get a response like this:But in the failing case (complex
doStuff()
) I get a response like this:There is no information to help me debug. Is there any way I can get some more insight into where the script is failing?
The text was updated successfully, but these errors were encountered: