From d036549832a207a263ae0a2a10a465d1f6c6424a Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 18 Apr 2023 10:47:18 +0200 Subject: [PATCH] warn the user about evm version --- apps/remix-ide/src/app/tabs/locales/en/udapp.json | 1 + .../src/lib/components/contractDropdownUI.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 77e264d98f..d30f40da1f 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -5,6 +5,7 @@ "udapp.value": "Value", "udapp.contract": "Contract", "udapp.compiledBy": "Compiled by {compilerName}", + "udapp.warningEvmVersion": "Please make sure that the current network is following the evm version: {evmVersion}. Otherwise any deployment will fail.", "udapp.infoSyncCompiledContractTooltip": "Click here to import contracts compiled from an external framework.This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd.", "udapp.remixIpfsUdappTooltip": "Publishing the source code and metadata to IPFS facilitates source code verification using Sourcify and will greatly foster contract adoption (auditing, debugging, calling it, etc...)", "udapp.signAMessage": "Sign a message", diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 0ffb8789a7..3a0f5afe8f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -263,6 +263,10 @@ export function ContractDropdownUI (props: ContractDropdownProps) { ) } + let evmVersion = null + try { + evmVersion = JSON.parse(loadedContractData.metadata).settings.evmVersion + } catch (err) {} return (
@@ -271,6 +275,16 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
{compilerName && compilerName !== '' && }
+ { evmVersion && loadedContractData && + + } + > + (evm: {evmVersion}) + }
{props.remixdActivated ? (