Skip to content

Commit

Permalink
fix: zksync-web can't parse non eip712 transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
aurel-fr committed Dec 1, 2023
1 parent c51a816 commit d15dd91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layerzerolabs/hardhat-deploy",
"version": "0.11.43-lz.3",
"version": "0.11.43-lz.4",
"description": "Hardhat Plugin For Replicable Deployments And Tests",
"repository": {
"type": "git",
Expand Down
8 changes: 7 additions & 1 deletion src/DeploymentFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as zk from 'zksync-web3';
import {Address, ExtendedArtifact} from '../types';
import {getAddress} from '@ethersproject/address';
import {keccak256 as solidityKeccak256} from '@ethersproject/solidity';
import {hexConcat} from '@ethersproject/bytes';
import {arrayify, hexConcat} from '@ethersproject/bytes';
import {TronContractFactory} from './tron/contract';
import {TronSigner} from './tron/signer';
import {CreateSmartContract} from './tron/types';
Expand Down Expand Up @@ -161,6 +161,12 @@ export class DeploymentFactory {
const newTransaction = await this.getDeployTransaction();
const newData = newTransaction.data?.toString();
if (this.isZkSync) {
const EIP712_TX_TYPE = 0x71;
const bytes = arrayify(transaction.data);
// zk.utils.parseTransaction cannot parse tx others than eip712
if (bytes[0] != EIP712_TX_TYPE) {
return transaction.data !== newData;
}
const deserialize = zk.utils.parseTransaction(transaction.data) as any;
const desFlattened = hexConcat(deserialize.customData.factoryDeps);
const factoryDeps = await this.extractFactoryDeps(this.artifact);
Expand Down

0 comments on commit d15dd91

Please sign in to comment.