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

Plugin with task for verifying contracts on etherscan #2

Merged
merged 31 commits into from
Apr 6, 2019

Conversation

mpetrunic
Copy link
Contributor

@mpetrunic mpetrunic commented Mar 19, 2019

Tasks:

  • merged boilerplate
  • extended configuration with etherscan prop object
  • defined task and params for contract verification
  • submit verification request on etherscan
  • result polling
  • etherscan error handling
  • compile contracts and check if contract name exists
  • abi encode constructor arguments
  • unit and integration tests

this pr should resolve issue #1

@mpetrunic mpetrunic marked this pull request as ready for review March 25, 2019 13:33
Copy link

@itirabasso itirabasso left a comment

Choose a reason for hiding this comment

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

Really nice work! I left some comments, but everything is in good shape.

package.json Outdated Show resolved Hide resolved
src/ContractCompiler.ts Outdated Show resolved Hide resolved
src/etherscan/EtherscanResponse.ts Show resolved Hide resolved
src/solc/SolcVersions.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
test/integration/PluginTests.ts Show resolved Hide resolved
await env.run("verify-contract", {
address: deployedAddress,
contractName: "TestContract1",
// libraries: JSON.stringify({

Choose a reason for hiding this comment

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

Can we add a test case of sources using libraries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's bugged, as it seems from their sample client. Works trough GUI though, will report it.

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining this? And if you report it, can you link the report in the comment? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are closed source, so I've reported it trough email. This is what I've sent then so you can try it trough https://ropsten.etherscan.io/sourcecode-demo.html . It fails without explanation. They said that are investigating.

So original deployed source is:
https://gist.github.com/mpetrunic/5f219fd480eb633971db12ef6d17b6d0

Params are  sent as form data but i'm logging it as json are these:
https://gist.github.com/mpetrunic/322e630b332473355ad26b3dec198d86

They work when submitted trough https://ropsten.etherscan.io/verifyContract2?a=0xda628694fece2e6b79ba14cd06435da1c1a95c39 but not when sent to the api, either directly or via https://ropsten.etherscan.io/sourcecode-demo.html.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation! Can you get back to us when they answer your email?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah definitely!

src/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor Author

@mpetrunic mpetrunic left a comment

Choose a reason for hiding this comment

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

Thanks fr review @itirabasso . I'll address issues in the morning

@mpetrunic
Copy link
Contributor Author

@itirabasso @alcuadrado Is this ok?

@alcuadrado alcuadrado merged commit 802a3c9 into NomicFoundation:master Apr 6, 2019
mpetrunic added a commit to NodeFactoryIo/buidler-etherscan that referenced this pull request Jul 6, 2020
Merge pull request NomicFoundation#2 from NodeFactoryIo/master
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.

4 participants