Cyfrin Updraft.

Post

Share your knowledge.

thegreatfeez.
Dec 14, 2024
Expert Q&A

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
1
1
Share
Comments
.

Answers

1
The8bitGHOST.
Dec 15 2024, 09:17

look 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.

1
Comments
.

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

195Posts196Answers
We use cookies to ensure you get the best experience on our website.
More info