我试图根据这里概述的ERC1404标准构建一份合同:https://github.com/simple-restricted-token/simple-restricted-token
契约允许您在令牌之上添加限制,并且是可组合的。示例包括使用单个限制,但是我需要在标记中使用许多限制。我试图使用的限制是: MaxNumShareholdersToken,IndividualOwnershipStakeToken
我创建了以下契约,它继承了这两个文件:
pragma solidity ^0.4.24;
import "./../mocks/BasicTokenMock.sol";
import "./restrictions/number-of-accounts/MaxNumShareholdersToken.sol";
import "./restrictions/ownership-percentage/IndividualOwnershipStakeToken.sol";
contract MyToken is BasicTokenMock, MaxNumShareholdersToken, IndividualOwnershipStakeToken {
constructor (
address initialAccount,
uint256 initialBalance,
uint256 maxNumShareholders,
uint256 globalMaxPercentOwnershipTimesOneThousand
)
BasicTokenMock(initialAccount, initialBalance)
MaxNumShareholdersToken(maxNumShareholders)
IndividualOwnershipStakeToken(globalMaxPercentOwnershipTimesOneThousand)
public {
}
}但是,在编译时,我会看到以下错误消息:
TypeError: Linearization of inheritance graph impossible我跟随了继承树,从我的理解来看,这应该是可行的。下面是有关文件的继承树。

我做错了什么?
发布于 2020-10-31 18:52:58
当不同的父母亲相互继承或相同的契约时,就会发生此错误。要解决这个问题,你通常只需要在合同声明中重新排序父母。
https://ethereum.stackexchange.com/questions/89802
复制相似问题