bug(forge script
): reading from other contracts that are deployed as part of the script fails
#8960
Open
2 tasks done
Labels
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (883bb1c 2024-09-25T00:24:44.893538000Z)
What command(s) is the bug in?
forge script
Operating System
macOS (Intel)
Describe the bug
I am trying to execute a more complex deploy, using Solidity Scripting (see script here). TLDR: the script fails, with a nondescript error. when I step through with the debugger, the problematic line comes and goes without problem. this shows (a) inconsistency between the script and the debugger and (b) it seems a bug in the script execution environment. I have run and tested these contracts extensively outside of Foundry, so I am quite sure that something is wrong.
Thorough explanation.
I have not yet worked up a MWE; but this should give a lot of info for now.For an MWE, please see the comment below.I have a contract which—during its constructor—reads from a public state variable of another contract. The problematic reads are here and here.
upon starting
anvil
in one window and executingI get:
you can see that the problematic line is reading from state of another contract.
If you add
vm.breakpoint("a");
between lines 24 and 25 of the script—i.e., before the lineTransferVerifier transfer = new TransferVerifier(ip);
—runforge debug ./script/Firn.s.sol
, and use'a
to step past the first few constructors, then you can step into the problematic contract creation. it is clear that instead of failing on the first read of_ip.gs(0)
, it chugs right past it with no problem.happy to provide further info. many thanks in advance and apologies for the non-mwe. maybe there is a problem with simulating a read of a "tuple" (i.e., of a
bytes32[2]
).The text was updated successfully, but these errors were encountered: