Codinghurricane
Codinghurricane

Reputation: 1

Error trailing semicolon in smart contract on solidity?

I am trying to write a smart contract and line 1 is bringing up an error : ParserError: Found version pragma, but failed to parse it. Please ensure there is a trailing semicolon. --> contracts/Mycontract.sol:1:1: | 1 | pragma solidity ^.0.8.1; |

I already have a semi colon in the contract what am I missing here? I am attemping this on the browser in Remix.

Upvotes: 0

Views: 1719

Answers (3)

user18213447
user18213447

Reputation: 1

pragma solidity ^0.8.1;

It should be like the given form above.

Upvotes: 0

Sumit Patel
Sumit Patel

Reputation: 129

The correct format for first line for importing pragma shall be like

pragma solidity ^0.5.2;

Upvotes: 1

Petr Hejda
Petr Hejda

Reputation: 43571

You have a syntax error.

The correct format is ^0.8.1 (no dot after the caret ^).

Upvotes: 0

Related Questions