user16028670
user16028670

Reputation:

ParserError: Expected ';' but got identifier

I am trying to create a contract for an ERC20 token and am getting this error when I try to deploy it:

contracts/YourToken.sol:11:33: ParserError: Expected ';' but got identifier const yourToken = await deployments.get("plonCoin");

Any thoughts on why this might be happening?

enter image description here

Upvotes: 0

Views: 3412

Answers (1)

Petr Hejda
Petr Hejda

Reputation: 43481

You're mixing together Solidity code of the contract and JavasScript code of an off-chain app working with the contract.

const yourToken = await deployments.get("plonCoin");
const result = await yourToken.transfer("<address>", utils.parseEther("1000"));

This is the JS code that doesn't belong to the contract.

Upvotes: 1

Related Questions