nvalidArgumentsError: Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x0' has a length of 3 #117
Unanswered
mubashirhussainkhadim
asked this question in
Q&A
Replies: 1 comment
-
Hi, Can you please watch this section and format your question accordingly? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Deploying FunWithStorage and waiting for confirmations...
deploying "FunWithStorage" (tx: 0x8a2b88404cb7a4645fa87912c630e9b595ce500a92b6da8cebe59f1a5eb0d99c)...: deployed at 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 with 227342 gas
Logging storage...
An unexpected error occurred:
Error: ERROR processing /Users/mubashirkhadim/Documents/codes/hardhat-fund-me/deploy/99-deploy-storage-fun.js:
InvalidArgumentsError: Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x0' has a length of 3
at validateParams (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/core/jsonrpc/types/input/validation.ts:64:13)
at EthModule._getStorageAtParams (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:695:26)
at EthModule.processRequest (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:185:49)
at HardhatNetworkProvider._send (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:195:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
at HardhatNetworkProvider.request (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:118:18)
at EthersProviderWrapper.send (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
at DeploymentsManager.executeDeployScripts (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1223:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
at DeploymentsManager.runDeploy (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1053:5)
at SimpleTaskDefinition.action (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat-deploy/src/index.ts:409:5)
at Environment._runTaskDefinition (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
at Environment.run (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
at SimpleTaskDefinition.action (/Users/mubashirkhadim/Documents/codes/hardhat-fund-me/node_modules/hardhat-deploy/src/index.ts:555:32)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
mubashirkhadim@Mubashirs-MBP hardhat-fund-me %
FunWithStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract FunWithStorage {
uint256 favoriteNumber; // Stored at slot 0
bool someBool; // Stored at slot 1
uint256[] myArray; /* Array Length Stored at slot 2,
but the objects will be the keccak256(2), since 2 is the storage slot of the array /
mapping(uint256 => bool) myMap; / An empty slot is held at slot 3
and the elements will be stored at keccak256(h(k) . p)
p: The storage slot (aka, 3)
k: The key in hex
h: Some function based on the type. For uint256, it just pads the hex
*/
uint256 constant NOT_IN_STORAGE = 123;
uint256 immutable i_not_in_storage;
}
99-deploy-storage-fun.js
`const { getNamedAccounts, deployments, network, ethers } = require("hardhat")
const { networkConfig, developmentChains } = require("../helper-hardhat-config")
const { verify } = require("../utils/verify")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
}
module.exports.tags = ["storage"]`
Beta Was this translation helpful? Give feedback.
All reactions