diff --git a/remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts b/remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts index e38d5fb4ed..f81d8210db 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts @@ -1122,7 +1122,14 @@ function getTypeStringFromComponents(components: ABIParameter[]) { return typeString } +/** + * Get compiler version from compiler contract object + * This is used to redirect the user to specific version of Solidity documentation + * @param contractFiles compiled contract object + */ function getCompilerVersion(contractFiles: CompiledContractObj): string { + // Solidity documentation is not available for these versions + const noDocVersions = ['0.4.26', '0.5.16', '0.5.17'] let version = 'develop' const fileNames: string[] = Object.keys(contractFiles) const contracts = contractFiles[fileNames[0]] @@ -1130,7 +1137,11 @@ function getCompilerVersion(contractFiles: CompiledContractObj): string { const contract: CompiledContract = contracts[contractNames[0]] const metadata = JSON.parse(contract.metadata) const compilerVersion: string = metadata.compiler.version - if(!compilerVersion.includes('nightly')) version = 'v' + compilerVersion.split('+commit')[0] + if(!compilerVersion.includes('nightly')) { + const solVersion = compilerVersion.split('+commit')[0] + if(!noDocVersions.includes(solVersion)) + version = 'v' + solVersion + } return version }