diff --git a/remix-analyzer/src/solidity-analyzer/modules/assignAndCompare.ts b/remix-analyzer/src/solidity-analyzer/modules/assignAndCompare.ts index b24139e33d..f4d6792d87 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/assignAndCompare.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/assignAndCompare.ts @@ -6,8 +6,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, BlockAstNod export default class assignAndCompare implements AnalyzerModule { warningNodes: ExpressionStatementAstNode[] = [] - name: string = 'Result not used: ' - description: string = 'The result of an operation was not used.' + name: string = `Result not used: ` + description: string = `The result of an operation not used` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/blockBlockhash.ts b/remix-analyzer/src/solidity-analyzer/modules/blockBlockhash.ts index 1509ead07f..388883a032 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/blockBlockhash.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/blockBlockhash.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class blockBlockhash implements AnalyzerModule { warningNodes: FunctionCallAstNode[] = [] - name: string = 'Blockhash usage: ' - description: string = 'Semantics maybe unclear' + name: string = `Blockhash usage: ` + description: string = `Semantics maybe unclear` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts b/remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts index 36592a594d..b2f05e5f7d 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts @@ -7,8 +7,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class blockTimestamp implements AnalyzerModule { warningNowNodes: IdentifierAstNode[] = [] warningblockTimestampNodes: MemberAccessAstNode[] = [] - name: string = 'Block timestamp: ' - description: string = 'Semantics maybe unclear' + name: string = `Block timestamp: ` + description: string = `Semantics maybe unclear` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.ts b/remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.ts index 61d3aa753c..6e55a7da8f 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.ts @@ -9,8 +9,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, ContractHLA InlineAssemblyAstNode, ReportFunction, VisitFunction, FunctionCallGraph } from './../../types' export default class checksEffectsInteraction implements AnalyzerModule { - name: string = 'Check effects: ' - description: string = 'Avoid potential reentrancy bugs' + name: string = `Check effects: ` + description: string = `Potential reentrancy bugs` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.HEURISTIC diff --git a/remix-analyzer/src/solidity-analyzer/modules/constantFunctions.ts b/remix-analyzer/src/solidity-analyzer/modules/constantFunctions.ts index ccc73d5ef1..f86d14d211 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/constantFunctions.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/constantFunctions.ts @@ -10,8 +10,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, ContractCal FunctionHLAst, VariableDeclarationAstNode, FunctionCallGraph, FunctionCallAstNode, VisitFunction, ReportFunction} from './../../types' export default class constantFunctions implements AnalyzerModule { - name: string = 'Constant functions: ' - description: string = 'Check for potentially constant functions' + name: string = `Constant/View/Pure functions: ` + description: string = `Potentially constant/view/pure functions` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.HEURISTIC @@ -63,7 +63,7 @@ export default class constantFunctions implements AnalyzerModule { comments += (multipleContractsWithSameName) ? 'Note: Import aliases are currently not supported by this static analysis.' : '' if (func['potentiallyshouldBeConst']) { warnings.push({ - warning: `${funcName} : Potentially should be constant but is not. ${comments}`, + warning: `${funcName} : Potentially should be constant/view/pure but is not. ${comments}`, location: func.node['src'], more: 'http://solidity.readthedocs.io/en/develop/contracts.html#constant-functions' }) diff --git a/remix-analyzer/src/solidity-analyzer/modules/deleteDynamicArrays.ts b/remix-analyzer/src/solidity-analyzer/modules/deleteDynamicArrays.ts index 3463c0eee4..1e728a5444 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/deleteDynamicArrays.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/deleteDynamicArrays.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class deleteDynamicArrays implements AnalyzerModule { rel: UnaryOperationAstNode[] = [] - name: string = 'Delete on dynamic Array: ' - description: string = 'Use require and appropriately' + name: string = `Delete on dynamic array: ` + description: string = `Use require/assert appropriately` category: ModuleCategory = category.GAS algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/deleteFromDynamicArray.ts b/remix-analyzer/src/solidity-analyzer/modules/deleteFromDynamicArray.ts index ab6cd268c0..37d12c4263 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/deleteFromDynamicArray.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/deleteFromDynamicArray.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class deleteFromDynamicArray implements AnalyzerModule { relevantNodes: UnaryOperationAstNode[] = [] - name: string = 'Delete from dynamic Array: ' - description: string = 'Using delete on an array leaves a gap' + name: string = `Delete from dynamic array: ` + description: string = `'delete' on an array leaves a gap` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/erc20Decimals.ts b/remix-analyzer/src/solidity-analyzer/modules/erc20Decimals.ts index 0770f621f6..c89b5f2d3f 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/erc20Decimals.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/erc20Decimals.ts @@ -6,8 +6,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, VisitFuncti FunctionHLAst, VariableDeclarationAstNode} from './../../types' export default class erc20Decimals implements AnalyzerModule { - name: string = 'ERC20: ' - description: string = 'Decimal should be uint8' + name: string = `ERC20: ` + description: string = `'decimals' should be 'uint8'` category: ModuleCategory = category.ERC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/etherTransferInLoop.ts b/remix-analyzer/src/solidity-analyzer/modules/etherTransferInLoop.ts index 96151d3ece..6c1abaf698 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/etherTransferInLoop.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/etherTransferInLoop.ts @@ -6,8 +6,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class etherTransferInLoop implements AnalyzerModule { relevantNodes: ExpressionStatementAstNode[] = [] - name: string = 'Ether transfer in a loop: ' - description: string = 'Avoid transferring Ether to multiple addresses in a loop' + name: string = `Ether transfer in loop: ` + description: string = `Transferring Ether in a for/while/do-while loop` category: ModuleCategory = category.GAS algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/forLoopIteratesOverDynamicArray.ts b/remix-analyzer/src/solidity-analyzer/modules/forLoopIteratesOverDynamicArray.ts index d5417aac06..497c713755 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/forLoopIteratesOverDynamicArray.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/forLoopIteratesOverDynamicArray.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class forLoopIteratesOverDynamicArray implements AnalyzerModule { relevantNodes: ForStatementAstNode[] = [] - name: string = 'For loop iterates over dynamic array: ' - description: string = 'The number of \'for\' loop iterations depends on dynamic array\'s size' + name: string = `For loop over dynamic array: ` + description: string = `Iterations depend on dynamic array's size` category: ModuleCategory = category.GAS algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts b/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts index 52ccc0d112..359f406453 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts @@ -10,8 +10,8 @@ interface VisitedContract { } export default class gasCosts implements AnalyzerModule { - name: string = 'Gas costs: ' - description: string = 'Warn if the gas requirements of functions are too high.' + name: string = `Gas costs: ` + description: string = `Too high gas requirement of functions` category: ModuleCategory = category.GAS algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/guardConditions.ts b/remix-analyzer/src/solidity-analyzer/modules/guardConditions.ts index abf75e13c2..2551835ae1 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/guardConditions.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/guardConditions.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class guardConditions implements AnalyzerModule { guards: FunctionCallAstNode[] = [] - name: string = 'Guard Conditions: ' - description: string = 'Use require and appropriately' + name: string = `Guard conditions: ` + description: string = `Use 'require' and 'assert' appropriately` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/inlineAssembly.ts b/remix-analyzer/src/solidity-analyzer/modules/inlineAssembly.ts index 592d29192f..36aea9bf37 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/inlineAssembly.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/inlineAssembly.ts @@ -4,8 +4,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class inlineAssembly implements AnalyzerModule { inlineAssNodes: InlineAssemblyAstNode[] = [] - name: string = 'Inline assembly: ' - description: string = 'Use of Inline Assembly' + name: string = `Inline assembly: ` + description: string = `Inline assembly used` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/intDivisionTruncate.ts b/remix-analyzer/src/solidity-analyzer/modules/intDivisionTruncate.ts index 108c81e480..e211d565ff 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/intDivisionTruncate.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/intDivisionTruncate.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class intDivisionTruncate implements AnalyzerModule { warningNodes: BinaryOperationAstNode[] = [] - name: string = 'Data Truncated: ' - description: string = 'Division on int/uint values truncates the result.' + name: string = `Data Truncated: ` + description: string = `Division on int/uint values truncates the result` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/list.ts b/remix-analyzer/src/solidity-analyzer/modules/list.ts index 722c40c560..a6687343be 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/list.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/list.ts @@ -17,12 +17,15 @@ import erc20Decimals from './erc20Decimals' import stringBytesLength from './stringBytesLength' import deleteFromDynamicArray from './deleteFromDynamicArray' import forLoopIteratesOverDynamicArray from './forLoopIteratesOverDynamicArray' +import etherTransferInLoop from './etherTransferInLoop' +import intDivisionTruncate from './intDivisionTruncate' export default [ txOrigin, gasCosts, thisLocal, checksEffectsInteraction, + erc20Decimals, constantFunctions, similarVariableNames, inlineAssembly, @@ -34,8 +37,9 @@ export default [ guardConditions, deleteDynamicArrays, assignAndCompare, - erc20Decimals, stringBytesLength, deleteFromDynamicArray, - forLoopIteratesOverDynamicArray + forLoopIteratesOverDynamicArray, + etherTransferInLoop, + intDivisionTruncate ] diff --git a/remix-analyzer/src/solidity-analyzer/modules/lowLevelCalls.ts b/remix-analyzer/src/solidity-analyzer/modules/lowLevelCalls.ts index ada0c9683f..0d7d362774 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/lowLevelCalls.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/lowLevelCalls.ts @@ -10,8 +10,8 @@ interface llcNode { export default class lowLevelCalls implements AnalyzerModule { llcNodes: llcNode[] = [] - name: string = 'Low level calls: ' - description: string = 'Semantics maybe unclear' + name: string = `Low level calls: ` + description: string = `Semantics maybe unclear` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/noReturn.ts b/remix-analyzer/src/solidity-analyzer/modules/noReturn.ts index d195dee41d..de504c83a5 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/noReturn.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/noReturn.ts @@ -6,8 +6,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, ContractHLA VisitFunction, ReportFunction, ReturnAstNode, AssignmentAstNode} from './../../types' export default class noReturn implements AnalyzerModule { - name: string = 'no return: ' - description: string = 'Function with return type is not returning' + name: string = `No return: ` + description: string = `Function with 'returns' not returning` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts b/remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts index a669b4ccaa..d623791e41 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts @@ -5,8 +5,8 @@ import AbstractAst from './abstractAstView' import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, ContractHLAst, VisitFunction, ReportFunction} from './../../types' export default class selfdestruct implements AnalyzerModule { - name: string = 'Selfdestruct: ' - description: string = 'Be aware of caller contracts.' + name: string = `Selfdestruct: ` + description: string = `Beware of caller contracts` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.HEURISTIC diff --git a/remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.ts b/remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.ts index ff163564f5..d90edebf83 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.ts @@ -13,8 +13,8 @@ interface SimilarRecord { } export default class similarVariableNames implements AnalyzerModule { - name: string = 'Similar variable names: ' - description: string = 'Check if variable names are too similar' + name: string = `Similar variable names: ` + description: string = `Variable names are too similar` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/stringBytesLength.ts b/remix-analyzer/src/solidity-analyzer/modules/stringBytesLength.ts index 34988bd858..52cce693d1 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/stringBytesLength.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/stringBytesLength.ts @@ -4,8 +4,8 @@ import { isStringToBytesConversion, isBytesLengthCheck } from './staticAnalysisC import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, CompilationResult, MemberAccessAstNode, FunctionCallAstNode} from './../../types' export default class stringBytesLength implements AnalyzerModule { - name: string = 'String Length: ' - description: string = 'Bytes length != String length' + name: string = `String length: ` + description: string = `Bytes length != String length` category: ModuleCategory = category.MISC algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts b/remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts index 7b2d8d9ad4..46468b726c 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class thisLocal implements AnalyzerModule { warningNodes: MemberAccessAstNode[] = [] - name: string = 'This on local calls: ' - description: string = 'Invocation of local functions via this' + name: string = `This on local calls: ` + description: string = `Invocation of local functions via 'this'` category: ModuleCategory = category.GAS algorithm: ModuleAlgorithm = algorithm.EXACT diff --git a/remix-analyzer/src/solidity-analyzer/modules/txOrigin.ts b/remix-analyzer/src/solidity-analyzer/modules/txOrigin.ts index c98f46ddd1..99bd627eba 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/txOrigin.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/txOrigin.ts @@ -5,8 +5,8 @@ import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, Compilation export default class txOrigin implements AnalyzerModule { txOriginNodes: MemberAccessAstNode[] = [] - name: string = 'Transaction origin: ' - description: string = 'Warn if tx.origin is used' + name: string = `Transaction origin: ` + description: string = `'tx.origin' is used` category: ModuleCategory = category.SECURITY algorithm: ModuleAlgorithm = algorithm.EXACT