question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple inheritance in Contract

See original GitHub issue

We’re using Feign for inter-services calls in a micro services architecture. We would like to move to a single interface between the client and the resource so that changes in the api are reflected automatically to the client.

The problem is that some clients we built during the past months extends 2 specific interfaces related to common tasks between the micro services (backup related actions for instance).

While trying to refactor the code, I hit the (understandable) limitation of the single inheritance. I’d be open to work on that and make a PR out of it, is this something you’d consider merging? I know I can provide my own Contract but I’d like to have your opinion on contributing this upstream first.

I haven’t thought about all the details yet but it would be something like scanning all the extended interfaces and making sure that all the methods defined have the proper metadata.

Thanks!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
dezelvolcommented, Dec 20, 2018

My friend shared code snippet that actually works. It has one known issue - you have to duplicate method variable mapping in children. Except this code works fine.

You need to create Hierarchical contract bean in your configuration, to make it working.

HierarchicalContract.txt

0reactions
gab-fincommented, Jul 1, 2020

It would be great to support it, we have a hierarchy of interfaces and it represents a lot of work/duplication to flatten it out. I believe that this is request 3 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solidity - Inheritance - GeeksforGeeks
Solidity supports inheritance between smart contracts, where multiple contracts can be inherited into a single contract.
Read more >
Inheritance | Solidity by Example | 0.8.13
Solidity supports multiple inheritance. Contracts can inherit other contract by using the is keyword. Function that is going to be overridden by a...
Read more >
Guide to Inheritance in Solidity - Developer.com
A quick programming tutorial teaching how to handle inheritance in Solidity. Learn more OOP and Solidity development concepts.
Read more >
multiple-inheritance in ethereum - liveBook · Manning
The answer is no. Solidity supports multiple inheritance, so you can inherit a contract from several contracts, as shown here: contract ReleasableSimpleCoin is ......
Read more >
solidity - Multiple Inheritance at particular contract address
Now this results in multiple different instances of the factory contract , and that stage variable is not shared among the contracts. So...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found