Git Product home page Git Product logo

Comments (9)

nklipa13 avatar nklipa13 commented on September 3, 2024 3

@Enigmatic331 it seems that plugin is working properly now

from truffle-plugin-verify.

rkalis avatar rkalis commented on September 3, 2024 1

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

from truffle-plugin-verify.

rkalis avatar rkalis commented on September 3, 2024

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?

from truffle-plugin-verify.

mtbitcoin avatar mtbitcoin commented on September 3, 2024

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

from truffle-plugin-verify.

Enigmatic331 avatar Enigmatic331 commented on September 3, 2024

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.

from truffle-plugin-verify.

Enigmatic331 avatar Enigmatic331 commented on September 3, 2024

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!

from truffle-plugin-verify.

rkalis avatar rkalis commented on September 3, 2024

Thanks for the quick fixes @mtbitcoin @Enigmatic331!

from truffle-plugin-verify.

Julio77 avatar Julio77 commented on September 3, 2024

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.

from truffle-plugin-verify.

Julio77 avatar Julio77 commented on September 3, 2024

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

from truffle-plugin-verify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.