Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
5df01469
Commit
5df01469
authored
May 27, 2020
by
aniket-engg
Committed by
Aniket
Jun 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get compiler version using compilation result
parent
b3a5c1a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
staticAnalysisCommon.ts
...zer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
+13
-1
types.ts
remix-analyzer/src/types.ts
+5
-0
No files found.
remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
View file @
5df01469
...
...
@@ -3,7 +3,7 @@
import
{
FunctionDefinitionAstNode
,
ModifierDefinitionAstNode
,
ParameterListAstNode
,
ForStatementAstNode
,
WhileStatementAstNode
,
VariableDeclarationAstNode
,
ContractDefinitionAstNode
,
InheritanceSpecifierAstNode
,
MemberAccessAstNode
,
BinaryOperationAstNode
,
FunctionCallAstNode
,
ExpressionStatementAstNode
,
UnaryOperationAstNode
,
IdentifierAstNode
,
IndexAccessAstNode
,
BlockAstNode
,
AssignmentAstNode
,
InlineAssemblyAstNode
,
IfStatementAstNode
,
CompiledContractObj
,
ABIParameter
}
from
"types"
IdentifierAstNode
,
IndexAccessAstNode
,
BlockAstNode
,
AssignmentAstNode
,
InlineAssemblyAstNode
,
IfStatementAstNode
,
CompiledContractObj
,
ABIParameter
,
CompilationResult
,
CompiledContract
}
from
"types"
import
{
util
}
from
'remix-lib'
type
SpecialObjDetail
=
{
...
...
@@ -1122,6 +1122,17 @@ function getTypeStringFromComponents(components: ABIParameter[]) {
return
typeString
}
function
getCompilerVersion
(
contractFiles
:
CompiledContractObj
):
string
{
const
fileNames
:
string
[]
=
Object
.
keys
(
contractFiles
)
const
contracts
=
contractFiles
[
fileNames
[
0
]]
const
contractNames
:
string
[]
=
Object
.
keys
(
contracts
)
const
contract
:
CompiledContract
=
contracts
[
contractNames
[
0
]]
const
metadata
=
JSON
.
parse
(
contract
.
metadata
)
const
compilerVersion
:
string
=
metadata
.
compiler
.
version
if
(
!
compilerVersion
.
includes
(
'nightly'
))
return
'v'
+
compilerVersion
.
split
(
'+commit'
)[
0
]
else
return
'develop'
}
const
helpers
=
{
expressionTypeDescription
,
nodeType
,
...
...
@@ -1158,6 +1169,7 @@ export {
getFunctionDefinitionReturnParameterPart
,
getUnAssignedTopLevelBinOps
,
getMethodParamsSplittedTypeDesc
,
getCompilerVersion
,
// #################### Complex Node Identification
isDeleteOfDynamicArray
,
...
...
remix-analyzer/src/types.ts
View file @
5df01469
...
...
@@ -8,6 +8,11 @@ export interface AnalyzerModule {
report
:
ReportFunction
}
// This version signifies the module support for Solidity version.
// start will be minimum at 0.4.12 as since that version Solidity exports latest AST
// end should be a version in which analysis feature got deprecated.
// This will be helpful in version based analysis in future.
export
interface
SupportedVersion
{
start
:
string
end
?:
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment