|
|
|
@ -40,8 +40,7 @@ const App = () => { |
|
|
|
|
|
|
|
|
|
contractsRef.current = contracts |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
plugin.internalEvents.on('etherscan_activated', () => { |
|
|
|
|
const setListeners = () => { |
|
|
|
|
plugin.on('solidity', 'compilationFinished', (fileName: string, source: CompilationFileSources, languageVersion: string, data: CompilationResult) => { |
|
|
|
|
const newContractsNames = getNewContractNames(data) |
|
|
|
|
|
|
|
|
@ -56,6 +55,16 @@ const App = () => { |
|
|
|
|
}) |
|
|
|
|
// @ts-ignore
|
|
|
|
|
plugin.call('blockchain', 'getCurrentNetworkStatus').then((result: any) => setNetworkName(`${result.network.name} ${result.network.id !== '-' ? `(Chain id: ${result.network.id})` : '(Not supported)'}`)) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
plugin.onload(() => { |
|
|
|
|
console.log('plugin loaded') |
|
|
|
|
console.log(plugin.isLoaded) |
|
|
|
|
setListeners() |
|
|
|
|
}) |
|
|
|
|
plugin.internalEvents.on('etherscan_activated', () => { |
|
|
|
|
}) |
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|