如何解决为什么在 Visual Code 中编译 Solidity 的智能合约会生成此错误:“ParserError: Expected identifier, got 'LParen'”
我使用的是 ERC1155 的智能合约(Open Zeppelin),它在 Remix 中可以正确编译,但是当我在 Visual Code 中编译时收到
解析器错误:预期标识符,得到“LParen”
智能合约可以成功部署到 Rinkeby 测试网。但是,当我尝试在 Etherscan 中验证合同时,它给了我以下消息:
注意:无法确定构造器参数,请检查并用正确的值替换(6e65746f70656e2e707974686f6e616e7977686572652e636f6d2f7374617469632f6d6574616461646f732f6d6574616461646f7370617261657263313135352e747874)
// contracts/AFSE.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
//import "../../utils/introspection/ERC165.sol";
contract AFSE is ERC1155{
mapping (uint256 => mapping(address => uint256)) internal _balances;
mapping (uint256 => mapping(address => uint256)) internal mapof_urihash;
address public creator; // Used as the URI for all token types by relying on ID substitution,e.g. https://token-cdn-domain/{id}.json
event Createtoken(address creator,address owner,uint256 _id,uint256 _value,string uri,uint256 _urihash);
constructor () ERC1155("netopen.pythonanywhere.com/static/Metadados/Metadadosparaerc1155.txt") {
creator=msg.sender;
}
我该如何解决这个问题?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。