From 3d9e767913345494718e901d39b614dfebc6540a Mon Sep 17 00:00:00 2001 From: Lrifton92 <233181402+Lrifton92@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:57:24 +0200 Subject: [PATCH] docs: add required --broadcast flag to forge create in deploy quickstart Since Foundry v1.0, `forge create` performs a dry run by default and does not broadcast the deployment transaction unless `--broadcast` is passed. Following this guide as written therefore does not deploy the contract, while the next step states the transaction hash will be printed. Align this page with the already-corrected sibling guide (apps/quickstart/deploy-on-base.mdx): keep the dry run as an optional step, then deploy with `--broadcast`, and note that the flag is required. Ref: https://www.getfoundry.sh/reference/forge/create --- docs/get-started/deploy-smart-contracts.mdx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/get-started/deploy-smart-contracts.mdx b/docs/get-started/deploy-smart-contracts.mdx index 144028ff7..15427c6c2 100644 --- a/docs/get-started/deploy-smart-contracts.mdx +++ b/docs/get-started/deploy-smart-contracts.mdx @@ -101,23 +101,35 @@ Never share or commit your private key. Always keep it secure and handle with ca Now that your environment is set up, let's deploy your contracts to Base Sepolia. -1. Use the following command to compile and deploy your contract +1. (Optional) Perform a dry run to simulate the deployment and verify your configuration: ```bash forge create ./src/Counter.sol:Counter --rpc-url $BASE_SEPOLIA_RPC_URL --account deployer ``` +This simulates the deployment without broadcasting the transaction to the network. + +2. Deploy your contract by adding the `--broadcast` flag: + +```bash +forge create ./src/Counter.sol:Counter --rpc-url $BASE_SEPOLIA_RPC_URL --account deployer --broadcast +``` + + +The `--broadcast` flag is **required** to actually deploy your contract to the network. Without it, Foundry only performs a dry run simulation. + + Note the format of the contract being deployed is `:`. -2. After successful deployment, the transaction hash will be printed to the console output +3. After successful deployment, the transaction hash and deployed contract address will be printed to the console output -3. Copy the deployed contract address and add it to your `.env` file +4. Copy the deployed contract address and add it to your `.env` file ```bash COUNTER_CONTRACT_ADDRESS="0x..." ``` -4. Load the new environment variable +5. Load the new environment variable ```bash source .env