title: How to fix invalid address Error? Web3 JS with MetaMask
body: <p>I deployed my contract to Goerli test net. Deploying was successful. And I tested it in Remix.</p>
  <p>Contract code:</p>
  <pre><code>pragma solidity ^0.5.0;
  
  contract Test{
      
      string private str;
      
      constructor() public {
          str = &quot; &quot;;
      }
      
      function getStr() public view returns(string memory  _str){
          _str = str;
      }
      
      function setStr(string memory  _str) public{
          str = _str;
      }
  }
  </code></pre>
  <p>Then I tried to make a web interface using web3 and MetaMask.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
          ethereum.enable()
          var abi = [
      {
          &quot;constant&quot;: false,
          &quot;inputs&quot;: [
              {
                  &quot;internalType&quot;: &quot;string&quot;,
                  &quot;name&quot;: &quot;_str&quot;,
                  &quot;type&quot;: &quot;string&quot;
              }
          ],
          &quot;name&quot;: &quot;setStr&quot;,
          &quot;outputs&quot;: [],
          &quot;payable&quot;: false,
          &quot;stateMutability&quot;: &quot;nonpayable&quot;,
          &quot;type&quot;: &quot;function&quot;
      },
      {
          &quot;inputs&quot;: [],
          &quot;payable&quot;: false,
          &quot;stateMutability&quot;: &quot;nonpayable&quot;,
          &quot;type&quot;: &quot;constructor&quot;
      },
      {
          &quot;constant&quot;: true,
          &quot;inputs&quot;: [],
          &quot;name&quot;: &quot;getStr&quot;,
          &quot;outputs&quot;: [
              {
                  &quot;internalType&quot;: &quot;string&quot;,
                  &quot;name&quot;: &quot;_str&quot;,
                  &quot;type&quot;: &quot;string&quot;
              }
          ],
          &quot;payable&quot;: false,
          &quot;stateMutability&quot;: &quot;view&quot;,
          &quot;type&quot;: &quot;function&quot;
      }
      ];
          var address = 0x4316d047388e61EBC3Ed34DFf4cEE215840decDa;
          var myContract = web3.eth.contract(abi);
          var TestC = myContract.at(address);
          console.log(TestC);
      var x = TestC.getStr();
  &lt;/script&gt;
  </code></pre>
  <p>And when I ran it, it returned:</p>
  <blockquote>
  <p>Uncaught Error: invalid address</p>
  <p>at c (inpage.js:1)</p>
  <p>at inputCallFormatter (inpage.js:1)</p>
  <p>at inpage.js:1</p>
  <p>at Array.map ()</p>
  <p>at o.formatInput (inpage.js:1)</p>
  <p>at o.toPayload (inpage.js:1)</p>
  <p>at w.e [as call] (inpage.js:1)</p>
  <p>at u.call (inpage.js:1)</p>
  <p>at u.execute (inpage.js:1)</p>
  <p>at (index):46</p>
  </blockquote>
  <p>What I need to do?</p>