title: Get Global Var Hardhat Console
body: <p>Hi I am trying to test my contract in hardhat console. I am able to run my functions just fine but when I try to read a public global var it throws an error.</p>
  <p>So for example:</p>
  <pre><code>    uint256 public testVar;
  
     function setInt(uint256 _intset) external {
          testVar = _intset;
      }
  </code></pre>
  <p>Then after successfully runnign await factory.setInt(123) in the console I run:</p>
  <p>await factory.testVar()</p>
  <p>But then for some reason I get the error message:</p>
  <pre><code>Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method=&quot;testVar()&quot;, data=&quot;0x&quot;, errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.6.3)
      at step  {
    reason: null,
    code: 'CALL_EXCEPTION',
    method: 'testVar()',
    data: '0x',
    errorArgs: null,
    errorName: null,
    errorSignature: null,
    address: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
    args: [],
    transaction: {
      data: '0x9c328fb3',
      to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
      from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
      gasLimit: BigNumber { value: &quot;29021272&quot; }
    }
  }
  </code></pre>
  <p>Any idea why i cannot simply get this public var?</p>
  <p>Worth noting if i try run</p>
  <p>await factory.testVar without the param it just says</p>
  <p>[Function (anonymous)]</p>
  <p>Thanks</p>