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

feat(forge): forge flatten #312

Closed
brockelmore opened this issue Dec 26, 2021 · 4 comments
Closed

feat(forge): forge flatten #312

brockelmore opened this issue Dec 26, 2021 · 4 comments
Labels
T-feature Type: feature

Comments

@brockelmore
Copy link
Member

brockelmore commented Dec 26, 2021

Add an flatten command that would grab a contract and its dependencies and print to stdout. With the other issues around verify-contract, this would provide at the very least users the ability to get forge's best guess at what the compiler is doing with the standard-json input and allow a user to tweak and manually verify if needed. Also I imagine this will surface issues around verify-contract for debugging it.

i.e.:

pragma solidity ^0.8.0;

import "./ContractDep.sol";

contract Contract is ContractDep {
}

would print out:

pragma solidity ^0.8.0;
contract ContractDep {
     uint256 myVar;
}
contract Contract is ContractDep {
}
@brockelmore brockelmore changed the title feat(forge): forge expand Contract.sol:Contract feat(forge): forge expand Dec 26, 2021
@gakonst
Copy link
Member

gakonst commented Dec 26, 2021

I think this is typically called flatten? Agreed otherwise that it can be useful.

@lucas-manuel
Copy link

Yeah this would be analogous to hevm flatten

@brockelmore
Copy link
Member Author

sure i was basing it off of cargo expand didnt know hevm flatten existed. Agree flatten makes more sense

@brockelmore brockelmore changed the title feat(forge): forge expand feat(forge): forge flatten Dec 27, 2021
@gakonst gakonst added the T-feature Type: feature label Jan 6, 2022
@mattsse
Copy link
Member

mattsse commented Jan 22, 2022

closed #506

@mattsse mattsse closed this as completed Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
None yet
Development

No branches or pull requests

4 participants