1
1
use cw_orch:: prelude:: * ;
2
2
use dao_cw_orch:: * ;
3
3
4
- // admin factory
5
- pub struct AdminFactorySuite < Chain > {
6
- pub factory : DaoExternalAdminFactory < Chain > ,
7
- }
8
- impl < Chain : CwEnv > AdminFactorySuite < Chain > {
9
- pub fn new ( chain : Chain ) -> AdminFactorySuite < Chain > {
10
- AdminFactorySuite :: < Chain > {
11
- factory : DaoExternalAdminFactory :: new ( "cw_admin_factory" , chain. clone ( ) ) ,
12
- }
13
- }
14
-
15
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
16
- self . factory . upload ( ) ?;
17
-
18
- Ok ( ( ) )
19
- }
20
- }
21
-
22
- // bitsong fantoken factory
23
- pub struct FantokenFactorySuite < Chain > {
24
- pub factory : DaoExternalFantokenFactory < Chain > ,
25
- }
26
-
27
- impl < Chain : CwEnv > FantokenFactorySuite < Chain > {
28
- pub fn new ( chain : Chain ) -> FantokenFactorySuite < Chain > {
29
- FantokenFactorySuite :: < Chain > {
30
- factory : DaoExternalFantokenFactory :: new ( "btsg_ft_factory" , chain. clone ( ) ) ,
31
- }
32
- }
33
-
34
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
35
- self . factory . upload ( ) ?;
36
-
37
- Ok ( ( ) )
38
- }
39
- }
40
-
41
- // payroll factory
42
- pub struct PayrollSuite < Chain > {
43
- pub payroll : DaoExternalPayrollFactory < Chain > ,
44
- pub vesting : DaoExternalCwVesting < Chain > ,
45
- }
46
- impl < Chain : CwEnv > PayrollSuite < Chain > {
47
- pub fn new ( chain : Chain ) -> PayrollSuite < Chain > {
48
- PayrollSuite :: < Chain > {
49
- payroll : DaoExternalPayrollFactory :: new ( "cw_payroll" , chain. clone ( ) ) ,
50
- vesting : DaoExternalCwVesting :: new ( "cw_vesting" , chain. clone ( ) ) ,
51
- }
52
- }
53
-
54
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
55
- self . payroll . upload ( ) ?;
56
- self . vesting . upload ( ) ?;
57
- Ok ( ( ) )
58
- }
59
- }
60
-
61
- // cw tokenswap
62
- pub struct TokenSwapSuite < Chain > {
63
- pub tokenswap : DaoExternalTokenSwap < Chain > ,
64
- }
65
- impl < Chain : CwEnv > TokenSwapSuite < Chain > {
66
- pub fn new ( chain : Chain ) -> TokenSwapSuite < Chain > {
67
- TokenSwapSuite :: < Chain > {
68
- tokenswap : DaoExternalTokenSwap :: new ( "cw_tokenswap" , chain. clone ( ) ) ,
69
- }
70
- }
71
-
72
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
73
- self . tokenswap . upload ( ) ?;
74
-
75
- Ok ( ( ) )
76
- }
77
- }
78
-
79
- // cw-tokenfactory issuer
80
- pub struct TokenFactorySuite < Chain > {
81
- pub tokenfactory : DaoExternalTokenfactoryIssuer < Chain > ,
82
- }
83
- impl < Chain : CwEnv > TokenFactorySuite < Chain > {
84
- pub fn new ( chain : Chain ) -> TokenFactorySuite < Chain > {
85
- TokenFactorySuite :: < Chain > {
86
- tokenfactory : DaoExternalTokenfactoryIssuer :: new ( "cw_tokenfactory" , chain. clone ( ) ) ,
87
- }
88
- }
89
-
90
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
91
- self . tokenfactory . upload ( ) ?;
92
-
93
- Ok ( ( ) )
94
- }
95
- }
96
-
97
- // cw-vesting
98
- pub struct VestingSuite < Chain > {
99
- pub vesting : DaoExternalCwVesting < Chain > ,
100
- }
101
-
102
- impl < Chain : CwEnv > VestingSuite < Chain > {
103
- pub fn new ( chain : Chain ) -> VestingSuite < Chain > {
104
- VestingSuite :: < Chain > {
105
- vesting : DaoExternalCwVesting :: new ( "dao_dao_core" , chain. clone ( ) ) ,
106
- }
107
- }
108
-
109
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
110
- self . vesting . upload ( ) ?;
111
-
112
- Ok ( ( ) )
113
- }
114
- }
115
-
116
- // cw721 roles
117
- pub struct Cw721RolesSuite < Chain > {
118
- pub roles : DaoExternalCw721Roles < Chain > ,
119
- }
120
-
121
- impl < Chain : CwEnv > Cw721RolesSuite < Chain > {
122
- pub fn new ( chain : Chain ) -> Cw721RolesSuite < Chain > {
123
- Cw721RolesSuite :: < Chain > {
124
- roles : DaoExternalCw721Roles :: new ( "cw721_roles" , chain. clone ( ) ) ,
125
- }
126
- }
127
-
128
- pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
129
- self . roles . upload ( ) ?;
130
-
131
- Ok ( ( ) )
132
- }
133
- }
134
-
135
- // migrator
136
- pub struct DaoMigrationSuite < Chain > {
4
+ // external suite
5
+ pub struct DaoExternalSuite < Chain > {
6
+ pub admin_factory : DaoExternalAdminFactory < Chain > ,
7
+ pub btsg_ft_factory : DaoExternalFantokenFactory < Chain > ,
8
+ pub payroll_factory : DaoExternalPayrollFactory < Chain > ,
9
+ pub cw_tokenswap : DaoExternalTokenSwap < Chain > ,
10
+ pub cw_tokenfactory_issuer : DaoExternalTokenfactoryIssuer < Chain > ,
11
+ pub cw_vesting : DaoExternalCwVesting < Chain > ,
12
+ pub cw721_roles : DaoExternalCw721Roles < Chain > ,
137
13
pub migrator : DaoExternalMigrator < Chain > ,
138
14
}
139
15
140
- impl < Chain : CwEnv > DaoMigrationSuite < Chain > {
141
- pub fn new ( chain : Chain ) -> DaoMigrationSuite < Chain > {
142
- DaoMigrationSuite :: < Chain > {
16
+ impl < Chain : CwEnv > DaoExternalSuite < Chain > {
17
+ pub fn new ( chain : Chain ) -> DaoExternalSuite < Chain > {
18
+ DaoExternalSuite :: < Chain > {
19
+ admin_factory : DaoExternalAdminFactory :: new ( "cw_admin_factory" , chain. clone ( ) ) ,
20
+ btsg_ft_factory : DaoExternalFantokenFactory :: new ( "btsg_ft_factory" , chain. clone ( ) ) ,
21
+ payroll_factory : DaoExternalPayrollFactory :: new ( "cw_payroll" , chain. clone ( ) ) ,
22
+ cw_tokenswap : DaoExternalTokenSwap :: new ( "cw_tokenswap" , chain. clone ( ) ) ,
23
+ cw_tokenfactory_issuer : DaoExternalTokenfactoryIssuer :: new (
24
+ "cw_tokenfactory" ,
25
+ chain. clone ( ) ,
26
+ ) ,
27
+ cw_vesting : DaoExternalCwVesting :: new ( "cw_vesting" , chain. clone ( ) ) ,
28
+ cw721_roles : DaoExternalCw721Roles :: new ( "cw721_roles" , chain. clone ( ) ) ,
143
29
migrator : DaoExternalMigrator :: new ( "dao_migrator" , chain. clone ( ) ) ,
144
30
}
145
31
}
146
32
147
33
pub fn upload ( & self ) -> Result < ( ) , CwOrchError > {
34
+ self . admin_factory . upload ( ) ?;
35
+ self . btsg_ft_factory . upload ( ) ?;
36
+ self . payroll_factory . upload ( ) ?;
37
+ self . cw_tokenswap . upload ( ) ?;
38
+ self . cw_tokenfactory_issuer . upload ( ) ?;
39
+ self . cw_vesting . upload ( ) ?;
40
+ self . cw721_roles . upload ( ) ?;
148
41
self . migrator . upload ( ) ?;
149
42
150
43
Ok ( ( ) )
151
44
}
152
- }
45
+ }
0 commit comments