diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx
index 26d87b7fc0..56f50b1b70 100644
--- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx
+++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx
@@ -80,6 +80,22 @@ export function RunTabUI(props: RunTabProps) {
const [runTab, dispatch] = useReducer(runTabReducer, initialState)
const REACT_API = { runTab }
const currentfile = plugin.config.get('currentFile')
+ const [solcVersion, setSolcVersion] = useState<{version: string, canReceive: boolean}>({ version: '', canReceive: true })
+
+ const getVersion = () => {
+ let version = ''
+ try {
+ version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
+ if (parseFloat(version) < 0.6) {
+ setSolcVersion({ version: version, canReceive: false })
+ }
+ setSolcVersion({ version: version, canReceive: true })
+ } catch (e) {
+ version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
+ console.log(e)
+ }
+ return version
+ }
useEffect(() => {
if (!props.initialState) {
@@ -306,6 +322,9 @@ export function RunTabUI(props: RunTabProps) {
isValidProxyAddress={isValidProxyAddress}
isValidProxyUpgrade={isValidProxyUpgrade}
proxy={runTab.proxy}
+ solCompilerVersion={solcVersion}
+ setCompilerVersion={setSolcVersion}
+ getCompilerVersion={getVersion}
/>
{
diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts
index 7e4ae84533..39c8fd5781 100644
--- a/libs/remix-ui/run-tab/src/lib/types/index.ts
+++ b/libs/remix-ui/run-tab/src/lib/types/index.ts
@@ -279,6 +279,11 @@ export interface ContractDropdownProps {
isValidProxyAddress?: (address: string) => Promise,
isValidProxyUpgrade?: (proxyAddress: string, contractName: string, solcInput: SolcInput, solcOuput: SolcOutput, solcVersion: string) => Promise,
proxy: { deployments: { address: string, date: string, contractName: string }[] }
+ solCompilerVersion: { version: string, canReceive: boolean }
+ setCompilerVersion: React.Dispatch>
+ getCompilerVersion: () => string
}
export interface RecorderProps {
@@ -343,6 +348,8 @@ export interface InstanceContainerProps {
exEnvironment: string
editInstance: (instance) => void
plugin: RunTab
+ solcVersion: { version: string, canReceive: boolean }
+ getVersion: () => string
}
export interface Modal {
@@ -397,6 +404,11 @@ export interface ContractGUIProps {
isValidProxyAddress?: (address: string) => Promise,
isValidProxyUpgrade?: (proxyAddress: string) => Promise,
modal?: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void, okBtnClass?: string, cancelBtnClass?: string) => void
+ solcVersion?: { version: string, canReceive: boolean }
+ setSolcVersion?: React.Dispatch>
+ getVersion: () => string
}
export interface MainnetProps {
network: Network,
@@ -452,6 +464,8 @@ export interface UdappProps {
exEnvironment: string
editInstance: (instance) => void
plugin: RunTab
+ solcVersion: { version: string, canReceive: boolean }
+ getVersion: () => string
}
export interface DeployButtonProps {