Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat(solc): Add standard-json-input #1126

Merged
merged 7 commits into from
Apr 9, 2022
Merged

Conversation

pyk
Copy link
Contributor

@pyk pyk commented Apr 8, 2022

Motivation

This changes will allows forge verify-contract to submit contract verification using standard-input-json format to etherscan.

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this,
few smol nits and suggestions

ethers-solc/src/lib.rs Show resolved Hide resolved
ethers-solc/src/artifacts/mod.rs Outdated Show resolved Hide resolved
ethers-solc/src/artifacts/mod.rs Outdated Show resolved Hide resolved
ethers-etherscan/src/contract.rs Show resolved Hide resolved
@@ -426,6 +426,36 @@ impl<T: ArtifactOutput> Project<T> {
pub fn flatten(&self, target: &Path) -> Result<String> {
self.paths.flatten(target)
}

/// Returns standard-json-input to compile the target contract
pub fn standard_json_input(&self, target: &Path) -> Result<String> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather return a the CompilerInput here instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still, I think CompilerInput would make more sense here and could be useful to for example use it directly with Solc::compile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let me update it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattsse updated 👍

ethers-solc/src/lib.rs Outdated Show resolved Hide resolved
@gakonst gakonst merged commit 247f08f into gakonst:master Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants