-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 inspect subcommand #873
Conversation
Yep! Working on that... @mds1 's base command in #859 used perl to sed newline chars, so trying to figure out what to use internally for serde_json::Values here. Open to suggestions! |
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.
thanks for this.
some nits :)
@@ -452,6 +452,39 @@ script ran | |||
); | |||
}); | |||
|
|||
// tests that the `inspect` command works correctly | |||
forgetest!(can_execute_inspect_command, |prj: TestProject, mut cmd: TestCommand| { |
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.
very nice!
Overview
Introduces an
inspect
subcommand forforge
that outputs one of{ir, bytecode}
for a given contract as specified by #859TODO
Implement the following modes for
forge inspect <CONTRACT> <MODE>
ContractArtifactFields::Abi
ContractArtifactFields::Bytecode
ContractArtifactFields::DeployedBytecode
ContractArtifactFields::Assembly
ContractArtifactFields::AssemblyOptimized
ContractArtifactFields::MethodIdentifiers
ContractArtifactFields::GasEstimates
ContractArtifactFields::StorageLayout
ContractArtifactFields::DevDoc
ContractArtifactFields::Ir
ContractArtifactFields::IrOptimized
ContractArtifactFields::Metadata
ContractArtifactFields::UserDoc
ContractArtifactFields::Ewasm
Compilation Suppression
inspect
Example compilation output:
![Screenshot from 2022-03-09 12-02-58](https://user-images.githubusercontent.com/21288394/157524870-9112bfdf-9229-4ee7-b4dc-0c065c1f9a88.png)
Override Compiler Optimization for certain
ContractArtifactFields
variantsContractArtifactFields::AssemblyOptimized
Extra Output Fixes