Following Step by Step Tutorial for Hardhat and get Uncaught ProviderError: out of gas

I’m following the tutorial over at
Step by Step Tutorial for Hardhat

It’s working great, until I come to the console part.

When I do

(await box.retrieve()).toString()

It gives me the error

Uncaught ProviderError: out of gas
    at EthersProviderWrapper.send (C:\Users\Nano\Documents\Nano\Software\Crypto Projects\ProxyContractTest\node_modules\@nomiclabs\hardhat-ethers\src\internal\ethers-provider-wrapper.ts:13:20)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at LocalAccountsProvider.request (C:\Users\Nano\Documents\Nano\Software\Crypto Projects\ProxyContractTest\node_modules\hardhat\src\internal\core\providers\accounts.ts:131:34)
    at HttpProvider.request (C:\Users\Nano\Documents\Nano\Software\Crypto Projects\ProxyContractTest\node_modules\hardhat\src\internal\core\providers\http.ts:46:19)

I’ve tried a lot of different addresses to figure out what should go in
const box = await Box.attach("0xA9669fc9eacbf9e165F43358caD0AC85801DC8a5")
I’ve tried my proxy address, the open zeppelin upgradable address, and the actual contract address that I’m sending through the proxy.
It seems like none of it works.

I can get my tests to past and I can see it on the test network perfectly fine.

Using the proxy read/write I can see that my store procedures are working fine and I can get the 42, but it doesn’t work in console. It says out of gas, but my wallet has gas, otherwise I would not be able to deploy the contract. Is there some other wallet that I need to load up with gas when using the console?

What gives? Perhaps the console part is out of date somehow?

1 Like

Looks like it was an issue with Gas upping in Rinkeby.
I changed my settings to this

TESTrinkeby: {
      url: alchemyapikeyrinkeby,
      accounts: [testwalpkey],
      gas: 10000000

Adding an extra zero to the gas made it work.


Hi @Tsushima_Yoshiko,

Welcome to the community :wave:

Glad you were able to resolve. Thanks for sharing your solution.