title: The contract code couldn't be stored, please check your gas limit : Ethereum Smart Contract Deployment Failed:
body: <p>I'm learning how <strong>Ethereum Smart Contract</strong> are developed and deployed using solidity, web3 and Javascript.</p>
  
  <p>I've successfully deployed a contract on <strong><code>Ganache</code></strong>. Now when I'm trying to deployed it on <strong><code>Rinkby Test Net</code></strong> using <strong><code>truffle-hdwallet-provider</code></strong> It just fail.</p>
  
  <p>Ive sucessfully created <strong><code>web3</code></strong> object using <strong><code>truffle-hdwallet-provider</code></strong> and I sucessfullly get the account list but the deployment to the testnet always get failed.</p>
  
  <blockquote>
    <p><strong>You can check here that my deployment gets failed.</strong> </p>
    
    <p><a href="https://rinkeby.etherscan.io/address/0x2f20b8F61813Df4e114D06123Db555325173F178" rel="nofollow noreferrer">https://rinkeby.etherscan.io/address/0x2f20b8F61813Df4e114D06123Db555325173F178</a></p>
  </blockquote>
  
  <p>Here is my <code>deploy script</code></p>
  
  <pre><code>const HDWalletProvider = require('truffle-hdwallet-provider');
  const Web3 = require ('web3');
  const {interface, bytecode} = require('./compile');
  
  const provider = new HDWalletProvider(
      'memonics',                         // this is correct 
      'https://rinkeby.infura.io/mylink'  // this is correct 
      );
  
  const web3 = new Web3(provider);
  
  const deploy = async() =&gt;{
      const accounts = await web3.eth.getAccounts();
      console.log('Attempting to deploy from account:', accounts[0]); //This excute fine
      try {
      const result = await new web3.eth.Contract(JSON.parse(interface)).deploy({ data: bytecode, arguments: ['Hi There!']}).send({ from: accounts[0], gas: '1000000'});
      console.log('Contract deployed to ', result.options.address);
      }
      catch(err) {
          console.log('ERROR'); // Here I get error 
      }
  
  
  
  };
  deploy();
  </code></pre>
  
  <p>and here is my Contract</p>
  
  <pre><code>pragma solidity ^0.4.17;
  
  contract Inbox{
      string public message;
  
      constructor (string initialMessage) public {
          message = initialMessage;
      }
      function setMessage(string newMessage) public {
          message = newMessage;
      }
  }
  </code></pre>
  
  <p>EDIT: I tried using <strong>Remix</strong> and it deployed successfully but when trying with  <strong>truffle-hdwallet-provider</strong>  it gives error: <strong>The contract code couldn't be stored, please check your gas limit.</strong> I tied with different gas values (up-to max possible)  but still no result.</p>