warn the user about evm version

pull/3629/head
yann300 2 years ago
parent f83e22c3d0
commit d036549832
  1. 1
      apps/remix-ide/src/app/tabs/locales/en/udapp.json
  2. 14
      libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx

@ -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",

@ -263,6 +263,10 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
)
}
let evmVersion = null
try {
evmVersion = JSON.parse(loadedContractData.metadata).settings.evmVersion
} catch (err) {}
return (
<div className="udapp_container" data-id="contractDropdownContainer">
<div className='d-flex justify-content-between'>
@ -271,6 +275,16 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
<FormattedMessage id='udapp.contract' />
</label>
<div className="d-flex">{compilerName && compilerName !== '' && <label style={{ maxHeight: '0.6rem', lineHeight: '1rem' }} data-id="udappCompiledBy">(<FormattedMessage id='udapp.compiledBy' values={{ compilerName: <span className="text-capitalize"> {compilerName}</span> }} />)</label>}</div>
{ evmVersion && loadedContractData && <CustomTooltip
placement={'right'}
tooltipClasses="text-wrap text-left"
tooltipId="info-evm-version-warn"
tooltipText={<span className="text-left">
<FormattedMessage id='udapp.warningEvmVersion' values={{ evmVersion }}/>
</span>}
>
<span className='ml-2'>(evm: {evmVersion})</span>
</CustomTooltip> }
</div>
{props.remixdActivated ?
(<CustomTooltip

Loading…
Cancel
Save