MCPcopy Index your code
hub / github.com/SmartTokenLabs/TokenScript / getContractAddress

Function getContractAddress

bootstrap-js/modules/ts_helpers.js:188–199  ·  view source on GitHub ↗
(xmlDoc, ethContract, tokenXmlNode, chainID)

Source from the content-addressed store, hash-verified

186 * @returns {{contractInterface: *, contractAddress: *}}
187 */
188export function getContractAddress(xmlDoc, ethContract, tokenXmlNode, chainID){
189
190 let contractNode = getXMLItem(xmlDoc,'ts:contract[@name="'+ethContract+'"][1]',tokenXmlNode);
191 if (contractNode){
192 var contractInterface = contractNode.getAttribute('interface');
193 var contractAddress = getXMLItemText(xmlDoc,'ts:address[@network='+chainID+'][1]',contractNode);
194 }
195
196 return {
197 contractInterface, contractAddress
198 }
199}
200
201/**
202 * parse XML and return innerHTML value by selector (XPath)

Callers 2

renderPropsMethod · 0.90
getEthereumCallParamsFunction · 0.85

Calls 2

getXMLItemFunction · 0.85
getXMLItemTextFunction · 0.85

Tested by

no test coverage detected