PatrickAlphaC / hardhat-fund-me-fcc

82 stars 183 forks source link

Error on storage-fun deploy - Errors encountered in param 1: Invalid value "0x0000000000000000000000000000000000000000000000000000000000000000" supplied to : QUANTITY #62

Closed stackaccount1 closed 2 years ago

stackaccount1 commented 2 years ago

Receiving the following error when running the 99-deploy-storage-fun.js ->

----------------------------------------------------
Deploying FunWithStorage and waiting for confirmations...
deploying "FunWithStorage" (tx: 0xf2ce2ca8b8683ca2c6cf0b485fc0881c410149a34ac64c5c6ae9a853175ee4b4)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 227342 gas
Logging storage...
An unexpected error occurred:

Error: ERROR processing /home/user/Desktop/hardhat-fund-me-fcc/deploy/99-deploy-storage-fun.js:
InvalidArgumentsError: Errors encountered in param 1: Invalid value "0x0000000000000000000000000000000000000000000000000000000000000000" supplied to : QUANTITY
    at validateParams (/home/user/Desktop/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/jsonrpc/types/input/validation.ts:64:13)

My code is exactly the same not sure if anyone else is running into this issue?

PatrickAlphaC commented 2 years ago

Can you please tell me step by step how you got the issue starting from:

git clone https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
cd hardhat-fund-me-fcc
yarn
yarn hardhat test
stackaccount1 commented 2 years ago

Can you please tell me step by step how you got the issue starting from:

git clone https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
cd hardhat-fund-me-fcc
yarn
yarn hardhat test

Thank you for taking the time to respond to me. This is the error I receive following the above steps as you stated:

hardhat-fund-me-fcc$ yarn hardhat test
yarn run v1.22.19
warning package.json: No license field
warning ../../../package.json: No license field
$ /home/user/Desktop/test-hh-fcc/hardhat-fund-me-fcc/node_modules/.bin/hardhat test
Compiling 5 files with 0.6.6
Compiling 4 files with 0.8.8
Warning: Unused local variable.
  --> contracts/exampleContracts/FunWithStorage.sol:28:9:
   |
28 |         uint256 newVar = favoriteNumber + 1; // SLOAD
   |         ^^^^^^^^^^^^^^

Warning: Unused local variable.
  --> contracts/exampleContracts/FunWithStorage.sol:29:9:
   |
29 |         bool otherVar = someBool; // SLOAD
   |         ^^^^^^^^^^^^^

Warning: Function state mutability can be restricted to view
  --> contracts/exampleContracts/FunWithStorage.sol:27:5:
   |
27 |     function doStuff() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Solidity compilation finished successfully

  FundMe
    constructor
      ✓ sets the aggregator addresses correctly
    fund
      ✓ Fails if you don't send enough ETH
      ✓ Updates the amount funded data structure
      ✓ Adds funder to array of funders
    withdraw
      ✓ withdraws ETH from a single funder
GasCost: 101605997795040
GasUsed: 77744
GasPrice: 1306930410
      ✓ is allows us to withdraw with multiple funders
      ✓ Only allows the owner to withdraw

  7 passing (1s)

Done in 4.04s.

So after modifying that FundWithStorage.sol contract to compile properly, I believe I then run into the error I posted. Just fyi, if I modify the contract and edit the deploy script to:

             `Location ${i}: ${await ethers.provider.getStorageAt(
                funWithStorage.address,
                ethers.utils.keccak256(i)
            )}`

I log storage locations but nothing shows existing in storage locations only 0x000-000s.

Thank you so much for your time and creating this course. I appreciate you.

stackaccount1 commented 2 years ago

Can you please tell me step by step how you got the issue starting from:

git clone https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
cd hardhat-fund-me-fcc
yarn
yarn hardhat test
yarn hardhat deploy 

instead of

yarn hardhat test 

everything works properly. thank you.