@@ -5,13 +5,16 @@ import {
5
5
DropERC20 ,
6
6
DropERC721 ,
7
7
Marketplace ,
8
+ Multiwrap ,
9
+ SignatureDrop ,
8
10
Split ,
9
11
TokenERC1155 ,
10
12
TokenERC20 ,
11
13
TokenERC721 ,
12
14
TWFee ,
13
15
VoteERC20 ,
14
16
} from "typechain" ;
17
+ import { nativeTokenWrapper } from "../../utils/nativeTokenWrapper" ;
15
18
16
19
async function verify ( address : string , args : any [ ] ) {
17
20
try {
@@ -25,45 +28,26 @@ async function verify(address: string, args: any[]) {
25
28
}
26
29
27
30
async function main ( ) {
28
- // Constructor args
29
-
30
- const nativeTokenWrapper : Record < number , string > = {
31
- 1 : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
32
- 4 : "0xc778417E063141139Fce010982780140Aa0cD5Ab" , // rinkeby
33
- 5 : "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6" , // goerli
34
- 137 : "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270" ,
35
- 80001 : "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889" ,
36
- 43114 : "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7" ,
37
- 43113 : "0xd00ae08403B9bbb9124bB305C09058E32C39A48c" ,
38
- 250 : "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83" ,
39
- 4002 : "0xf1277d1Ed8AD466beddF92ef448A132661956621" ,
40
- 10 : "0x4200000000000000000000000000000000000006" , // optimism
41
- 69 : "0xbC6F6b680bc61e30dB47721c6D1c5cde19C1300d" , // optimism testnet
42
- 42161 : "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" , // arbitrum
43
- 421611 : "0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9" , // arbitrum testnet
44
- } ;
45
-
46
31
// Deploy FeeType
47
32
const options = {
48
33
//maxFeePerGas: ethers.utils.parseUnits("50", "gwei"),
49
34
//maxPriorityFeePerGas: ethers.utils.parseUnits("50", "gwei"),
50
35
//gasPrice: ethers.utils.parseUnits("100", "gwei"),
51
- gasLimit : 6_500_000 ,
36
+ gasLimit : 5_000_000 ,
52
37
} ;
53
38
54
39
const trustedForwarder = await ( await ethers . getContractFactory ( "Forwarder" ) ) . deploy ( options ) ;
55
- //const trustedForwarder = await ethers.getContractAt("Forwarder", "0x8cbc8b5d71702032904750a66aefe8b603ebc538 ");
40
+ // const trustedForwarder = await ethers.getContractAt("Forwarder", "0x8cbc8B5d71702032904750A66AEfE8B603eBC538 ");
56
41
console . log ( "Deploying Trusted Forwarder at tx: " , trustedForwarder . deployTransaction ?. hash ) ;
57
42
await trustedForwarder . deployed ( ) ;
58
43
console . log ( "Trusted Forwarder address: " , trustedForwarder . address ) ;
59
-
60
44
const trustedForwarderAddress : string = trustedForwarder . address ;
61
45
62
- // Deploy TWRegistry
46
+ // // Deploy TWRegistry
63
47
const thirdwebRegistry = await (
64
48
await ethers . getContractFactory ( "TWRegistry" )
65
49
) . deploy ( trustedForwarderAddress , options ) ;
66
- //const thirdwebRegistry = await ethers.getContractAt("TWRegistry", "0x7c487845f98938Bb955B1D5AD069d9a30e4131fd");
50
+ // const thirdwebRegistry = await ethers.getContractAt("TWRegistry", "0x7c487845f98938Bb955B1D5AD069d9a30e4131fd");
67
51
console . log ( "Deploying TWRegistry at tx: " , thirdwebRegistry . deployTransaction ?. hash ) ;
68
52
await thirdwebRegistry . deployed ( ) ;
69
53
console . log ( "TWRegistry address: " , thirdwebRegistry . address ) ;
@@ -72,7 +56,7 @@ async function main() {
72
56
const thirdwebFactory = await (
73
57
await ethers . getContractFactory ( "TWFactory" )
74
58
) . deploy ( trustedForwarderAddress , thirdwebRegistry . address , options ) ;
75
- //const thirdwebFactory = await ethers.getContractAt("TWFactory", "0xd24b3de085CFd8c54b94feAD08a7962D343E6DE0");
59
+ // const thirdwebFactory = await ethers.getContractAt("TWFactory", "0xd24b3de085CFd8c54b94feAD08a7962D343E6DE0");
76
60
console . log ( "Deploying TWFactory at tx: " , thirdwebFactory . deployTransaction ?. hash ) ;
77
61
await thirdwebFactory . deployed ( ) ;
78
62
console . log ( "TWFactory address: " , thirdwebFactory . address ) ;
@@ -81,35 +65,37 @@ async function main() {
81
65
const thirdwebFee : TWFee = await ethers
82
66
. getContractFactory ( "TWFee" )
83
67
. then ( f => f . deploy ( trustedForwarderAddress , thirdwebFactory . address , options ) ) ;
84
- //const thirdwebFee = await ethers.getContractAt("TWFee", "0x8C4B615040Ebd2618e8fC3B20ceFe9abAfdEb0ea");
68
+ // const thirdwebFee = await ethers.getContractAt("TWFee", "0x8C4B615040Ebd2618e8fC3B20ceFe9abAfdEb0ea");
85
69
console . log ( "Deploying TWFee at tx: " , thirdwebFee . deployTransaction ?. hash ) ;
86
70
await thirdwebFee . deployed ( ) ;
87
71
console . log ( "TWFee address: " , thirdwebFee . address ) ;
88
72
89
73
// Deploy a test implementation: Drop721
90
74
const drop721 : DropERC721 = await ethers
91
75
. getContractFactory ( "DropERC721" )
92
- . then ( f => f . deploy ( thirdwebFee . address , options ) )
76
+ . then ( f => f . deploy ( options ) )
93
77
. then ( f => f . deployed ( ) ) ;
94
- //const drop721 = await ethers.getContractAt("DropERC721", "0xcF4c511551aE4dab1F997866FC3900cd2aaeC40D");
78
+ // const drop721 = await ethers.getContractAt("DropERC721", "0xcF4c511551aE4dab1F997866FC3900cd2aaeC40D");
95
79
console . log ( "Deploying DropERC721 at tx: " , drop721 . deployTransaction ?. hash ) ;
96
80
console . log ( "DropERC721 address: " , drop721 . address ) ;
97
81
98
82
// Deploy a test implementation: Drop1155
99
83
const drop1155 : DropERC1155 = await ethers
100
84
. getContractFactory ( "DropERC1155" )
101
- . then ( f => f . deploy ( thirdwebFee . address , options ) )
85
+ . then ( f => f . deploy ( options ) )
102
86
. then ( f => f . deployed ( ) ) ;
103
87
console . log ( "Deploying Drop1155 at tx: " , drop1155 . deployTransaction . hash ) ;
104
88
console . log ( "Drop1155 address: " , drop1155 . address ) ;
89
+ // const drop1155 = await ethers.getContractAt("DropERC1155", "0xb0435b47ad26115A39c59735b814f3769F07C2c1");
105
90
106
91
// Deploy a test implementation: DropERC20
107
92
const drop20 : DropERC20 = await ethers
108
93
. getContractFactory ( "DropERC20" )
109
- . then ( f => f . deploy ( thirdwebFee . address , options ) )
94
+ . then ( f => f . deploy ( options ) )
110
95
. then ( f => f . deployed ( ) ) ;
111
96
console . log ( "Deploying DropERC20 at tx: " , drop20 . deployTransaction . hash ) ;
112
97
console . log ( "DropERC20 address: " , drop20 . address ) ;
98
+ // const drop20 = await ethers.getContractAt("DropERC20", "0x5bB3DCac11fa075D4f362Bb2D0De93fA821f1dA9");
113
99
114
100
// Deploy a test implementation: TokenERC20
115
101
const tokenERC20 : TokenERC20 = await ethers
@@ -118,8 +104,7 @@ async function main() {
118
104
. then ( f => f . deployed ( ) ) ;
119
105
console . log ( "Deploying TokenERC20 at tx: " , tokenERC20 . deployTransaction . hash ) ;
120
106
console . log ( "TokenERC20 address: " , tokenERC20 . address ) ;
121
-
122
- // Set the deployed `TokenERC20` as an approved module in TWFactory
107
+ // const tokenERC20 = await ethers.getContractAt("TokenERC20", "0x0E1d366475709eF677275E4161a20456cAc2071f");
123
108
124
109
// Deploy a test implementation: TokenERC721
125
110
const tokenERC721 : TokenERC721 = await ethers
@@ -128,36 +113,60 @@ async function main() {
128
113
. then ( f => f . deployed ( ) ) ;
129
114
console . log ( "Deploying TokenERC721 at tx: " , tokenERC721 . deployTransaction . hash ) ;
130
115
console . log ( "TokenERC721 address: " , tokenERC721 . address ) ;
116
+ // const tokenERC721 = await ethers.getContractAt("TokenERC721", "0x7185fBf58db5F3Df186197406CEc2E253A1f5fE6");
131
117
132
- // Set the deployed `TokenERC721` as an approved module in TWFactory
133
118
// Deploy a test implementation: TokenERC1155
134
119
const tokenERC1155 : TokenERC1155 = await ethers
135
120
. getContractFactory ( "TokenERC1155" )
136
121
. then ( f => f . deploy ( thirdwebFee . address , options ) )
137
122
. then ( f => f . deployed ( ) ) ;
138
123
console . log ( "Deploying TokenERC1155 at tx: " , tokenERC1155 . deployTransaction . hash ) ;
139
124
console . log ( "TokenERC1155 address: " , tokenERC1155 . address ) ;
125
+ // const tokenERC1155 = await ethers.getContractAt("TokenERC1155", "0xe9D53b11d6531b0E56990755a7856889FC59848d");
140
126
141
127
const split : Split = await ethers
142
128
. getContractFactory ( "Split" )
143
129
. then ( f => f . deploy ( thirdwebFee . address , options ) )
144
130
. then ( f => f . deployed ( ) ) ;
145
131
console . log ( "Deploying Split at tx: " , split . deployTransaction . hash ) ;
146
132
console . log ( "Split address: " , split . address ) ;
133
+ // const split = await ethers.getContractAt("Split", "0x83cCFAaA705Bf3B734B50121d47b82D58aE91796");
147
134
148
135
const marketplace : Marketplace = await ethers
149
136
. getContractFactory ( "Marketplace" )
150
137
. then ( f => f . deploy ( nativeTokenWrapper [ ethers . provider . network . chainId ] , thirdwebFee . address , options ) )
151
138
. then ( f => f . deployed ( ) ) ;
152
139
console . log ( "Deploying Marketplace at tx: " , marketplace . deployTransaction . hash ) ;
153
140
console . log ( "Marketplace address: " , marketplace . address ) ;
141
+ // const marketplace = await ethers.getContractAt("Marketplace", "0x7181acA2A01Bc98596b1d5375C97389F0d136B2b");
154
142
155
143
const vote : VoteERC20 = await ethers
156
144
. getContractFactory ( "VoteERC20" )
157
145
. then ( f => f . deploy ( options ) )
158
146
. then ( f => f . deployed ( ) ) ;
159
147
console . log ( "Deploying vote at tx: " , vote . deployTransaction . hash ) ;
160
148
console . log ( "Vote address: " , vote . address ) ;
149
+ // const vote = await ethers.getContractAt("VoteERC20", "0x8F18067D118B1DD1D7a503B0b6Ed255341068029");
150
+
151
+ // Multiwrap
152
+ const multiwrap : Multiwrap = await ethers
153
+ . getContractFactory ( "Multiwrap" )
154
+ . then ( f => f . deploy ( nativeTokenWrapper [ ethers . provider . network . chainId ] , options ) )
155
+ . then ( f => f . deployed ( ) ) ;
156
+ console . log ( "Deploying Multiwrap at tx: " , multiwrap . deployTransaction . hash ) ;
157
+ console . log ( "Multiwrap address: " , multiwrap . address ) ;
158
+ // const multiwrap = await ethers.getContractAt("Multiwrap", "0x10C06F8B3695813276b4A921C06bb3b122aAf9d2");
159
+
160
+ // Signature Drop
161
+ const sigdrop : SignatureDrop = await ethers
162
+ . getContractFactory ( "SignatureDrop" )
163
+ . then ( f => f . deploy ( options ) )
164
+ . then ( f => f . deployed ( ) ) ;
165
+ console . log ( "Deploying SignatureDrop at tx: " , sigdrop . deployTransaction . hash ) ;
166
+ console . log ( "SignatureDrop address: " , sigdrop . address ) ;
167
+ // const sigdrop = await ethers.getContractAt("SignatureDrop", "0xAC4190bFF783B19812137c38E7d3c724b655f1d5");
168
+
169
+ // TODO Pack
161
170
162
171
const tx = await thirdwebFactory . multicall (
163
172
[
@@ -170,6 +179,8 @@ async function main() {
170
179
thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ split . address ] ) ,
171
180
thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ marketplace . address ] ) ,
172
181
thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ vote . address ] ) ,
182
+ thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ multiwrap . address ] ) ,
183
+ thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ sigdrop . address ] ) ,
173
184
] ,
174
185
options ,
175
186
) ;
@@ -185,15 +196,17 @@ async function main() {
185
196
await verify ( thirdwebRegistry . address , [ trustedForwarderAddress ] ) ;
186
197
await verify ( thirdwebFactory . address , [ trustedForwarderAddress , thirdwebRegistry . address ] ) ;
187
198
await verify ( thirdwebFee . address , [ trustedForwarderAddress , thirdwebFactory . address ] ) ;
188
- await verify ( drop721 . address , [ thirdwebFee . address ] ) ;
189
- await verify ( drop1155 . address , [ thirdwebFee . address ] ) ;
190
- await verify ( drop20 . address , [ thirdwebFee . address ] ) ;
199
+ await verify ( drop721 . address , [ ] ) ;
200
+ await verify ( drop1155 . address , [ ] ) ;
201
+ await verify ( drop20 . address , [ ] ) ;
191
202
await verify ( tokenERC20 . address , [ thirdwebFee . address ] ) ;
192
203
await verify ( tokenERC721 . address , [ thirdwebFee . address ] ) ;
193
204
await verify ( tokenERC1155 . address , [ thirdwebFee . address ] ) ;
194
205
await verify ( split . address , [ thirdwebFee . address ] ) ;
195
- await verify ( vote . address , [ ] ) ;
196
206
await verify ( marketplace . address , [ nativeTokenWrapper [ ethers . provider . network . chainId ] , thirdwebFee . address ] ) ;
207
+ await verify ( vote . address , [ ] ) ;
208
+ await verify ( multiwrap . address , [ nativeTokenWrapper [ ethers . provider . network . chainId ] ] ) ;
209
+ await verify ( sigdrop . address , [ ] ) ;
197
210
}
198
211
199
212
main ( )
0 commit comments