Skip to content

Commit

Permalink
fix packUserOp (in gas test mode)
Browse files Browse the repository at this point in the history
incorrectly included gas twice.
  • Loading branch information
drortirosh committed Dec 8, 2022
1 parent 0d290ce commit 286eddb
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions packages/utils/src/ERC4337Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { abi as entryPointAbi } from '@account-abstraction/contracts/artifacts/I
import { ethers } from 'ethers'

export const AddressZero = ethers.constants.AddressZero

// UserOperation is the first parameter of simulateValidation
const UserOpType = entryPointAbi.find(entry => entry.name === 'simulateValidation')?.inputs[0]

Expand Down Expand Up @@ -92,57 +91,6 @@ export function packUserOp (op: NotPromise<UserOperationStruct>, forSignature =
type: c.type,
val: op[c.name]
}))
// const typevalues = [
// {
// type: 'address',
// val: op.sender
// },
// {
// type: 'uint256',
// val: op.nonce
// },
// {
// type: 'bytes',
// val: op.initCode
// },
// {
// type: 'bytes',
// val: op.callData
// },
// {
// type: 'uint256',
// val: op.callGasLimit
// },
// {
// type: 'uint256',
// val: op.verificationGasLimit
// },
// {
// type: 'uint256',
// val: op.preVerificationGas
// },
// {
// type: 'uint256',
// val: op.maxFeePerGas
// },
// {
// type: 'uint256',
// val: op.maxPriorityFeePerGas
// },
// {
// type: 'bytes',
// val: op.paymasterAndData
// }
// ]
// console.log('hard-coded typedvalues', typevalues)
// console.log('from ABI typedValues', typedValues)
if (!forSignature) {
// for the purpose of calculating gas cost, also hash signature
typevalues.push({
type: 'bytes',
val: op.signature
})
}
return encode(typevalues, forSignature)
}

Expand Down

0 comments on commit 286eddb

Please sign in to comment.