From 6be65c88249d51206e2873bb877706ddea1554e0 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 6 Nov 2024 13:29:02 +0100 Subject: [PATCH] fix condition --- .../run-tab/src/lib/components/contractGUI.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index bc92512469..6f97c170a3 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -32,7 +32,7 @@ export function ContractGUI(props: ContractGUIProps) { const multiFields = useRef>([]) const initializeFields = useRef>([]) const basicInputRef = useRef() - const [checkComplete, setCheckComplete] = useState(props.evmCheckComplete) + const intl = useIntl() useEffect(() => { if (props.deployOption && Array.isArray(props.deployOption)) { @@ -225,12 +225,9 @@ export function ContractGUI(props: ContractGUIProps) { } } - useEffect(() => { - setCheckComplete(props.evmCheckComplete) - }, [props.evmCheckComplete]) - const handleActionClick = async () => { props.getVersion() + const compilerState = await props.plugin.call('solidity', 'getCompilerState') if (props.runTabState.selectExEnv.toLowerCase().startsWith('vm-') || props.runTabState.selectExEnv.toLowerCase().includes('basic-http-provider')) { await handleDeploy() @@ -240,7 +237,9 @@ export function ContractGUI(props: ContractGUIProps) { props.plugin.call('terminal', 'log', { type: 'log', value: 'Consider opening an issue to update our internal store with your desired chainId.' }) return } - if (status === 'Passed' && checkComplete) { + const tabState = props.runTabState + const IsCompatible = isChainCompatible(compilerState.evmVersion ?? 'cancun', parseInt(tabState.chainId)) + if (status === 'Passed' && IsCompatible) { await handleDeploy() } }