MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / setup

Function setup

CLI/commands/token_manager.js:25–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23let tokenSymbol
24
25async function setup() {
26 try {
27 let securityTokenRegistryAddress = await contracts.securityTokenRegistry();
28 let securityTokenRegistryABI = abis.securityTokenRegistry();
29 securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress);
30 securityTokenRegistry.setProvider(web3.currentProvider);
31
32 let polytokenAddress = await contracts.polyToken();
33 let polytokenABI = abis.polyToken();
34 polyToken = new web3.eth.Contract(polytokenABI, polytokenAddress);
35 polyToken.setProvider(web3.currentProvider);
36
37 let featureRegistryAddress = await contracts.featureRegistry();
38 let featureRegistryABI = abis.featureRegistry();
39 featureRegistry = new web3.eth.Contract(featureRegistryABI, featureRegistryAddress);
40 featureRegistry.setProvider(web3.currentProvider);
41 } catch (err) {
42 console.log(err);
43 console.log(chalk.red(`There was a problem getting the contracts. Make sure they are deployed to the selected network.`));
44 process.exit(0);
45 }
46}
47
48// Start function
49async function executeApp() {

Callers 1

initializeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected