Skip to content

How to use zksync-ethers with typechain? #893

@nooma-42

Description

@nooma-42

typechain generate __factory files and export in index.ts, and factory extend ContractFactory in ethers, like this:

export class TimelockController__factory extends ContractFactory {

however, I should use ContractFactory from zksync-ethers in the second argument of handleDeploy. Clearly mismatch the type. like below:

return this.multiProvider.handleDeploy(
      chain,
      new TimelockController__factory(),
      // delay, [proposers], [executors], admin
      [
        timelockConfig.delay,
        [timelockConfig.roles.proposer],
        [timelockConfig.roles.executor],
        ethers.constants.AddressZero,
      ],
    );

Should I use a wrapper to make the typechain generated factory compatible with zksync-ethers or there're other standardized way to handle such cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions