Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
forshtat committed Dec 22, 2024
1 parent 8ab1c22 commit 623cfea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions packages/bundler/src/modules/BundleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ export class BundleManager implements IBundleManager {
}
mergeStorageMap(storageMap, validationResult.storageMap)

const mergeOk = this.mergeEip7702Authorizations(entry, sharedAuthorizationList)
if (!mergeOk) {
debug('unable to add bundle as it relies on an EIP-7702 tuple that conflicts with other UserOperations')
continue
}
const mergeOk = this.mergeEip7702Authorizations(entry, sharedAuthorizationList)
if (!mergeOk) {
debug('unable to add bundle as it relies on an EIP-7702 tuple that conflicts with other UserOperations')
continue
}

bundleGas = bundleGas.add(entry.userOpMaxGas)
senders.add(entry.userOp.sender)
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/RIP7712NonceManagerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const entryPointSalt = '0x90d8084deab30c2a37c45e8d47f49f2f7965183cb6990a9

export async function deployNonceManager (provider: JsonRpcProvider, signer = provider.getSigner()): Promise<NonceManager> {
const addr = await new DeterministicDeployer(provider, signer).deterministicDeploy(nonceManagerByteCode, entryPointSalt)
console.log("Deployed NonceManager contract at: ", addr)
console.log('Deployed NonceManager contract at: ', addr)
return NonceManager__factory.connect(addr, signer)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function mergeStorageMap (mergedStorageMap: StorageMap, validationStorage
if (mergedStorageMap[addr] == null) {
slots = mergedStorageMap[addr] = {}
} else {
slots = mergedStorageMap[addr] as SlotMap
slots = mergedStorageMap[addr]
}

Object.entries(validationEntry).forEach(([slot, val]) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/src/interfaces/EIP7702Authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import RLP from 'rlp'
import { bytesToHex, ecrecover, hexToBigInt, hexToBytes, PrefixedHexString, pubToAddress } from '@ethereumjs/util'
import { AddressZero } from '../ERC4337Utils'
import { keccak256 } from '@ethersproject/keccak256'
import { hexlify } from 'ethers/lib/utils'

export interface EIP7702Authorization {
chainId: BigNumberish
Expand Down Expand Up @@ -31,12 +30,13 @@ export function getEip7702AuthorizationSigner (authorization: EIP7702Authorizati
)
]
const messageHash = keccak256(rlpEncode) as `0x${string}`
// console.log('getEip7702AuthorizationSigner RLP:\n', hexlify(rlpEncode), rlpEncode.length)
// console.log('getEip7702AuthorizationSigner hash:\n', messageHash)
const senderPubKey = ecrecover(
hexToBytes(messageHash),
// eslint-disable-next-line @typescript-eslint/no-base-to-string
hexToBigInt(authorization.yParity.toString() as `0x${string}`),
// eslint-disable-next-line @typescript-eslint/no-base-to-string
hexToBytes(authorization.r.toString() as `0x${string}`),
// eslint-disable-next-line @typescript-eslint/no-base-to-string
hexToBytes(authorization.s.toString() as `0x${string}`)
)
const sender = bytesToHex(pubToAddress(senderPubKey))
Expand Down

0 comments on commit 623cfea

Please sign in to comment.