Ethereum 找不到标识符或唯一-实体编译错误
我正在尝试使用ERC 725创建一个身份智能合约,在尝试编译它时出现了一个错误。最初,我试图在一个单独的solidity文件中创建,但在编译过程中,我大部分时间都会遇到导入错误。由于这个原因,我在基本ERC725.sol文件上做这件事。我将在主合同之后在此文件中添加我自己的合同。这是我试图添加的代码Ethereum 找不到标识符或唯一-实体编译错误,ethereum,solidity,smartcontracts,Ethereum,Solidity,Smartcontracts,我正在尝试使用ERC 725创建一个身份智能合约,在尝试编译它时出现了一个错误。最初,我试图在一个单独的solidity文件中创建,但在编译过程中,我大部分时间都会遇到导入错误。由于这个原因,我在基本ERC725.sol文件上做这件事。我将在主合同之后在此文件中添加我自己的合同。这是我试图添加的代码 enter code here pragma-solidity^0.6.0; //模块 导入“/ERC725X.sol”; 导入“/ERC725Y.sol”; /** *@title ERC725
enter code here
pragma-solidity^0.6.0;
//模块
导入“/ERC725X.sol”;
导入“/ERC725Y.sol”;
/**
*@title ERC725包
*@dev将ERC725X和ERC725Y捆绑到一个智能合约中
*
*@作者费边·沃格斯泰勒
*/
合同ERC725是ERC725X,ERC725Y{
/**
*@通知确定了合同的所有者
*@param\u newOwner合同的所有者。
*/
构造函数(地址_newOwner)
ERC725X(新所有者)
ERC725Y(新所有者)
公共{}
//注意:默认情况下,此实现没有:receive()外部应付款{}
}
合同myERC725是ERC725,ERC721{
向公众所有人致辞;
映射(uint=>identity)标识\u id;
结构标识{
字符串散列;
字符串文件名;
uint aadhar_id;
字符串名;
uint160岁;
线状血型;
字符串城市;
字符串状态;
弦国;
}
身份标识;
构造函数()ERC725(“0x5B38Da6a701c568545dCfcB03FcB875f56beddC4”)公共{
所有者=msg.sender;
}
修饰符isOwner(){
require(msg.sender==所有者,“不允许访问”);
_;
}
函数集详细信息(uint\u aadhar\u id、字符串内存\u名称、uint160\u年龄、字符串内存\u血型、字符串内存\u城市、字符串内存\u州、字符串内存\u国家)公共isOwner{
_薄荷(味精发送者,_aadhar_id);
id.name=_name;
id.age=_年龄;
id.blood\u group=\u blood\u group;
id.city=_城市;
id.state=_state;
id.country=\u国家;
身份标识[\u aadhar\u id]=id;
}
//函数getFile(uint\u index)公共视图返回(字符串内存,字符串)
函数getDetails(uint\u aadhar\u id)公共视图返回(字符串内存散列、字符串内存、uint160、字符串内存、字符串内存、字符串内存、字符串内存){
标识内存id=标识id[\u aadhar\u id];
返回值(id.hash、id.name、id.age、id.blood\u group、id.city、id.state、id.country);
}
}
我得到的错误是:
浏览器/github/ERC725Alliance/ERC725/implementations/contracts/ERC725/ERC725.sol
声明错误:找不到标识符或标识符不唯一。合同我的ERC725是ERC725,ERC721{
我不确定我是否用正确的方式做了这件事。有人能在这方面指导我吗?这将对我有很大帮助。谢谢
pragma solidity ^0.6.0;
// modules
import "./ERC725X.sol";
import "./ERC725Y.sol";
/**
* @title ERC725 bundle
* @dev Bundles ERC725X and ERC725Y together into one smart contract
*
* @author Fabian Vogelsteller <fabian@lukso.network>
*/
contract ERC725 is ERC725X, ERC725Y {
/**
* @notice Sets the owner of the contract
* @param _newOwner the owner of the contract.
*/
constructor(address _newOwner)
ERC725X(_newOwner)
ERC725Y(_newOwner)
public {}
// NOTE this implementation has not by default: receive() external payable {}
}
contract myERC725 is ERC725,ERC721{
address public owner;
mapping(uint => identity) identity_id;
struct identity {
string hash;
string filename;
uint aadhar_id;
string name;
uint160 age;
string blood_group;
string city;
string state;
string country;
}
identity id;
constructor() ERC725("0x5B38Da6a701c568545dCfcB03FcB875f56beddC4") public{
owner = msg.sender;
}
modifier isOwner() {
require(msg.sender == owner, "Access is not allowed");
_;
}
function setDetails(uint _aadhar_id,string memory _name,uint160 _age,string memory _blood_group, string memory _city,string memory _state,string memory _country) public isOwner{
_mint(msg.sender,_aadhar_id);
id.name = _name;
id.age = _age;
id.blood_group = _blood_group;
id.city = _city;
id.state = _state;
id.country = _country;
identity_id[_aadhar_id]=id;
}
//function getFile(uint _index) public view returns(string memory,string)
function getDetails(uint _aadhar_id)public view returns(string memory _hash,string memory,uint160,string memory,string memory,string memory,string memory){
identity memory id = identity_id[_aadhar_id];
return(id.hash,id.name,id.age,id.blood_group,id.city,id.state,id.country);
}
}