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

Flatten contract source using CLI #849

Closed
quintinbrooks opened this issue Nov 18, 2020 · 5 comments
Closed

Flatten contract source using CLI #849

quintinbrooks opened this issue Nov 18, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@quintinbrooks
Copy link

Overview

Currently, Brownie doesn't provide a way to flattening smart contracts. Feature for flattening smart contracts can be a way for testing contracts with Brownie, while deploying them using another tool. Also, it can simplify the tasks required for verifying an smart contract on the Etherscan.

Specification

For the CLI following simple argument can be used:

brownie --flatten

Dependencies

#411 is related to this issue. Because, probably flattening smart contracts (written in Solidity) will make it easier to verify them on Etherscan.

@iamdefinitelyahuman
Copy link
Member

This could be useful as a flag within brownie compile, I think.

@iamdefinitelyahuman iamdefinitelyahuman added the enhancement New feature or request label Nov 21, 2020
@matnad
Copy link
Collaborator

matnad commented Jan 8, 2021

Implemented by #914.
@quintinbrooks Use ContractContainer.get_verification_info()["flattened_source"]

@matnad matnad closed this as completed Jan 8, 2021
@nazariyv
Copy link

@matnad looks like 'flattened_source' is no longer available in 1.17.0?

@rodriguesmvinicius
Copy link

@matnad looks like 'flattened_source' is no longer available in 1.17.0?

same here using 1.18.1 dont recognize the key

@DanielVF
Copy link

container = YourContractName
print("\n\n".join([x['content'] for x in container.get_verification_info()['standard_json_input']['sources'].values()]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants