Skip to content

Commit eabe215

Browse files
committed
chore: add array to constructor argument types
1 parent 37a59dd commit eabe215

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ yarn-error.log*
66
node_modules/
77

88
# Yarn
9-
.yarn/*
9+
.yarn/
1010
!.yarn/patches
1111
!.yarn/releases
1212
!.yarn/plugins
@@ -42,4 +42,4 @@ tx-*.log
4242
addresses-fork.json
4343

4444
# Keys
45-
.keystore
45+
.keystore

packages/sdk/src/deployments/lib/deploy/contract.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ export const deployContractAndSave: DeployAddressBookFunction = async (
103103
args: args,
104104
})
105105

106+
const constructorArgs = args.map((e) => {
107+
if (Array.isArray(e)) {
108+
return e.map((e) => e.toString())
109+
} else {
110+
return e.toString()
111+
}
112+
})
113+
106114
// Save address entry
107115
addressBook.setEntry(name, {
108116
address: deployResult.contract.address,
109-
constructorArgs: args.length === 0 ? undefined : args.map((e) => e.toString()),
117+
constructorArgs: constructorArgs,
110118
creationCodeHash: deployResult.creationCodeHash,
111119
runtimeCodeHash: deployResult.runtimeCodeHash,
112120
txHash: deployResult.txHash,

packages/sdk/src/deployments/lib/types/address-book.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ export type AddressBookJson<
1414
ContractName extends string = string,
1515
> = Record<ChainId, Record<ContractName, AddressBookEntry>>
1616

17+
export type ConstructorArg = string | Array<string>
18+
1719
export type AddressBookEntry = {
1820
address: string
19-
constructorArgs?: Array<string>
21+
constructorArgs?: Array<ConstructorArg>
2022
initArgs?: Array<string>
2123
proxy?: boolean
2224
implementation?: AddressBookEntry

0 commit comments

Comments
 (0)