Post
Share your knowledge.
Setting up SimpleStorage Deployer
Why do i keep getting this error when trying to deploy my code in VS code, asked AI and it's still the same. Here is the error: [⠊] Compiling... [⠢] Compiling 14 files with Solc 0.8.18 [⠆] Solc 0.8.18 finished in 149.20ms Error: Compiler run failed: Error (2314): Expected ';' but got identifier --> script/DeploySimpleStorage.s.sol:11:9: | 11 | vm.stopBroadcast(); | ^^
And here is my code. solidity ''' // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18; import {Script} from "forge-std/Script.sol"; import {SimpleStorage} from "../src/SimpleStorage.sol";
contract DeploySimpleStorage is Script { function run() external returns (SimpleStorage) { vm.startBroadcast(); SimpleStorage simpleStorage = new SimpleStorage(); vm.stopBroadcast(); return simpleStorage; } } '''
- Cyfrin Updraft
- Foundry
- Solidity
Answers
1look for a missing ;
semi-colon if there are none then just save the file and use the
forge clean
command in your vscode terminal and compile again.
Do you know the answer?
Please log in and share it.
Cyfrin Updraft is an education platform specializing on teaching the next generation of smart contract developers