Skip to content

Commit

Permalink
fix value format
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSulpiride committed Aug 13, 2024
1 parent 91a9dfa commit 2ab3514
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ const EP6_NONCE_SLOT = 1;
export function getNonceStorageMap(
account: string,
nonce: BigNumberish
): [string, BigNumber] {
): [string, string] {
const abiCoder = new ethers.utils.AbiCoder();
const key = BigNumber.from(nonce).shr(64);
const seq = BigNumber.from(nonce).shl(192).shr(192);
let seq = BigNumber.from(nonce).shl(192).shr(192)._hex;
seq = ethers.utils.hexZeroPad(seq, 32);
const keyLevelEncoded = abiCoder.encode(
["address", "uint256"],
[account, EP6_NONCE_SLOT]
Expand All @@ -28,7 +29,7 @@ export function getNonceStorageMap(
export function getNonceStorageMapForBundle(bundle: Bundle): StorageMap {
if (bundle.entries.length == 0) return bundle.storageMap;
const storageMap = { ...bundle.storageMap }; // cloning
const entryPoint = bundle.entries[0].entryPoint;
const entryPoint = bundle.entries[0].entryPoint.toLowerCase();
for (const entry of bundle.entries) {
const { userOp } = entry;
const nonceCheck = getNonceStorageMap(userOp.sender, userOp.nonce);
Expand Down

0 comments on commit 2ab3514

Please sign in to comment.