title: How to make sure Web3 / Metamask recognize that I am the smart contract owner?
body: <p>I am trying to read some data from a smart contract that I have created and available on the main net here:
  <a href="https://snowtrace.io/address/0x98608c1e3ae104e7a11ea2879b44669a1c38b73d#code" rel="nofollow noreferrer">https://snowtrace.io/address/0x98608c1e3ae104e7a11ea2879b44669a1c38b73d#code</a></p>
  <p>When I try to interact with my smart contract via Web3 library I am able to read all public details, except for one called: getCurrentBalance()</p>
  <p>which requires owner permission (which I am). I triple checked to make sure that I am on the right owner account in Metamask.</p>
  <p>This is my html file:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;Web 3 Demo&lt;/title&gt;
  &lt;script src='node_modules/web3/dist/web3.min.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;button onclick=&quot;getCurrentBalance();&quot;&gt;Get Current Contract Balance&lt;/button&gt;
      Status: &lt;span id=&quot;status&quot;&gt;Loading...&lt;/span&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;index.js&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>This is the index.js:</p>
  <pre><code>// Check metamask installation and connect to site
  async function loadWeb3() {
      if (window.ethereum) {
          window.web3 = new Web3(window.ethereum);
          window.ethereum.enable();
      }
  }
  
  // In the html file there is a span called status this function updates the print out
  function updateStatus(status) {
      const statusEl = document.getElementById('status');
      statusEl.innerHTML = status;
      console.log(status);
  }
  
  // This function links to the smart contract for interactions
  async function loadContract() {
      return await new window.web3.eth.Contract([{&quot;inputs&quot;: [],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;constructor&quot;},{&quot;constant&quot;:false,&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address payable&quot;,&quot;name&quot;:&quot;_liquitdateTo&quot;,&quot;type&quot;:&quot;address&quot;}],&quot;name&quot;:&quot;destroySmartContract&quot;,&quot;outputs&quot;:[],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:true,&quot;inputs&quot;:[],&quot;name&quot;:&quot;fundsReceived&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:true,&quot;inputs&quot;:[],&quot;name&quot;:&quot;getCurrentBalance&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:false,&quot;inputs&quot;:[],&quot;name&quot;:&quot;getFunds&quot;,&quot;outputs&quot;:[],&quot;payable&quot;:true,&quot;stateMutability&quot;:&quot;payable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:false,&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;bool&quot;,&quot;name&quot;:&quot;_bool&quot;,&quot;type&quot;:&quot;bool&quot;}],&quot;name&quot;:&quot;pause&quot;,&quot;outputs&quot;:[],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:true,&quot;inputs&quot;:[],&quot;name&quot;:&quot;paused&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;bool&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;bool&quot;}],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:true,&quot;inputs&quot;:[],&quot;name&quot;:&quot;smartContractAddress&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;address&quot;}],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;constant&quot;:true,&quot;inputs&quot;:[],&quot;name&quot;:&quot;tresury&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;address payable&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;address&quot;}],&quot;payable&quot;:false,&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;}], '0x98608C1e3ae104E7A11EA2879b44669a1c38b73D');
  }
  
  // This is the main program function that calls all the previous ones
  async function load() {
      await loadWeb3();
      window.contract = await loadContract();
      updateStatus('Ready!');
  }
  
  async function getCurrentBalance() {
      updateStatus('fetching...');
      const getCurrentBalance = await window.contract.methods.getCurrentBalance().call();
      updateStatus(`Current Contract Balance: ${getCurrentBalance}`);
  }
  
  load();
  </code></pre>
  <p>This is the error I get in the console:</p>
  <p><a href="https://i.stack.imgur.com/Zlslm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zlslm.png" alt="enter image description here" /></a></p>
  <p>How to read the getCurrentBalance() from the smart contract?</p>