[英]"expected primary expression" error - Trying to compile a smart contract on remix - ethereum ide
I'm being honest this code is taken from a website that is supposed to ease the creation of a smart contract/token on the binance smart chain.老实说,此代码取自一个网站,该网站旨在简化在币安智能链上创建智能合约/令牌的过程。 (short backstory: Me and some friends thought it would be fun to have our own token to eg take bets, play poker whatsoever and are now trying to create our own through deploying our smart contract on the BSC)
(简短的背景故事:我和一些朋友认为拥有我们自己的代币会很有趣,例如下注、玩扑克,现在正试图通过在 BSC 上部署我们的智能合约来创建我们自己的代币)
Here is a link to the template I used: https://github.com/binance-chain/bsc-genesis-contract/blob/master/contracts/bep20_template/BEP20Token.template这是我使用的模板的链接: https : //github.com/binance-chain/bsc-genesis-contract/blob/master/contracts/bep20_template/BEP20Token.template
I am trying to compile the code but in line 352 the error "expected primary expression" occurs.我正在尝试编译代码,但在第 352 行中出现“预期的主要表达式”错误。 What does that mean?
这意味着什么? I am really just a layman.
我真的只是一个外行。 The token is supposed to be called Omega and the Symbol OHM.
该令牌应该被称为 Omega 和符号 OHM。
Thank you for your suggestions!谢谢你的建议!
The linked contract contains this function which causes the syntax error.链接的合约包含导致语法错误的函数。
constructor() public {
_name = {{TOKEN_NAME}};
_symbol = {{TOKEN_SYMBOL}};
_decimals = {{DECIMALS}};
_totalSupply = {{TOTAL_SUPPLY}};
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
I'm assuming that it was the contract author's intention to use these placeholders as a way to point out where you can fill in your own values.我假设合同作者有意使用这些占位符来指出您可以在哪里填写自己的值。
After you replace the placeholders with real values, the contract compiles successfully.用实际值替换占位符后,合约编译成功。
constructor() public {
_name = "MyToken";
_symbol = "MyT";
_decimals = 18;
_totalSupply = 1000000000000000000;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.