Foundry

/foundry807

A place to ask questions and share tips/tricks for using Foundry.

Is your toaster broken?

Here's one trick big toaster doesn't want you to know about
Updated forge-stack-tracer package to add "fst clean" command.
gm.

Normal to have to do --legacy on write transactions on @base?

Using Alchemy RPC.
`npm i -g forge-stack-tracer`

Collapse & interact with foundry stack traces locally with this CLI tool!
forge script with the --resume flag is really convenient if your contract deployment tx gets stuck because it’s underpriced
Where did all my storage space go?

🤨😲😵
has anyone made a RainbowKit wallet or Wagmi connector for anvil and its default accounts? to make it easier to switch between regular wallet and anvil when developing locally
I'm back baby! Back to deploying smart contracts onchain with the best tool in the industry.
qol improvement suggestion:

an option to aggregate .forge-snapshots into a single file would be a massive win for keeping PRs succinct

right now every PR that incorporates snapshots has "9.7e15 files changed"
love the syntax highlighting in chisel

wonder why other repl tools don't have that
here's the end result for the uniswap example, where we were able to directly use the build artifacts from node_modules
to test a new contract under development and an old contract with a solidity version older than forge supports (without using fork tests):

deploy the bytecode of the old contract using assembly in the test file.

uniswap v2 makes forge test and forge script sad, but this fixes it.
if you’re trying to use vm.readFile and it isn’t working, you need this in your foundry.toml:

fs_permissions = [{ access = "read", path = "./"}]

h/t @jomessin for figuring this out
Is there a simple way to get the address of a recently deployed (w/ Foundry) contract? Or do you need to always update the address manually? I know you can get ABI from the /out dir, but not seeing a way to dynamically grab the address every deploy.
Foundry is so much better than Hardhat it's not even funny!
anybody push their contracts to soldeer yet?
Calling all Foundry wizards! 🧙‍♂️

I'm encountering an issue while doing mainnet fork testing on the Blast Blockchain using Foundry. When trying to set the USDB balance for a test account, I get the following error:

I've opened a GitHub issue with details: https://github.com/foundry-rs/forge-std/issues/570
Here's a lifechanging foundry utility you arent using enough:

`forge clone <address>`

Easily download all dependencies of a contract into your local environment. No more days with the buggy blockscan vscode web for viewing contracts
If you use devenv, foundry.nix just got support for that too! ✨
When you generate a new private key using cast with `cast wallet new`, what seed phrase is being used?
It’s official, Soldeer has been merged into foundry!

I am waiting for feedback!
The road to a mature package manager has started.

This is just the beginning!

I want to thank the Foundry team who is very based and helped me a lot