Merge pull request #1458 from ethereum/analysis-module-desc

analysis modules data updated
pull/5370/head
yann300 5 years ago committed by GitHub
commit 6928bf2ad4
  1. 4
      remix-analyzer/src/solidity-analyzer/modules/assignAndCompare.ts
  2. 4
      remix-analyzer/src/solidity-analyzer/modules/blockBlockhash.ts
  3. 4
      remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts
  4. 4
      remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.ts
  5. 6
      remix-analyzer/src/solidity-analyzer/modules/constantFunctions.ts
  6. 4
      remix-analyzer/src/solidity-analyzer/modules/deleteDynamicArrays.ts
  7. 4
      remix-analyzer/src/solidity-analyzer/modules/deleteFromDynamicArray.ts
  8. 4
      remix-analyzer/src/solidity-analyzer/modules/erc20Decimals.ts
  9. 4
      remix-analyzer/src/solidity-analyzer/modules/etherTransferInLoop.ts
  10. 4
      remix-analyzer/src/solidity-analyzer/modules/forLoopIteratesOverDynamicArray.ts
  11. 4
      remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts
  12. 4
      remix-analyzer/src/solidity-analyzer/modules/guardConditions.ts
  13. 4
      remix-analyzer/src/solidity-analyzer/modules/inlineAssembly.ts
  14. 4
      remix-analyzer/src/solidity-analyzer/modules/intDivisionTruncate.ts
  15. 8
      remix-analyzer/src/solidity-analyzer/modules/list.ts
  16. 4
      remix-analyzer/src/solidity-analyzer/modules/lowLevelCalls.ts
  17. 4
      remix-analyzer/src/solidity-analyzer/modules/noReturn.ts
  18. 4
      remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts
  19. 4
      remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.ts
  20. 4
      remix-analyzer/src/solidity-analyzer/modules/stringBytesLength.ts
  21. 4
      remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts
  22. 4
      remix-analyzer/src/solidity-analyzer/modules/txOrigin.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

@ -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

@ -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

@ -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

@ -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'
})

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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
]

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save