Skip to content

Commit

Permalink
feat: revert Abstract EIP712 domain changes (#2724)
Browse files Browse the repository at this point in the history
* Revert Abstract EIP712 domain changes

* Update

* Create cyan-owls-compete.md

---------

Co-authored-by: jxom <[email protected]>
  • Loading branch information
cygaar and jxom committed Sep 15, 2024
1 parent 7c8b203 commit c2b2c78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-owls-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Reverted custom Abstract EIP712 domain changes.
34 changes: 0 additions & 34 deletions src/chains/definitions/abstractTestnet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { defineChain } from '../../utils/chain/defineChain.js'
import { chainConfig } from '../../zksync/chainConfig.js'
import type { ZksyncTransactionSerializableEIP712 } from '../../zksync/types/transaction.js'
import { transactionToMessage } from '../../zksync/utils/getEip712Domain.js'

export const abstractTestnet = /*#__PURE__*/ defineChain({
...chainConfig,
Expand All @@ -28,36 +26,4 @@ export const abstractTestnet = /*#__PURE__*/ defineChain({
blockCreated: 358349,
},
},
custom: {
getEip712Domain(transaction: ZksyncTransactionSerializableEIP712) {
const message = transactionToMessage(transaction)

return {
domain: {
name: 'Abstract', // Use 'Abstract' rather than 'zkSync'
version: '2',
chainId: transaction.chainId,
},
types: {
Transaction: [
{ name: 'txType', type: 'uint256' },
{ name: 'from', type: 'uint256' },
{ name: 'to', type: 'uint256' },
{ name: 'gasLimit', type: 'uint256' },
{ name: 'gasPerPubdataByteLimit', type: 'uint256' },
{ name: 'maxFeePerGas', type: 'uint256' },
{ name: 'maxPriorityFeePerGas', type: 'uint256' },
{ name: 'paymaster', type: 'uint256' },
{ name: 'nonce', type: 'uint256' },
{ name: 'value', type: 'uint256' },
{ name: 'data', type: 'bytes' },
{ name: 'factoryDeps', type: 'bytes32[]' },
{ name: 'paymasterInput', type: 'bytes' },
],
},
primaryType: 'Transaction',
message: message,
}
},
},
})
2 changes: 1 addition & 1 deletion src/zksync/utils/getEip712Domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const getEip712Domain: EIP712DomainFn<
//////////////////////////////////////////////////////////////////////////////
// Utilities

export function transactionToMessage(
function transactionToMessage(
transaction: ZksyncTransactionSerializableEIP712,
): ZksyncEIP712TransactionSignable {
const {
Expand Down

0 comments on commit c2b2c78

Please sign in to comment.