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

Function step_instance_fromSTR

CLI/commands/strMigrator.js:180–205  ·  view source on GitHub ↗
(fromStrAddress)

Source from the content-addressed store, hash-verified

178}
179
180async function step_instance_fromSTR(fromStrAddress) {
181 let _fromStrAddress;
182 if (typeof fromStrAddress !== 'undefined') {
183 if (web3.utils.isAddress(fromStrAddress)) {
184 _fromStrAddress = fromStrAddress;
185 } else {
186 console.log(chalk.red("Entered fromStrAddress is not a valid address."));
187 return;
188 }
189 } else {
190 // _fromStrAddress = readlineSync.question('Enter the old SecurityTokenRegistry address to migrate FROM: ', {
191 // limit: function(input) {
192 // return web3.utils.isAddress(input);
193 // },
194 // limitMessage: "Must be a valid address"
195 // });
196 _fromStrAddress = "0xef58491224958d978facf55d2120c55a24516b98";
197 }
198
199 console.log(`Creating SecurityTokenRegistry contract instance of address: ${_fromStrAddress}...`);
200 let securityTokenRegistryABI = await getABIfromEtherscan(_fromStrAddress);
201 let fromSTR = new web3.eth.Contract(securityTokenRegistryABI, _fromStrAddress);
202 fromSTR.setProvider(web3.currentProvider);
203
204 return fromSTR;
205}
206
207async function step_get_deployed_tokens(securityTokenRegistry, singleTicker) {
208 let tokens = [];

Callers 1

executeAppFunction · 0.85

Calls 1

getABIfromEtherscanFunction · 0.70

Tested by

no test coverage detected