@@ -5,13 +5,16 @@ import {
55 DropERC20 ,
66 DropERC721 ,
77 Marketplace ,
8+ Multiwrap ,
9+ SignatureDrop ,
810 Split ,
911 TokenERC1155 ,
1012 TokenERC20 ,
1113 TokenERC721 ,
1214 TWFee ,
1315 VoteERC20 ,
1416} from "typechain" ;
17+ import { nativeTokenWrapper } from "../../utils/nativeTokenWrapper" ;
1518
1619async function verify ( address : string , args : any [ ] ) {
1720 try {
@@ -25,45 +28,26 @@ async function verify(address: string, args: any[]) {
2528}
2629
2730async 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-
4631 // Deploy FeeType
4732 const options = {
4833 //maxFeePerGas: ethers.utils.parseUnits("50", "gwei"),
4934 //maxPriorityFeePerGas: ethers.utils.parseUnits("50", "gwei"),
5035 //gasPrice: ethers.utils.parseUnits("100", "gwei"),
51- gasLimit : 6_500_000 ,
36+ gasLimit : 5_000_000 ,
5237 } ;
5338
5439 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 ");
5641 console . log ( "Deploying Trusted Forwarder at tx: " , trustedForwarder . deployTransaction ?. hash ) ;
5742 await trustedForwarder . deployed ( ) ;
5843 console . log ( "Trusted Forwarder address: " , trustedForwarder . address ) ;
59-
6044 const trustedForwarderAddress : string = trustedForwarder . address ;
6145
62- // Deploy TWRegistry
46+ // // Deploy TWRegistry
6347 const thirdwebRegistry = await (
6448 await ethers . getContractFactory ( "TWRegistry" )
6549 ) . deploy ( trustedForwarderAddress , options ) ;
66- //const thirdwebRegistry = await ethers.getContractAt("TWRegistry", "0x7c487845f98938Bb955B1D5AD069d9a30e4131fd");
50+ // const thirdwebRegistry = await ethers.getContractAt("TWRegistry", "0x7c487845f98938Bb955B1D5AD069d9a30e4131fd");
6751 console . log ( "Deploying TWRegistry at tx: " , thirdwebRegistry . deployTransaction ?. hash ) ;
6852 await thirdwebRegistry . deployed ( ) ;
6953 console . log ( "TWRegistry address: " , thirdwebRegistry . address ) ;
@@ -72,7 +56,7 @@ async function main() {
7256 const thirdwebFactory = await (
7357 await ethers . getContractFactory ( "TWFactory" )
7458 ) . deploy ( trustedForwarderAddress , thirdwebRegistry . address , options ) ;
75- //const thirdwebFactory = await ethers.getContractAt("TWFactory", "0xd24b3de085CFd8c54b94feAD08a7962D343E6DE0");
59+ // const thirdwebFactory = await ethers.getContractAt("TWFactory", "0xd24b3de085CFd8c54b94feAD08a7962D343E6DE0");
7660 console . log ( "Deploying TWFactory at tx: " , thirdwebFactory . deployTransaction ?. hash ) ;
7761 await thirdwebFactory . deployed ( ) ;
7862 console . log ( "TWFactory address: " , thirdwebFactory . address ) ;
@@ -81,35 +65,37 @@ async function main() {
8165 const thirdwebFee : TWFee = await ethers
8266 . getContractFactory ( "TWFee" )
8367 . then ( f => f . deploy ( trustedForwarderAddress , thirdwebFactory . address , options ) ) ;
84- //const thirdwebFee = await ethers.getContractAt("TWFee", "0x8C4B615040Ebd2618e8fC3B20ceFe9abAfdEb0ea");
68+ // const thirdwebFee = await ethers.getContractAt("TWFee", "0x8C4B615040Ebd2618e8fC3B20ceFe9abAfdEb0ea");
8569 console . log ( "Deploying TWFee at tx: " , thirdwebFee . deployTransaction ?. hash ) ;
8670 await thirdwebFee . deployed ( ) ;
8771 console . log ( "TWFee address: " , thirdwebFee . address ) ;
8872
8973 // Deploy a test implementation: Drop721
9074 const drop721 : DropERC721 = await ethers
9175 . getContractFactory ( "DropERC721" )
92- . then ( f => f . deploy ( thirdwebFee . address , options ) )
76+ . then ( f => f . deploy ( options ) )
9377 . then ( f => f . deployed ( ) ) ;
94- //const drop721 = await ethers.getContractAt("DropERC721", "0xcF4c511551aE4dab1F997866FC3900cd2aaeC40D");
78+ // const drop721 = await ethers.getContractAt("DropERC721", "0xcF4c511551aE4dab1F997866FC3900cd2aaeC40D");
9579 console . log ( "Deploying DropERC721 at tx: " , drop721 . deployTransaction ?. hash ) ;
9680 console . log ( "DropERC721 address: " , drop721 . address ) ;
9781
9882 // Deploy a test implementation: Drop1155
9983 const drop1155 : DropERC1155 = await ethers
10084 . getContractFactory ( "DropERC1155" )
101- . then ( f => f . deploy ( thirdwebFee . address , options ) )
85+ . then ( f => f . deploy ( options ) )
10286 . then ( f => f . deployed ( ) ) ;
10387 console . log ( "Deploying Drop1155 at tx: " , drop1155 . deployTransaction . hash ) ;
10488 console . log ( "Drop1155 address: " , drop1155 . address ) ;
89+ // const drop1155 = await ethers.getContractAt("DropERC1155", "0xb0435b47ad26115A39c59735b814f3769F07C2c1");
10590
10691 // Deploy a test implementation: DropERC20
10792 const drop20 : DropERC20 = await ethers
10893 . getContractFactory ( "DropERC20" )
109- . then ( f => f . deploy ( thirdwebFee . address , options ) )
94+ . then ( f => f . deploy ( options ) )
11095 . then ( f => f . deployed ( ) ) ;
11196 console . log ( "Deploying DropERC20 at tx: " , drop20 . deployTransaction . hash ) ;
11297 console . log ( "DropERC20 address: " , drop20 . address ) ;
98+ // const drop20 = await ethers.getContractAt("DropERC20", "0x5bB3DCac11fa075D4f362Bb2D0De93fA821f1dA9");
11399
114100 // Deploy a test implementation: TokenERC20
115101 const tokenERC20 : TokenERC20 = await ethers
@@ -118,8 +104,7 @@ async function main() {
118104 . then ( f => f . deployed ( ) ) ;
119105 console . log ( "Deploying TokenERC20 at tx: " , tokenERC20 . deployTransaction . hash ) ;
120106 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");
123108
124109 // Deploy a test implementation: TokenERC721
125110 const tokenERC721 : TokenERC721 = await ethers
@@ -128,36 +113,60 @@ async function main() {
128113 . then ( f => f . deployed ( ) ) ;
129114 console . log ( "Deploying TokenERC721 at tx: " , tokenERC721 . deployTransaction . hash ) ;
130115 console . log ( "TokenERC721 address: " , tokenERC721 . address ) ;
116+ // const tokenERC721 = await ethers.getContractAt("TokenERC721", "0x7185fBf58db5F3Df186197406CEc2E253A1f5fE6");
131117
132- // Set the deployed `TokenERC721` as an approved module in TWFactory
133118 // Deploy a test implementation: TokenERC1155
134119 const tokenERC1155 : TokenERC1155 = await ethers
135120 . getContractFactory ( "TokenERC1155" )
136121 . then ( f => f . deploy ( thirdwebFee . address , options ) )
137122 . then ( f => f . deployed ( ) ) ;
138123 console . log ( "Deploying TokenERC1155 at tx: " , tokenERC1155 . deployTransaction . hash ) ;
139124 console . log ( "TokenERC1155 address: " , tokenERC1155 . address ) ;
125+ // const tokenERC1155 = await ethers.getContractAt("TokenERC1155", "0xe9D53b11d6531b0E56990755a7856889FC59848d");
140126
141127 const split : Split = await ethers
142128 . getContractFactory ( "Split" )
143129 . then ( f => f . deploy ( thirdwebFee . address , options ) )
144130 . then ( f => f . deployed ( ) ) ;
145131 console . log ( "Deploying Split at tx: " , split . deployTransaction . hash ) ;
146132 console . log ( "Split address: " , split . address ) ;
133+ // const split = await ethers.getContractAt("Split", "0x83cCFAaA705Bf3B734B50121d47b82D58aE91796");
147134
148135 const marketplace : Marketplace = await ethers
149136 . getContractFactory ( "Marketplace" )
150137 . then ( f => f . deploy ( nativeTokenWrapper [ ethers . provider . network . chainId ] , thirdwebFee . address , options ) )
151138 . then ( f => f . deployed ( ) ) ;
152139 console . log ( "Deploying Marketplace at tx: " , marketplace . deployTransaction . hash ) ;
153140 console . log ( "Marketplace address: " , marketplace . address ) ;
141+ // const marketplace = await ethers.getContractAt("Marketplace", "0x7181acA2A01Bc98596b1d5375C97389F0d136B2b");
154142
155143 const vote : VoteERC20 = await ethers
156144 . getContractFactory ( "VoteERC20" )
157145 . then ( f => f . deploy ( options ) )
158146 . then ( f => f . deployed ( ) ) ;
159147 console . log ( "Deploying vote at tx: " , vote . deployTransaction . hash ) ;
160148 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
161170
162171 const tx = await thirdwebFactory . multicall (
163172 [
@@ -170,6 +179,8 @@ async function main() {
170179 thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ split . address ] ) ,
171180 thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ marketplace . address ] ) ,
172181 thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ vote . address ] ) ,
182+ thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ multiwrap . address ] ) ,
183+ thirdwebFactory . interface . encodeFunctionData ( "addImplementation" , [ sigdrop . address ] ) ,
173184 ] ,
174185 options ,
175186 ) ;
@@ -185,15 +196,17 @@ async function main() {
185196 await verify ( thirdwebRegistry . address , [ trustedForwarderAddress ] ) ;
186197 await verify ( thirdwebFactory . address , [ trustedForwarderAddress , thirdwebRegistry . address ] ) ;
187198 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 , [ ] ) ;
191202 await verify ( tokenERC20 . address , [ thirdwebFee . address ] ) ;
192203 await verify ( tokenERC721 . address , [ thirdwebFee . address ] ) ;
193204 await verify ( tokenERC1155 . address , [ thirdwebFee . address ] ) ;
194205 await verify ( split . address , [ thirdwebFee . address ] ) ;
195- await verify ( vote . address , [ ] ) ;
196206 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 , [ ] ) ;
197210}
198211
199212main ( )
0 commit comments