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

Not working for Kovan #22

Closed
nklipa13 opened this issue Oct 31, 2019 · 9 comments
Closed

Not working for Kovan #22

nklipa13 opened this issue Oct 31, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@nklipa13
Copy link

It seems that the verifier isn't working for the last two days.

Steps to reproduce:
Create new repo, follow all instructions from readme file with some simple test contract and try to verify on Kovan test network, haven't checked for other networks,

for Kovan it says "Unable to verify",
for Mainnet says "No instance of contract Test found for network id 1"

@rkalis
Copy link
Owner

rkalis commented Oct 31, 2019

Hey, thanks for opening this issue. I tried to do a test with a SimpleStorage instance on Rinkeby, and I got the same results. I outputted the data I sent to the Etherscan API:

{ apikey: <redacted>,
  module: 'contract',
  action: 'verifysourcecode',
  contractaddress: '0x818887C7AE9057FBa6380EcE5f8034b3B85D197a',
  sourceCode:
   'pragma solidity ^0.5.0;\n\n\ncontract SimpleStorage {\n  uint storedData;\n\n  function set(uint x) public {\n    storedData = x;\n  }\n\n  function get() public view returns (uint) {\n    return storedData;\n  }\n}',
  codeformat: 'solidity-single-file',
  contractname: 'SimpleStorage',
  compilerversion: 'v0.5.8+commit.23d335f2',
  optimizationUsed: 0,
  runs: 200,
  constructorArguements: '',
  evmversion: undefined,
  licenseType: 1 }

I tried copy-pasting these values into the Etherscan verify web form. This worked correctly.

So then I tried copy-pasting these values into the Etherscan verify API demo. This did not work.

This leads me to believe that there might be an issue with the Etherscan verify API at the moment, since both truffle-plugin-verify and the API demo did not work, while the web form did work.

@mtbitcoin, are there any known issues with the verify API at this time?

@mtbitcoin
Copy link

We are looking into this. We did recently push some changes to support submitting standard input json contract verification

@Enigmatic331
Copy link

Enigmatic331 commented Nov 1, 2019

Hey @rkalis - Have done a quick test using the same source through the Rinkeby's verify API demo - Seemed to work fine on my end with the contract: https://rinkeby.etherscan.io/address/0xa70e7FB5aad8f9FF2dDec26bbf54dAA026f72FbD#code

Likewise for Kovan: https://kovan.etherscan.io/address/0x7Ff1037803575eE91B13C25A145d68D5Adb6E8A6#code

A quick screencap on the settings (perhaps some bits of the setting requirements changed in between these couple of days):

image

I will give it a shot through the Truffle Verify Plugin itself to see if there might be anything I am missing (though I have to admit, I hadn't been using Truffle for a while now).

ADD: Ah! I reckon it was Single File verification which was causing issues - Retrying.

@Enigmatic331
Copy link

Hey @rkalis - Fixes were pushed across and a few tests were done (e.g.: https://kovan.etherscan.io/address/0x144f09D87A02719c869cfE407b5e1188a7DB59fa#code)

Any chance for a retry to see if it looks good now, please?
Many thanks!

@nklipa13
Copy link
Author

nklipa13 commented Nov 1, 2019

@Enigmatic331 it seems that plugin is working properly now

@rkalis
Copy link
Owner

rkalis commented Nov 1, 2019

Thanks for the quick fixes @mtbitcoin @Enigmatic331!

@rkalis rkalis closed this as completed Nov 1, 2019
@Julio77
Copy link

Julio77 commented Jun 3, 2020

Hi @rkalis ,
I am trying to verify the contracts deployed by truffle, but I get the following:

x:> truffle run verify Contrato1 Contrato2 --network rinkeby
Truffle v4.1.11 - a development framework for Ethereum

Usage: truffle <command> [options]

Commands:
  init      Initialize new and empty Ethereum project
  compile   Compile contract source files
  migrate   Run migrations to deploy contracts
  deploy    (alias for migrate)
  build     Execute build pipeline (if configuration present)
  test      Run JavaScript and Solidity tests
  debug     Interactively debug any transaction on the blockchain (experimental)
  opcode    Print the compiled opcodes for a given contract
  console   Run a console with contract abstractions and commands available
  develop   Open a console with a local development blockchain
  create    Helper to create new contracts, migrations and tests
  install   Install a package from the Ethereum Package Registry
  publish   Publish a package to the Ethereum Package Registry
  networks  Show addresses for deployed contracts on each network
  watch     Watch filesystem for changes and rebuild the project automatically
  serve     Serve the build directory on localhost and watch for changes
  exec      Execute a JS module within this Truffle environment
  unbox     Download a Truffle Box, a pre-built Truffle project
  version   Show version number and exit

See more at http://truffleframework.com/docs

Versions:
Truffle v4.1.11
TestNet: Rinkeby
Solidity 0.4.24

My Config

const HDWalletProvider = require('@truffle/hdwallet-provider');
require('dotenv').config();
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();

module.exports = {

  networks: {
    rinkeby: {
      provider: () => new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/key"),
      network_id: 4,
      gas: 4500000,
      gasPrice: 10000000000,
    },
  },
  plugins: [
    'truffle-plugin-verify'
  ],
  api_keys: {
    etherscan: process.env.ETHERSCAN_API_KEY
  },
  // Set default mocha options here, use special reporters etc.
  mocha: {
    // timeout: 100000
  },
  // Configure your compilers
  compilers: {
    solc: {
      version: "0.4.24",    // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)
      settings: {          // See the solidity docs for advice about optimization and evmVersion
       optimizer: {
         enabled: false,
         runs: 200
       },
      //  evmVersion: "byzantium"
      }
    }
  }
}

Dependences
npm install truffle-plugin-verify

Contracts:
Contract 1
Contract 2

Regards.

@rkalis
Copy link
Owner

rkalis commented Jun 3, 2020

Hi @Julio77. Truffle plugins were introduced in Truffle v5.0, so you should update your Truffle installation to use truffle-plugin-verify!

@Julio77
Copy link

Julio77 commented Jun 9, 2020

Hi @rkalis
Thanks, nice, i will try again with this code.

@rkalis rkalis added the bug Something isn't working label May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants