Skip to content

Conversation

@jose-blockchain
Copy link

@jose-blockchain jose-blockchain commented Jan 20, 2026

Description

Fixes type mismatch error when passing arrays (e.g., readonly [100, 500, 3000, 10000]) as constructor parameters to deployContract.

The previous type Array<BigNumberish> was too restrictive and didn't match ContractFactory.deploy(...args: ContractMethodArgs<A>) when arrays were included in constructor parameters.

Changes

  • Updated deployContract function to use generics with Abi type parameter (Solution B)
  • Changed parameters type from Array<BigNumberish> to readonly any[] to allow arrays and complex types
  • Added helper types DeployContractParameters and DeployContractReturn for better type safety
  • Function now accepts arrays like readonly [100, 500, 3000, 10000] as constructor parameters

Testing

  • Existing tests continue to pass (backward compatible)
  • Function signature properly typed with generics
  • No linter errors

Related Issues

Fixes #208
Potenrial reviewers: @mayar-deeb-xi @k06a @ZumZoom

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Fixes type mismatch when passing arrays (e.g., readonly number[]) to deployContract constructor parameters.
Implemented Solution B using generics with Abi type parameter to align with ContractFactory.deploy types.

The function now accepts arrays and complex types in constructor parameters, resolving the issue where Array<BigNumberish> didn't match ContractFactory.deploy(...args: ContractMethodArgs<A>).

Related Issues: 1inch#208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

type error: deployContract from utils.ts

1 participant