问题描述
我正在尝试使用ERC 725创建身份智能合约,并在尝试编译它时遇到错误。最初,我试图在一个单独的实体文件中创建,但大多数时候我在尝试进行编译时都遇到导入错误。因此,我在基本ERC725.sol文件上执行此操作。我要在主合同之后的文件中添加我自己的合同。这是我试图添加的代码
enter code here
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){
identity memory id = identity_id[_aadhar_id];
return(id.hash,id.name,id.age,id.blood_group,id.city,id.state,id.country);
}
}
我得到的错误是:
浏览器/github/ERC725Alliance/ERC725/implementations/contracts/ERC725/ERC725.sol 声明错误:找不到标识符或标识符不唯一。我的ERC725合同是ERC725,ERC721 {..
我不确定我是否做对了。任何人都可以在这方面指导我。这对我有很大帮助。谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)