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

Function getTokens

scripts/tokenInfo-v1.js:8–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const generalTransferManagerABI = JSON.parse(require('fs').readFileSync('../CLI/data/GeneralTransferManager1-4-0.json').toString()).abi;
7
8async function getTokens() {
9 const securityTokenRegistryAddress = "0xEf58491224958d978fACF55D2120c55A24516B98";
10 const securityTokenRegistryABI = await getABIfromEtherscan(securityTokenRegistryAddress);
11 const securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress);
12
13 let logs = await getLogsFromEtherscan(securityTokenRegistry.options.address, web3.utils.hexToNumber('0x5C5C18'), 'latest', 'LogNewSecurityToken(string,address,address)');
14 for (let i = 0; i < logs.length; i++) {
15 let tokenAddress = '0x' + logs[i].topics[1].slice(26, 66)
16 await getInfo(tokenAddress);
17 }
18}
19
20async function getInfo(tokenAddress) {
21 let token = new web3.eth.Contract(securityTokenABI, tokenAddress);

Callers 1

tokenInfo-v1.jsFile · 0.70

Calls 3

getABIfromEtherscanFunction · 0.70
getLogsFromEtherscanFunction · 0.70
getInfoFunction · 0.70

Tested by

no test coverage detected