Merge pull request #3629 from ethereum/warning_evm_version

warn the user about evm version
pull/3770/head
yann300 1 year ago committed by GitHub
commit 9831297627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/remix-ide/src/app/tabs/locales/en/udapp.json
  2. 2
      apps/remix-ide/src/app/tabs/locales/es/udapp.json
  3. 2
      apps/remix-ide/src/app/tabs/locales/fr/udapp.json
  4. 16
      libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx
  5. 9
      libs/remix-ui/run-tab/src/lib/css/run-tab.css

@ -4,7 +4,8 @@
"udapp.account": "Account", "udapp.account": "Account",
"udapp.value": "Value", "udapp.value": "Value",
"udapp.contract": "Contract", "udapp.contract": "Contract",
"udapp.compiledBy": "Compiled by {compilerName}", "udapp.compiledBy": "compiled by {compilerName}",
"udapp.warningEvmVersion": "Please make sure that the current network is compatible with this 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.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.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", "udapp.signAMessage": "Sign a message",

@ -4,7 +4,7 @@
"udapp.account": "Account", "udapp.account": "Account",
"udapp.value": "Value", "udapp.value": "Value",
"udapp.contract": "Contract", "udapp.contract": "Contract",
"udapp.compiledBy": "Compiled by {compilerName}", "udapp.compiledBy": "compiled by {compilerName}",
"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.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.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", "udapp.signAMessage": "Sign a message",

@ -4,7 +4,7 @@
"udapp.account": "Account", "udapp.account": "Account",
"udapp.value": "Value", "udapp.value": "Value",
"udapp.contract": "Contract", "udapp.contract": "Contract",
"udapp.compiledBy": "Compiled by {compilerName}", "udapp.compiledBy": "compiled by {compilerName}",
"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.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.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", "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 ( return (
<div className="udapp_container" data-id="contractDropdownContainer"> <div className="udapp_container" data-id="contractDropdownContainer">
<div className='d-flex justify-content-between'> <div className='d-flex justify-content-between'>
@ -270,7 +274,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
<label className="udapp_settingsLabel pr-1"> <label className="udapp_settingsLabel pr-1">
<FormattedMessage id='udapp.contract' /> <FormattedMessage id='udapp.contract' />
</label> </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> {compilerName && compilerName !== '' && <label className='udapp_settingsCompiledBy badge badge-secondary' data-id="udappCompiledBy"><FormattedMessage id='udapp.compiledBy' values={{ compilerName: <span className="text-capitalize"> {compilerName}</span> }} /></label>}
</div> </div>
{props.remixdActivated ? {props.remixdActivated ?
(<CustomTooltip (<CustomTooltip
@ -309,6 +313,16 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
</CustomTooltip> </CustomTooltip>
<span className="py-1" style={{ display: abiLabel.display }}>{abiLabel.content}</span> <span className="py-1" style={{ display: abiLabel.display }}>{abiLabel.content}</span>
</div> </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='udapp_evmVersion badge badge-secondary'>evm version: {evmVersion}</span>
</CustomTooltip> }
<div> <div>
<div className="udapp_deployDropdown"> <div className="udapp_deployDropdown">
{((contractList[currentFile] && contractList[currentFile].filter(contract => contract)) || []).length <= 0 ? intl.formatMessage({ id: 'udapp.noCompiledContracts' }) {((contractList[currentFile] && contractList[currentFile].filter(contract => contract)) || []).length <= 0 ? intl.formatMessage({ id: 'udapp.noCompiledContracts' })

@ -22,6 +22,9 @@
margin-bottom: 4px; margin-bottom: 4px;
text-transform: uppercase; text-transform: uppercase;
} }
.udapp_settingsCompiledBy {
margin-bottom: 4px;
}
.udapp_environment { .udapp_environment {
display: flex; display: flex;
align-items: center; align-items: center;
@ -75,11 +78,14 @@
width: 100%; width: 100%;
border: 1px solid border: 1px solid
} }
.udapp_evmVersion {
cursor: default;
}
.udapp_subcontainer { .udapp_subcontainer {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-bottom: 8px; margin-bottom: 2px;
} }
.udapp_subcontainer i { .udapp_subcontainer i {
width: 16px; width: 16px;
@ -181,7 +187,6 @@
display: inline; display: inline;
} }
.udapp_network { .udapp_network {
margin-left: 8px;
pointer-events: none; pointer-events: none;
} }
.udapp_networkItem { .udapp_networkItem {

Loading…
Cancel
Save