From 040f21a88915bf32903b053b46ad8dbbe4ffcb43 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 30 Mar 2023 09:34:39 +0100 Subject: [PATCH] fix mandatory flattening on contract compile --- apps/remix-ide/src/app/plugins/contractFlattener.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/plugins/contractFlattener.tsx b/apps/remix-ide/src/app/plugins/contractFlattener.tsx index 644dc3ee62..0cefd50331 100644 --- a/apps/remix-ide/src/app/plugins/contractFlattener.tsx +++ b/apps/remix-ide/src/app/plugins/contractFlattener.tsx @@ -21,7 +21,9 @@ export class ContractFlattener extends Plugin { onActivation(): void { this.on('solidity', 'compilationFinished', async (file, source, languageVersion, data, input, version) => { - await this.flattenContract(source, file, data) + if(data.sources && Object.keys(data.sources).length > 1) { + await this.flattenContract(source, file, data) + } }) _paq.push(['trackEvent', 'plugin', 'activated', 'contractFlattener']) }