【问题标题】:Hi All, I am getting an error says - ParserError: Expected ';' but got 'contract' contract Token.If someone can help me that'd be very helpful.Thanks大家好,我收到一条错误消息 - ParserError: Expected ';'但是得到了“合同”合同令牌。如果有人可以帮助我,那将非常有帮助。谢谢
【发布时间】:2021-12-30 02:56:32
【问题描述】:
Pragma solidity ^0.5.0;

contract('Token', ([deployer, receiver]) => { 

 const name = 'Arv Token' 
 const symbol = 'ARVV' 
 const decimals = '18' 
 const totalSupply = tokens(1000000).toString() 
 let token

    beforeEach(async () => {
        token = await Token.new()
    })

【问题讨论】:

  • 请将完整的错误消息粘贴到正文而不是问题标题。
  • pragma 代替 Pragma

标签: blockchain ethereum solidity smartcontracts


【解决方案1】:

您似乎忘记了常量后面的半列以及几乎每一行代码。

const x = 'a constant';
const y = 23445;

【讨论】:

    【解决方案2】:

    你只是缺少';'在你的行尾。 试试这个代码。

    pragma solidity ^0.5.0;
    
    contract('Token', ([deployer, receiver]) => { 
    
     const name = 'Arv Token';
     const symbol = 'ARVV';
     const decimals = '18';
     const totalSupply = tokens(1000000).toString();
     let token
    
        beforeEach(async () => {
            token = await Token.new();
        })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 2014-05-09
      • 2021-09-30
      • 1970-01-01
      • 2021-12-25
      • 1970-01-01
      相关资源
      最近更新 更多