"expected primary expression" 错误 - 尝试在 remix 上编译智能合约 - ethereum ide

"expected primary expression" error - Trying to compile a smart contract on remix - ethereum ide

老实说,这段代码取自一个网站,该网站旨在简化在 binance 智能链上创建智能 contract/token。 (简短的背景故事:我和一些朋友认为拥有自己的代币会很有趣,例如下注、玩扑克,现在正尝试通过在 BSC 上部署我们的智能合约来创建我们自己的代币)

这是我使用的模板的 link:https://github.com/binance-chain/bsc-genesis-contract/blob/master/contracts/bep20_template/BEP20Token.template

我正在尝试编译代码,但在第 352 行出现错误“expected primary expression”。那是什么意思?我真的只是一个门外汉。该令牌应该被称为欧米茄和符号 OHM。

感谢您的建议!

链接的合约包含导致语法错误的函数。

constructor() public {
  _name = {{TOKEN_NAME}};
  _symbol = {{TOKEN_SYMBOL}};
  _decimals = {{DECIMALS}};
  _totalSupply = {{TOTAL_SUPPLY}};
  _balances[msg.sender] = _totalSupply;

  emit Transfer(address(0), msg.sender, _totalSupply);
}

我假设合同作者打算使用这些占位符来指出您可以在何处填写自己的值。

用实际值替换占位符后,合约编译成功。

constructor() public {
  _name = "MyToken";
  _symbol = "MyT";
  _decimals = 18;
  _totalSupply = 1000000000000000000;
  _balances[msg.sender] = _totalSupply;

  emit Transfer(address(0), msg.sender, _totalSupply);
}