Skip to content

Conversation

@mattgstevens
Copy link
Contributor

This solves a solc compile error TypeError: Linearization of inheritance graph impossible by inheriting the "most base-like" contracts first to prevent errors from inheriting contract.

See a similar fix here OpenZeppelin/openzeppelin-contracts#1128


I came across this issue with a contract that has a token implementation from OpenZeppelin and ERC725Y as part of its inheritance graph.

@mattgstevens
Copy link
Contributor Author

ping @frozeman as you seem to be the only recent commiter to this repo.

@frozeman
Copy link
Contributor

frozeman commented Aug 26, 2021

we just moved everything to a new structure with core contracts as abstracts, can you please test if the issue still exists in this one?
If not we might need to move the ownable around here contract ERC725Y is ERC725YCore, Ownable {

@mattgstevens
Copy link
Contributor Author

@frozeman just tried it out, and its the same error since the refactoring did not change the ordering of inheritance.

updated this PR to make the changes on the latest master

@mattgstevens
Copy link
Contributor Author

FWIW after a refactoring that removed inheriting Ownable directly this is no longer an issue, as only ERC725Y pulls it into the inheritance graph (and so the ordering issue is gone).

Still think this is a good change to land, following the reason given in the first comment, as this can be a confusing error to receive from solc.

frozeman
frozeman previously approved these changes Sep 14, 2021
this solves a solc compile error `TypeError: Linearization of inheritance graph impossible` by inheriting the "most base-like" contracts first to prevent errors from inheriting contract. See a similar fix here OpenZeppelin/openzeppelin-contracts#1128
@frozeman frozeman merged commit a1df6d5 into ERC725Alliance:master Sep 14, 2021
@mattgstevens mattgstevens deleted the master branch February 16, 2022 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants