Open Keinberger opened 1 year ago
Please add this back to the milestones. We rely on Tenderly TestNets (external node) for a shared fork state for devs and UI testing. Currently, foundry scripts are unable to publish contracts or make calls to remote forks.
Hi @wavey0x, the ticket is still active and being considered but not part of our 1.0 scope as we are planning to build reth-anvil
next year which could have this included in the design scope explicitly.
Currently, foundry scripts are unable to publish contracts or make calls to remote forks.
Could you expand on this? Deploying contracts / making calls in Foundry Script inside of vm.startBroadcast
/ vm.broadcast
sections should work as you would expect.
We rely on Tenderly TestNets (external node) for a shared fork state for devs and UI testing
This ticket, to my understanding, is specifically about being able to publish tests. You should be able to fork the testnet URL and locally run tests against it. Scripted interactions through forge script
should be possible as previously stated.
thanks @zerosnacks
here's some stuff ive learned in regard to getting a Tenderly fork env spun up and synced with Foundry:
startBroadcast
/ endBroadcast
code block otherwise the transaction never reaches the rpc provider--unlocked
flag to your command and the associated wallet address into vm.startBroadcast()
i've made a TenderlyHelper script that can be inherited and used to make sure that basic cheat codes are synced between tenderly and local env https://gist.github.com/wavey0x/e14d44c2d3e9fad4a3fd190791667901
Component
Forge, Anvil
Describe the feature you would like
Background
When running tests using Foundry, it is possible to specify a
--rpc-url
to thefoundry test
command. When doing so, Foundry just queries and copies the state of the chain specified at the--rpc-url
endpoint to the locally running testing node. Nevertheless, other Smart Contract development frameworks (hardhat) do provide a direct way to publish tests on an actual node, which can be tremendously useful for effective fork and staging testing.Proposal
Implement test transactions actually being published to anvil when specifying
--rpc-url
to a local anvil node. This would allow for more accurate fork-testing and external sources being able to use / query transaction data.This feature could be used to effectively perform fork testing and integrate external sources into the testing environment.
Additional context
Discussed in https://github.com/foundry-rs/foundry/discussions/5421