Open lukaw3d opened 3 months ago
From discord: ethers v5 provider.getStorageAt throws
Error: bad result from backend (
method="getStorageAt",
params={"address":"0x52Dcf311dc34Ac9373a4A4cfF37A3292487F273D","blockTag":"latest","position":"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103"},
result="0x0",
error={"reason":"hex data is odd-length","code":"INVALID_ARGUMENT","argument":"value","value":"0x0"},
code=SERVER_ERROR,
version=providers/5.7.2
)
<script type="module">
import { ethers } from "https://cdnjs.cloudflare.com/ajax/libs/ethers/5.7.2/ethers.esm.js";
const provider = new ethers.providers.Web3Provider(window.ethereum)
console.log(await provider.getStorageAt(
"0x52Dcf311dc34Ac9373a4A4cfF37A3292487F273D",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103",
"latest",
))
</script>
Ethers v6 throws
TypeError: invalid BytesLike value (
argument="value",
value="0x0",
code=INVALID_ARGUMENT,
version=6.13.2
)
<script type="module">
import { ethers } from "https://cdnjs.cloudflare.com/ajax/libs/ethers/6.13.2/ethers.js";
const provider6 = new ethers.BrowserProvider(window.ethereum)
console.log(await provider6.getStorage(
"0x52Dcf311dc34Ac9373a4A4cfF37A3292487F273D",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103",
"latest",
))
</script>
Copied from slack before it's lost
Luka:
Peter:
Luka: