-
Notifications
You must be signed in to change notification settings - Fork 554
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
Feat publish source #914
Feat publish source #914
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Update:
TODO:
|
@iamdefinitelyahuman I have tested the last version: 763a5c8 Great work @matnad h/t |
todo: add commit hash to compiler version
- improve formatting - handle bad request when checking for status
- filename without source location - linting
- Strip comments from source code between offsets - Find a set of all global structs and enums, insert them at the start of the flattened file - Sort files by topological order in respect to the dependencies
- to prevent failing tests when compound changes their implementation - also wrote a test for fetching proxy form etherscan, but it is too slow (commented out)
This turned out to be a monster of a feature! A lot of edge cases have been handled and I currently can't find a repo that doesn't verify (including all brownie mixes). Happy to merge after a review. For repos that don't work please open an issue and I will look at it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming along nicely..
including doc update
- added ast to interfaces
Big update.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing stuff.. this clearly has been a huge amount of work. The community loves you ❤️
- more efficient writing - slight change to regex
I still have the issue, even when I'm using |
im getting a jsondecodererror when i use publish_source=True. I was able to manually verify(copy and paste) but wasnt able to automatically verify. only one .sol file |
What I did
Added a method to publish source to etherscan for solidity contracts.
DeployedContract.publish_source()
Related issue: #411
How I did it
Flatten source code into one file (thanks Ben for starting on this). Make sure to include all comments, proper licensing and exactly one pragma statement.
Will wait for contract to be recognized by etherscan after deploying, then submit request for verification and finally wait for the verification to be processed and report the result.
How to verify it
deployed = MyContract.deploy({'from': account}, publish_source=True)
and also
MyContract.get_verification_info()
-> https://ropsten.etherscan.io/address/0x6De9c6197bB8f61177C30946d90CAC2720272c5c#code
Tests are adapted for the changes to the solc versioning, but no new tests for this feature are written yet.
Checklist