Skip to content

Commit

Permalink
Fixing tx type
Browse files Browse the repository at this point in the history
  • Loading branch information
shahafn committed Jan 6, 2025
1 parent aebfc64 commit 1056cab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/utils/src/RIP7560Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { hexlify, keccak256 } from 'ethers/lib/utils'
import { OperationRIP7560 } from './interfaces/OperationRIP7560'
import { AddressZero } from './ERC4337Utils'

export const RIP7560_TRANSACTION_TYPE = 5

export function getRIP7560TransactionHash (op: OperationRIP7560, forSignature = true): string {
if (!forSignature) {
throw new Error('not implemented')
Expand Down Expand Up @@ -43,7 +45,7 @@ function rlpEncodeRip7560Tx (op: OperationRIP7560, forSignature = true): string
input.push(bigNumberishToUnpaddedBuffer(op.paymasterPostOpGasLimit ?? 0))
input.push(bigNumberishToUnpaddedBuffer(op.nonceKey))
let rlpEncoded: any = encode(input)
rlpEncoded = Buffer.from([4, ...rlpEncoded])
rlpEncoded = Buffer.from([RIP7560_TRANSACTION_TYPE, ...rlpEncoded])
return hexlify(rlpEncoded)
}

Expand Down

0 comments on commit 1056cab

Please sign in to comment.