1

I'm trying to deploy a contract to the rinkeby (hope that thats the network to use for beta testing). Deploying worked with the command truffle migrate --reset -f 2 --network rinkeby.

Unfortunately, I tried to access the contract through etherscan and I only can see the bytecode. How should I add the source code to etherscan so that it is possible to interact with the contract on etherscan? Is there a way to do it automatically?

Thanks a lot for any hint!

4
  • etherscan.io/verifyContract2 Commented Oct 18, 2018 at 20:19
  • Thanks for the link. That seems to be what I'm looking for :). Do you know any framework which can verify the Contract automatically ? Commented Oct 18, 2018 at 20:22
  • I don't know of one, no. It's likely there are too many steps included to be able to reliably automate the process. (Someone else might know of something.) Commented Oct 18, 2018 at 20:24
  • Just tried it with github.com/nomiclabs/truffle-flattener but seems something ist still wrong.. Commented Oct 18, 2018 at 20:39

1 Answer 1

0

To have Etherscan show the code associated with a deployed contract, you'll need to go through the verification process:

https://etherscan.io/verifyContract2

However, to interact with your contract you'll probably want to use Remix (https://remix.ethereum.org), and load the contract from the deployed address:

How to load contract from address- remix?

4
  • Any Idea how to find the matched compiler. I just tried the first step and failed. In my code I have: pragma solidity ^0.4.22; So choosed v0.22. commit but there are many versions.. Commented Oct 18, 2018 at 20:40
  • It should be the one without nightly in the name, so v.0.4.22+commit.4cb486ee. Commented Oct 18, 2018 at 20:46
  • Thanks yes it worked. Could deploy the contract with sources. Thanks a lot! Commented Oct 18, 2018 at 20:54
  • Glad it worked :-) Commented Oct 18, 2018 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.