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

Function getTokens

scripts/tokenInfo-v2.js:16–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14).abi;
15
16async function getTokens() {
17 const securityTokenRegistryAddress = "0x240f9f86b1465bf1b8eb29bc88cbf65573dfdd97";
18 const securityTokenRegistryABI = await getABIfromEtherscan(securityTokenRegistryAddress);
19 const securityTokenRegistry = new web3.eth.Contract(securityTokenRegistryABI, securityTokenRegistryAddress);
20
21 let logs = await getLogsFromEtherscan(
22 securityTokenRegistry.options.address,
23 0,
24 "latest",
25 "NewSecurityToken(string,string,address,address,uint256,address,bool,uint256)"
26 );
27 console.log(logs.length);
28 for (let i = 0; i < logs.length; i++) {
29 let tokenAddress = "0x" + logs[i].topics[1].slice(26, 66);
30 await getInfo(tokenAddress);
31 }
32}
33
34async function getInfo(tokenAddress) {
35 let token = new web3.eth.Contract(securityTokenABI, tokenAddress);

Callers 1

tokenInfo-v2.jsFile · 0.70

Calls 3

getABIfromEtherscanFunction · 0.70
getLogsFromEtherscanFunction · 0.70
getInfoFunction · 0.70

Tested by

no test coverage detected