1
1
import { NewTransaction } from '@rainbow-me/rainbowkit/dist/transactions/transactionStore' ;
2
- import { BigNumber , Contract , ethers , Signer } from 'ethers' ;
2
+ import { BigNumber , Contract , ContractTransaction , ethers , Signer } from 'ethers' ;
3
3
import { RMRKMultiResourceFactoryContractAddress } from '../../constants' ;
4
4
5
5
interface IProps {
6
6
signer ?: ethers . Signer | null ;
7
7
registryContract : Contract ;
8
8
tokenContract : Contract ;
9
- factoryContract : Contract ;
9
+ callFactory : ( ) => Promise < ContractTransaction > ;
10
10
addRecentTransaction : ( transaction : NewTransaction ) => void ;
11
- data : { [ key : string ] : string | number } ;
12
11
}
13
12
14
13
export async function deployContract ( {
15
14
signer,
16
15
registryContract,
17
16
tokenContract,
18
- factoryContract ,
17
+ callFactory ,
19
18
addRecentTransaction,
20
- data,
21
19
} : IProps ) {
22
- const { nameInput, symbolInput, maxSupplyInput, priceInput, collectionMetadataInput } = data ;
23
20
if ( signer instanceof Signer ) {
24
21
const caller = await signer . getAddress ( ) ;
25
22
const deposit : BigNumber = await registryContract . getCollectionListingFee ( ) ;
@@ -34,15 +31,8 @@ export async function deployContract({
34
31
) ;
35
32
await approveTransactionResponse . wait ( ) ;
36
33
}
37
- const tx = await factoryContract
38
- . connect ( signer )
39
- . deployRMRKMultiResource (
40
- nameInput ,
41
- symbolInput ,
42
- maxSupplyInput ,
43
- priceInput ,
44
- collectionMetadataInput ,
45
- ) ;
34
+
35
+ const tx = await callFactory ( ) ;
46
36
47
37
addRecentTransaction ( {
48
38
hash : tx . hash ,
0 commit comments