|
|
@ -3,6 +3,8 @@ import { Plugin } from '@remixproject/engine' |
|
|
|
import { customAction } from '@remixproject/plugin-api' |
|
|
|
import { customAction } from '@remixproject/plugin-api' |
|
|
|
import { concatSourceFiles, getDependencyGraph } from '@remix-ui/solidity-compiler' |
|
|
|
import { concatSourceFiles, getDependencyGraph } from '@remix-ui/solidity-compiler' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _paq = window._paq = window._paq || [] |
|
|
|
|
|
|
|
|
|
|
|
const profile = { |
|
|
|
const profile = { |
|
|
|
name: 'contractflattener', |
|
|
|
name: 'contractflattener', |
|
|
|
displayName: 'Contract Flattener', |
|
|
|
displayName: 'Contract Flattener', |
|
|
@ -22,6 +24,7 @@ export class ContractFlattener extends Plugin { |
|
|
|
this.on('solidity', 'compilationFinished', async (file, source, languageVersion, data, input, version) => { |
|
|
|
this.on('solidity', 'compilationFinished', async (file, source, languageVersion, data, input, version) => { |
|
|
|
await this.flattenContract(source, this.fileName, data) |
|
|
|
await this.flattenContract(source, this.fileName, data) |
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'plugin', 'activated', 'contractFlattener']) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async flattenAContract(action: customAction) { |
|
|
|
async flattenAContract(action: customAction) { |
|
|
@ -44,6 +47,7 @@ export class ContractFlattener extends Plugin { |
|
|
|
const sources = source.sources |
|
|
|
const sources = source.sources |
|
|
|
const result = concatSourceFiles(sorted, sources) |
|
|
|
const result = concatSourceFiles(sorted, sources) |
|
|
|
await this.call('fileManager', 'writeFile', `${filePath}_flattened.sol`, result) |
|
|
|
await this.call('fileManager', 'writeFile', `${filePath}_flattened.sol`, result) |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'plugin', 'contractFlattener', 'flattenAContract']) |
|
|
|
return result |
|
|
|
return result |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |