Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release IRealitio as a Separate Package #30

Open
0xferit opened this issue Apr 13, 2021 · 6 comments
Open

Release IRealitio as a Separate Package #30

0xferit opened this issue Apr 13, 2021 · 6 comments

Comments

@0xferit
Copy link
Contributor

0xferit commented Apr 13, 2021

It would be nice to have IRealitio as a separate package and with different versions for different solc minor versions.

Currently, I'm creating a contract that needs to use IRealitio but I need it in solc 0.7.x. And I have to duplicate IRealitio in my repository for this reason, unfortunately.

@edmundedgar
Copy link
Contributor

OK, looking into this. I wonder if it's possible to make the interfaces work across all reasonable versions?

@0xferit
Copy link
Contributor Author

0xferit commented Apr 15, 2021

Probably not guaranteed across minor versions of Solidity, because of breaking changes. But a package for the interface could have release branches for different solc versions.

For example, release a package with version 4.x.x for solc 0.4.x and release a package with version 5.x.x for solc 0.5.x and so on.

@edmundedgar
Copy link
Contributor

Makes sense, are there any projects I should look at that you'd consider "best practice" for this?

@0xferit
Copy link
Contributor Author

0xferit commented Apr 17, 2021

No, but this explains shortly: https://www.gitkraken.com/learn/git/git-flow

Basically the idea is to create release branches for different solc minor versions. Git flow is suitable for this.

@edmundedgar
Copy link
Contributor

Just working on this as I reorganize everything around a monorepo and fix the branding to hose out Realitio stuff and standardize it all on reality.eth.

I think what we'll end up with is a layout like
contracts/interfaces/solc-0.4.25/IRealityETH.sol
contracts/interfaces/solc-0.7.whatever/IRealityETH.sol
...and something similar for the ABIs.

I don't think we'll bother with separate versions for all of these, we'll just make the ABIs inclusive so if version 1 as function1() and version 2 replaces that with function2() we'll just stuff them both in the ABI and the interface, and make a compatible version for any solc version somebody wants to develop with.

I think that's simpler than running separate branches for everything.

We'll have contracts/flat/RealityETH-2.0.sol to store the actual source the thing was compiled with, but the ABI and interface definitions will be designed to work with whatever the user wants to use, regardless of what they were originally deployed with.

Would that solve your problem?

@0xferit
Copy link
Contributor Author

0xferit commented Jun 9, 2021

I think what you describe is a practical way for a maintainer, indeed, but it's not so nice for 3rd parties to see everything in one file and confusing what's needed and what's not. So this seems like a trade-off between making life easy to maintainer vs integrators. However, integrators' life can be made easier also by good documentation, clarifying all these.

About my problem; I don't have a problem anymore actually because I already understand all the details now and even created my own subset of Reality interface which has only necessary parts of the original interface, so you can consider this 'issue' just as a suggestion to make life easier for future integrators.

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

No branches or pull requests

2 participants