@@ -4,7 +4,7 @@ import { FunctionDefinitionAstNode, ModifierDefinitionAstNode, ParameterListAstN
44 WhileStatementAstNode , VariableDeclarationAstNode , ContractDefinitionAstNode , InheritanceSpecifierAstNode ,
55 MemberAccessAstNode , BinaryOperationAstNode , FunctionCallAstNode , ExpressionStatementAstNode , UnaryOperationAstNode ,
66 IdentifierAstNode , IndexAccessAstNode , BlockAstNode , AssignmentAstNode , InlineAssemblyAstNode , IfStatementAstNode } from "types"
7- import { util } from 'remix-lib '
7+ import { concatWithSeperator , escapeRegExp } from '../../util/helpers '
88
99type SpecialObjDetail = {
1010 obj : string
@@ -439,7 +439,7 @@ function getFullQualifiedFunctionCallIdent (contract: ContractDefinitionAstNode,
439439}
440440
441441function getFullQuallyfiedFuncDefinitionIdent ( contract : ContractDefinitionAstNode , func : FunctionDefinitionAstNode , paramTypes : any [ ] ) : string {
442- return getContractName ( contract ) + '.' + getFunctionDefinitionName ( func ) + '(' + util . concatWithSeperator ( paramTypes , ',' ) + ')'
442+ return getContractName ( contract ) + '.' + getFunctionDefinitionName ( func ) + '(' + concatWithSeperator ( paramTypes , ',' ) + ')'
443443}
444444
445445function getUnAssignedTopLevelBinOps ( subScope : BlockAstNode | IfStatementAstNode | WhileStatementAstNode | ForStatementAstNode ) : ExpressionStatementAstNode [ ] {
@@ -665,7 +665,7 @@ function isConstructor (node: FunctionDefinitionAstNode): boolean {
665665 * @return {bool }
666666 */
667667function isIntDivision ( node : BinaryOperationAstNode ) : boolean {
668- return operator ( node , exactMatch ( util . escapeRegExp ( '/' ) ) ) && typeDescription ( node . rightExpression , util . escapeRegExp ( 'int' ) )
668+ return operator ( node , exactMatch ( escapeRegExp ( '/' ) ) ) && typeDescription ( node . rightExpression , escapeRegExp ( 'int' ) )
669669}
670670
671671/**
@@ -863,7 +863,7 @@ function isLowLevelCall (node: MemberAccessAstNode): boolean {
863863 */
864864function isLLSend04 ( node : MemberAccessAstNode ) : boolean {
865865 return isMemberAccess ( node ,
866- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . SEND . type ) ) ,
866+ exactMatch ( escapeRegExp ( lowLevelCallTypes . SEND . type ) ) ,
867867 undefined , exactMatch ( basicTypes . ADDRESS ) , exactMatch ( lowLevelCallTypes . SEND . ident ) )
868868}
869869
@@ -874,7 +874,7 @@ function isLLSend04 (node: MemberAccessAstNode): boolean {
874874 */
875875function isLLSend ( node : MemberAccessAstNode ) : boolean {
876876 return isMemberAccess ( node ,
877- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . SEND . type ) ) ,
877+ exactMatch ( escapeRegExp ( lowLevelCallTypes . SEND . type ) ) ,
878878 undefined , exactMatch ( basicTypes . PAYABLE_ADDRESS ) , exactMatch ( lowLevelCallTypes . SEND . ident ) )
879879}
880880
@@ -885,10 +885,10 @@ function isLLSend (node: MemberAccessAstNode): boolean {
885885 */
886886function isLLCall ( node : MemberAccessAstNode ) : boolean {
887887 return isMemberAccess ( node ,
888- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . CALL . type ) ) ,
888+ exactMatch ( escapeRegExp ( lowLevelCallTypes . CALL . type ) ) ,
889889 undefined , exactMatch ( basicTypes . ADDRESS ) , exactMatch ( lowLevelCallTypes . CALL . ident ) ) ||
890890 isMemberAccess ( node ,
891- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . CALL . type ) ) ,
891+ exactMatch ( escapeRegExp ( lowLevelCallTypes . CALL . type ) ) ,
892892 undefined , exactMatch ( basicTypes . PAYABLE_ADDRESS ) , exactMatch ( lowLevelCallTypes . CALL . ident ) )
893893}
894894
@@ -899,7 +899,7 @@ function isLLCall (node: MemberAccessAstNode): boolean {
899899 */
900900function isLLCall04 ( node : MemberAccessAstNode ) : boolean {
901901 return isMemberAccess ( node ,
902- exactMatch ( util . escapeRegExp ( lowLevelCallTypes [ 'CALL-0.4' ] . type ) ) ,
902+ exactMatch ( escapeRegExp ( lowLevelCallTypes [ 'CALL-0.4' ] . type ) ) ,
903903 undefined , exactMatch ( basicTypes . ADDRESS ) , exactMatch ( lowLevelCallTypes [ 'CALL-0.4' ] . ident ) )
904904}
905905
@@ -910,7 +910,7 @@ function isLLCall04 (node: MemberAccessAstNode): boolean {
910910 */
911911function isLLCallcode ( node : MemberAccessAstNode ) : boolean {
912912 return isMemberAccess ( node ,
913- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . CALLCODE . type ) ) ,
913+ exactMatch ( escapeRegExp ( lowLevelCallTypes . CALLCODE . type ) ) ,
914914 undefined , exactMatch ( basicTypes . ADDRESS ) , exactMatch ( lowLevelCallTypes . CALLCODE . ident ) )
915915}
916916
@@ -921,7 +921,7 @@ function isLLCallcode (node: MemberAccessAstNode): boolean {
921921 */
922922function isLLDelegatecall ( node : MemberAccessAstNode ) : boolean {
923923 return isMemberAccess ( node ,
924- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . DELEGATECALL . type ) ) ,
924+ exactMatch ( escapeRegExp ( lowLevelCallTypes . DELEGATECALL . type ) ) ,
925925 undefined , matches ( basicTypes . PAYABLE_ADDRESS , basicTypes . ADDRESS ) , exactMatch ( lowLevelCallTypes . DELEGATECALL . ident ) )
926926}
927927
@@ -932,7 +932,7 @@ function isLLDelegatecall (node: MemberAccessAstNode): boolean {
932932 */
933933function isLLDelegatecall04 ( node : MemberAccessAstNode ) : boolean {
934934 return isMemberAccess ( node ,
935- exactMatch ( util . escapeRegExp ( lowLevelCallTypes [ 'DELEGATECALL-0.4' ] . type ) ) ,
935+ exactMatch ( escapeRegExp ( lowLevelCallTypes [ 'DELEGATECALL-0.4' ] . type ) ) ,
936936 undefined , matches ( basicTypes . PAYABLE_ADDRESS , basicTypes . ADDRESS ) , exactMatch ( lowLevelCallTypes [ 'DELEGATECALL-0.4' ] . ident ) )
937937}
938938
@@ -943,12 +943,12 @@ function isLLDelegatecall04 (node: MemberAccessAstNode): boolean {
943943 */
944944function isTransfer ( node : MemberAccessAstNode ) : boolean {
945945 return isMemberAccess ( node ,
946- exactMatch ( util . escapeRegExp ( lowLevelCallTypes . TRANSFER . type ) ) ,
946+ exactMatch ( escapeRegExp ( lowLevelCallTypes . TRANSFER . type ) ) ,
947947 undefined , matches ( basicTypes . ADDRESS , basicTypes . PAYABLE_ADDRESS ) , exactMatch ( lowLevelCallTypes . TRANSFER . ident ) )
948948}
949949
950950function isStringToBytesConversion ( node : FunctionCallAstNode ) : boolean {
951- return isExplicitCast ( node , util . escapeRegExp ( 'string *' ) , util . escapeRegExp ( 'bytes' ) )
951+ return isExplicitCast ( node , escapeRegExp ( 'string *' ) , escapeRegExp ( 'bytes' ) )
952952}
953953
954954function isExplicitCast ( node : FunctionCallAstNode , castFromType : string , castToType : string ) : boolean {
@@ -958,7 +958,7 @@ function isExplicitCast (node: FunctionCallAstNode, castFromType: string, castTo
958958}
959959
960960function isBytesLengthCheck ( node : MemberAccessAstNode ) : boolean {
961- return isMemberAccess ( node , exactMatch ( util . escapeRegExp ( basicTypes . UINT ) ) , undefined , util . escapeRegExp ( 'bytes *' ) , 'length' )
961+ return isMemberAccess ( node , exactMatch ( escapeRegExp ( basicTypes . UINT ) ) , undefined , escapeRegExp ( 'bytes *' ) , 'length' )
962962}
963963
964964/**
@@ -985,7 +985,7 @@ function isMemberAccess (node: MemberAccessAstNode, retType: string, accessor: s
985985}
986986
987987function isSpecialVariableAccess ( node : MemberAccessAstNode , varType : SpecialObjDetail ) : boolean {
988- return isMemberAccess ( node , exactMatch ( util . escapeRegExp ( varType . type ) ) , varType . obj , varType . obj , varType . member )
988+ return isMemberAccess ( node , exactMatch ( escapeRegExp ( varType . type ) ) , varType . obj , varType . obj , varType . member )
989989}
990990
991991// #################### Node Identification Primitives
@@ -1061,11 +1061,11 @@ function findFirstSubNodeLTR (node: any, type: string): any {
10611061 * @return {Boolean } isPayable
10621062 */
10631063function buildFunctionSignature ( paramTypes : any [ ] , returnTypes : any [ ] , isPayable : boolean , additionalMods ?: any ) : string {
1064- return 'function (' + util . concatWithSeperator ( paramTypes , ',' ) + ')' + ( ( isPayable ) ? ' payable' : '' ) + ( ( additionalMods ) ? ' ' + additionalMods : '' ) + ( ( returnTypes . length ) ? ' returns (' + util . concatWithSeperator ( returnTypes , ',' ) + ')' : '' )
1064+ return 'function (' + concatWithSeperator ( paramTypes , ',' ) + ')' + ( ( isPayable ) ? ' payable' : '' ) + ( ( additionalMods ) ? ' ' + additionalMods : '' ) + ( ( returnTypes . length ) ? ' returns (' + concatWithSeperator ( returnTypes , ',' ) + ')' : '' )
10651065}
10661066
10671067function buildAbiSignature ( funName : string , paramTypes : any [ ] ) : string {
1068- return funName + '(' + util . concatWithSeperator ( paramTypes , ',' ) + ')'
1068+ return funName + '(' + concatWithSeperator ( paramTypes , ',' ) + ')'
10691069}
10701070
10711071const helpers = {
0 commit comments