All questions
of 21How do you initialize a new Foundry project?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
You initialize a new Foundry project using the forge init command:
forge init my-project
cd my-project
This creates a standard project structure with:
src/- Smart contract source filestest/- Test filesscript/- Deployment and interaction scriptsfoundry.toml- Configuration filelib/- Dependencies/libraries
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain the basic structure of a Foundry test and how to run tests.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Foundry tests are written in Solidity and follow a specific naming convention. Test functions must start with test and test contracts should inherit from Test:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import "../src/Counter.sol";
contract CounterTest is Test {
Counter public counter;
function setUp() public {
counter = new Counter();
}
function testIncrement() public {
counter.increment();
assertEq(counter.number(), 1);
}
}
Run tests using:
forge test # Run all tests
forge test --match-test testIncrement # Run specific test
forge test -vvv # Verbose output
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What are the different verbosity levels in Forge testing?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Forge provides multiple verbosity levels controlled by the number of v flags:
- Default: Shows test results only
- -v: Shows logs for failing tests
- -vv: Shows logs for all tests and gas usage
- -vvv: Shows execution traces for failing tests
- -vvvv: Shows execution traces for all tests and setup
- -vvvvv: Shows execution and setup traces, plus internal steps
Higher verbosity levels are crucial for debugging failed tests and understanding gas consumption patterns.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain how to manage dependencies in Foundry.
What is the difference between `forge build` and `forge compile`?
How do you handle testing of view functions and state queries?
How do you handle test fixtures and setup in Foundry?
Explain fuzzing in Foundry and provide an example.
What are cheatcodes in Foundry and give examples of commonly used ones?
How do you test events in Foundry?
How do you deploy contracts using Foundry scripts?
How do you handle different network configurations in Foundry?
How do you perform fork testing in Foundry?
How do you debug failing tests in Foundry?
What are some best practices for organizing Foundry test suites?
How do you configure and use Foundry with continuous integration (CI)?
How do you perform invariant testing (stateful fuzzing) in Foundry?
How do you optimize gas usage when testing with Foundry?
How do you handle upgradeable contracts testing in Foundry?
How do you interact with external APIs or oracles in Foundry tests?
How do you test contract interactions and composability?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
18 of 21 Foundry answers are gated.
Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.
- Full answers + code
- AI explain - simpler, deeper, or visualized
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsLAMP
Linux, Apache, MySQL, PHPRuby on Rails
Convention over ConfigurationJAM
JavaScript, APIs, and MarkupServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQFastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseWeb3 / Ethereum
Solidity, Ethereum, Hardhat, FoundryDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.