I am using the following code to set a slot to a value on hardhat network:
public async setStorageAt(addr: EthAddress, slot: string, value: string): Promise<any> {
const result = await this.provider.request({
method: 'hardhat_setStorageAt',
params: [addr.toString(), slot, value],
});
return result;
}
And when I try to set the value of a slot
0x0c0c87e2d76a59631866640201b73cd5494944ef1f6c0605583699b7d52d4e8d
,
I get the following error in the logs of hardhat network node:
hardhat_setStorageAt
Errors encountered in param 1: Invalid value "0x0c0c87e2d76a59631866640201b73cd5494944ef1f6c0605583699b7d52d4e8d" supplied to : QUANTITY
Why am I receiving this error given that the value is smaller than the max storage slot index (2 ** 256)?
The contract I am interacting with is on mainnet and has the following address:
0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA
Thank you