title: call revert exception in using ether.js
body: <p>i am setting up react with ether.js and smart contract is deployed using hardhat on localhost network. React app is connected to metasmask using</p>
  <pre><code>const provider = new ethers.providers.Web3Provider(window.ethereum);
  </code></pre>
  <p>the contract is written below</p>
  <pre><code>//SPDX-License-Identifier: Unlicense
  pragma solidity ^0.8.0;
  
  import &quot;hardhat/console.sol&quot;;
  
  contract Greeter {
      string private greeting;
  
      constructor(string memory _greeting) {
          console.log(&quot;Deploying a Greeter with greeting:&quot;, _greeting);
          greeting = _greeting;
      }
  
      function greet() public view returns (string memory) {
          return greeting;
      }
  
      function setGreeting(string memory _greeting) public {
          console.log(&quot;Changing greeting from '%s' to '%s'&quot;, greeting, _greeting);
          greeting = _greeting;
      }
  }
  </code></pre>
  <p>i deployed this contract using npx hardhat run script.js.In the react code i am fetching contract object using</p>
  <pre><code>const erc20=new ethers.Contract(address,obj.abi,signer);
  </code></pre>
  <p>and in the useEffect i am trying to call erc20.greet()
  which is giving error in console.
  **
  (in promise) Error: call revert exception (method=&quot;greet()&quot;, errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.5.0)
  **</p>