Etherscan API "Error! Missing Or invalid Module name"

by DIGVJSS   Last Updated April 15, 2019 07:28 AM

I am using APIs to verify my smart contract.

I have a very simple smart contract to test the verification process, here it is -

pragma solidity ^0.5.0;

contract HelloWorld {
    address public owner;
    constructor (address _owner) public{
        owner = _owner;

This is deployed on address 0xB74580969Dd84f83fa7b36726968CB7cE24Ad4de. In the verification process, I am passing the payload to etherscan API with the necessary details as shown below -

var sourceCode = fs.readFileSync(path.join(__dirname, '../../ERC20-Mintable-Contract/contract.sol'), 'utf8');

        var data = {
            apikey: contractConfig.ETHERSCAN_API_KEY,
            module: 'contract',
            action: 'verifysourcecode',
            contractaddress: contractAddress,
            sourceCode: sourceCode,
            contractname: contractConfig.CONTRACT_NAME,
            compilerversion: contractConfig.COMPILER_VERSION,
            optimizationUsed: 1,
            runs: 200,
            constructorArguements: '00000000000000000000000066f0ee075909d28c38f374d72154b32ee5663f34',
        };'', data)
            .then( async response => {
                    status: true
            .catch(error => {

This fails with below error as output -

    status: '0',
    message: 'NOTOK',
    result: 'Error! Missing Or invalid Module name' 

Your help is much appreciated!


Related Questions

Transaction remains pending on RINKEBY network

Updated June 28, 2018 10:28 AM

ethers.js Invalid hexlify value error

Updated October 24, 2018 12:28 PM

Ether withdraw time

Updated December 05, 2017 15:28 PM

Ethereum Transaction using API

Updated August 10, 2018 12:28 PM