@@ -5,15 +5,13 @@ import {
5
5
providerUtils ,
6
6
Provider ,
7
7
PolymathRegistry ,
8
- SecurityToken ,
9
- SecurityTokenRegistry ,
8
+ ISecurityTokenRegistry ,
9
+ ISecurityToken ,
10
10
PolyToken ,
11
11
ModuleRegistry ,
12
12
CappedSTO ,
13
- CappedSTOFactory ,
14
13
ModuleFactory ,
15
14
USDTieredSTO ,
16
- USDTieredSTOFactory ,
17
15
FeatureRegistry ,
18
16
GeneralTransferManager ,
19
17
GeneralPermissionManager ,
@@ -23,7 +21,10 @@ import {
23
21
PercentageTransferManager ,
24
22
EtherDividendCheckpoint ,
25
23
VolumeRestrictionTransferManager ,
26
- PolyTokenFaucet , } from '@polymathnetwork/abi-wrappers' ;
24
+ PolyTokenFaucet ,
25
+ Module ,
26
+ ERC20Detailed ,
27
+ } from '@polymathnetwork/abi-wrappers' ;
27
28
import PolymathRegistryWrapper from './contract_wrappers/registries/polymath_registry_wrapper' ;
28
29
import SecurityTokenRegistryWrapper from './contract_wrappers/registries/security_token_registry_wrapper' ;
29
30
import PolyTokenWrapper from './contract_wrappers/tokens/poly_token_wrapper' ;
@@ -132,36 +133,55 @@ export class PolymathAPI {
132
133
gasPrice : params . defaultGasPrice ,
133
134
} ) ;
134
135
135
- const artifactsArray = [
136
- PolymathRegistry ,
137
- SecurityToken ,
138
- SecurityTokenRegistry ,
139
- PolyToken ,
140
- ModuleRegistry ,
141
- CappedSTO ,
142
- CappedSTOFactory ,
143
- ModuleFactory ,
144
- USDTieredSTO ,
145
- USDTieredSTOFactory ,
146
- FeatureRegistry ,
147
- GeneralTransferManager ,
148
- GeneralPermissionManager ,
149
- ERC20DividendCheckpoint ,
150
- ManualApprovalTransferManager ,
151
- CountTransferManager ,
152
- PercentageTransferManager ,
153
- EtherDividendCheckpoint ,
154
- VolumeRestrictionTransferManager ,
155
- PolyTokenFaucet ,
136
+ const abiArray = [
137
+ // Registries
138
+ FeatureRegistry . abi ,
139
+ ModuleRegistry . abi ,
140
+ PolymathRegistry . abi ,
141
+ ISecurityTokenRegistry . abi . filter (
142
+ a =>
143
+ a . type !== 'event' &&
144
+ a . name !== 'RegisterTicker' &&
145
+ a . inputs ===
146
+ [
147
+ { indexed : true , name : '_owner' , type : 'address' } ,
148
+ { indexed : false , name : '_ticker' , type : 'string' } ,
149
+ { indexed : false , name : '_name' , type : 'string' } ,
150
+ { indexed : true , name : '_registrationDate' , type : 'uint256' } ,
151
+ { indexed : true , name : '_expiryDate' , type : 'uint256' } ,
152
+ { indexed : false , name : '_fromAdmin' , type : 'bool' } ,
153
+ { indexed : false , name : '_registrationFee' , type : 'uint256' } ,
154
+ ] ,
155
+ ) ,
156
+ // Modules
157
+ ModuleFactory . abi ,
158
+ Module . abi ,
159
+ // Checkpoint
160
+ ERC20DividendCheckpoint . abi ,
161
+ EtherDividendCheckpoint . abi ,
162
+ // Permission
163
+ GeneralPermissionManager . abi ,
164
+ // STO
165
+ CappedSTO . abi ,
166
+ USDTieredSTO . abi ,
167
+ // Transfer
168
+ CountTransferManager . abi ,
169
+ GeneralTransferManager . abi ,
170
+ ManualApprovalTransferManager . abi ,
171
+ PercentageTransferManager . abi ,
172
+ VolumeRestrictionTransferManager . abi ,
173
+ // Tokens
174
+ ERC20Detailed . abi ,
175
+ PolyToken . abi ,
176
+ PolyTokenFaucet . abi ,
177
+ ISecurityToken . abi ,
156
178
] ;
157
179
158
- artifactsArray . forEach (
159
- ( artifact ) : void => {
160
- this . web3Wrapper . abiDecoder . addABI ( artifact . abi ) ;
161
- } ,
162
- ) ;
180
+ abiArray . forEach ( ( abi ) : void => {
181
+ this . web3Wrapper . abiDecoder . addABI ( abi ) ;
182
+ } ) ;
163
183
164
- this . contractFactory = new ContractFactory ( this . web3Wrapper , params . polymathRegistryAddress ) ;
184
+ this . contractFactory = new ContractFactory ( this . web3Wrapper , abiArray , params . polymathRegistryAddress ) ;
165
185
166
186
this . polymathRegistry = new PolymathRegistryWrapper (
167
187
this . web3Wrapper ,
@@ -217,7 +237,7 @@ export class PolymathAPI {
217
237
*/
218
238
public getERC20TokenWrapper = async ( params : GetERC20WrapperParams ) : Promise < ERC20 > => {
219
239
return this . tokenFactory . getERC20TokenInstanceFromAddress ( params . address ) ;
220
- }
240
+ } ;
221
241
222
242
/**
223
243
* Get the account currently used by PolymathAPI
0 commit comments