Skip to content

Commit

Permalink
Pad position in JSON-RPC getStorageAt calls (#2982).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed May 14, 2022
1 parent 01aea70 commit d5815cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/providers/src.ts/json-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { Provider, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { Signer, TypedDataDomain, TypedDataField, TypedDataSigner } from "@ethersproject/abstract-signer";
import { BigNumber } from "@ethersproject/bignumber";
import { Bytes, hexlify, hexValue, isHexString } from "@ethersproject/bytes";
import { Bytes, hexlify, hexValue, hexZeroPad, isHexString } from "@ethersproject/bytes";
import { _TypedDataEncoder } from "@ethersproject/hash";
import { Network, Networkish } from "@ethersproject/networks";
import { checkProperties, deepCopy, Deferrable, defineReadOnly, getStatic, resolveProperties, shallowCopy } from "@ethersproject/properties";
Expand Down Expand Up @@ -531,7 +531,7 @@ export class JsonRpcProvider extends BaseProvider {
return [ "eth_getCode", [ getLowerCase(params.address), params.blockTag ] ];

case "getStorageAt":
return [ "eth_getStorageAt", [ getLowerCase(params.address), params.position, params.blockTag ] ];
return [ "eth_getStorageAt", [ getLowerCase(params.address), hexZeroPad(params.position, 32), params.blockTag ] ];

case "sendTransaction":
return [ "eth_sendRawTransaction", [ params.signedTransaction ] ]
Expand Down

0 comments on commit d5815cc

Please sign in to comment.