@@ -4,14 +4,18 @@ import type {
4
4
AbiParametersToPrimitiveTypes ,
5
5
Address ,
6
6
} from "abitype" ;
7
- import { toFunctionSelector , toFunctionSignature , zeroAddress } from "viem" ;
7
+ import { toFunctionSelector , toFunctionSignature } from "viem" ;
8
8
import type { ThirdwebClient } from "../../client/client.js" ;
9
9
import { resolveContractAbi } from "../../contract/actions/resolve-abi.js" ;
10
10
import type { ThirdwebContract } from "../../contract/contract.js" ;
11
11
import { deployViaAutoFactory } from "../../contract/deployment/deploy-via-autofactory.js" ;
12
- import { getOrDeployInfraForPublishedContract } from "../../contract/deployment/utils/bootstrap.js" ;
12
+ import {
13
+ getOrDeployInfraContract ,
14
+ getOrDeployInfraForPublishedContract ,
15
+ } from "../../contract/deployment/utils/bootstrap.js" ;
13
16
import { upload } from "../../storage/upload.js" ;
14
17
import type { FileOrBufferOrString } from "../../storage/upload/types.js" ;
18
+ import { getRoyaltyEngineV1ByChainId } from "../../utils/royalty-engine.js" ;
15
19
import type { Prettify } from "../../utils/type-utils.js" ;
16
20
import type { ClientAndChainAndAccount } from "../../utils/types.js" ;
17
21
import { initialize as initMarketplace } from "./__generated__/Marketplace/write/initialize.js" ;
@@ -42,26 +46,27 @@ export async function deployMarketplaceContract(
42
46
options : DeployMarketplaceContractOptions ,
43
47
) {
44
48
const { chain, client, account, params } = options ;
49
+ const WETH = await getOrDeployInfraContract ( {
50
+ chain,
51
+ client,
52
+ account,
53
+ contractId : "WETH9" ,
54
+ constructorParams : [ ] ,
55
+ } ) ;
45
56
const direct = await getOrDeployInfraForPublishedContract ( {
46
57
chain,
47
58
client,
48
59
account,
49
60
contractId : "DirectListingsLogic" ,
50
- constructorParams : [
51
- // TODO - actually determine ... "weth"?
52
- zeroAddress , // _weth
53
- ] ,
61
+ constructorParams : [ WETH . address ] ,
54
62
} ) ;
55
63
56
64
const english = await getOrDeployInfraForPublishedContract ( {
57
65
chain,
58
66
client,
59
67
account,
60
68
contractId : "EnglishAuctionsLogic" ,
61
- constructorParams : [
62
- // TODO - actually determine ... "weth"?
63
- zeroAddress , // _weth
64
- ] ,
69
+ constructorParams : [ WETH . address ] ,
65
70
} ) ;
66
71
67
72
const offers = await getOrDeployInfraForPublishedContract ( {
@@ -119,10 +124,8 @@ export async function deployMarketplaceContract(
119
124
functions : offersFunctions ,
120
125
} ,
121
126
] ,
122
- // TODO - actually determine ... "royaltyEngineAddress"?
123
- royaltyEngineAddress : zeroAddress ,
124
- // TODO - actually determine ... "weth"?
125
- nativeTokenWrapper : zeroAddress ,
127
+ royaltyEngineAddress : getRoyaltyEngineV1ByChainId ( chain . id ) ,
128
+ nativeTokenWrapper : WETH . address ,
126
129
} ,
127
130
] as MarketplaceConstructorParams ,
128
131
} ) ;
0 commit comments