diff --git a/tests/arbitrary_send.arbitrary-send.json b/tests/arbitrary_send.arbitrary-send.json new file mode 100644 index 000000000..9a1da6ca1 --- /dev/null +++ b/tests/arbitrary_send.arbitrary-send.json @@ -0,0 +1,26 @@ +[ + { + "vuln": "SuicidalFunc", + "sourceMapping": [ + null + ], + "filename": "tests/arbitrary_send.sol", + "contract": "Test", + "func": "direct", + "calls": [ + "msg.sender.send(this.balance)" + ] + }, + { + "vuln": "SuicidalFunc", + "sourceMapping": [ + null + ], + "filename": "tests/arbitrary_send.sol", + "contract": "Test", + "func": "indirect", + "calls": [ + "destination.send(this.balance)" + ] + } +] diff --git a/tests/backdoor.backdoor.json b/tests/backdoor.backdoor.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/backdoor.backdoor.json @@ -0,0 +1 @@ +[] diff --git a/tests/backdoor.suicidal.json b/tests/backdoor.suicidal.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/backdoor.suicidal.json @@ -0,0 +1 @@ +[] diff --git a/tests/const_state_variables.constable-states.json b/tests/const_state_variables.constable-states.json new file mode 100644 index 000000000..a02aa98bb --- /dev/null +++ b/tests/const_state_variables.constable-states.json @@ -0,0 +1,64 @@ +[ + { + "vuln": "ConstStateVariableCandidates", + "sourceMapping": [ + { + "start": 130, + "length": 76, + "filename": "tests/const_state_variables.sol" + }, + { + "start": 235, + "length": 20, + "filename": "tests/const_state_variables.sol" + }, + { + "start": 331, + "length": 20, + "filename": "tests/const_state_variables.sol" + }, + { + "start": 494, + "length": 76, + "filename": "tests/const_state_variables.sol" + } + ], + "filename": "tests/const_state_variables.sol", + "contract": "B", + "unusedVars": [ + "myFriendsAddress", + "test", + "text2" + ] + }, + { + "vuln": "ConstStateVariableCandidates", + "sourceMapping": [ + { + "start": 130, + "length": 76, + "filename": "tests/const_state_variables.sol" + }, + { + "start": 235, + "length": 20, + "filename": "tests/const_state_variables.sol" + }, + { + "start": 331, + "length": 20, + "filename": "tests/const_state_variables.sol" + }, + { + "start": 494, + "length": 76, + "filename": "tests/const_state_variables.sol" + } + ], + "filename": "tests/const_state_variables.sol", + "contract": "B", + "unusedVars": [ + "mySistersAddress" + ] + } +] diff --git a/tests/external_function.external-function.json b/tests/external_function.external-function.json new file mode 100644 index 000000000..829c6e800 --- /dev/null +++ b/tests/external_function.external-function.json @@ -0,0 +1,46 @@ +[ + { + "vuln": "ExternalFunc", + "sourceMapping": { + "start": 257, + "length": 41, + "filename": "tests/external_function.sol" + }, + "filename": "tests/external_function.sol", + "contract": "ContractWithFunctionNotCalled", + "func": "funcNotCalled3" + }, + { + "vuln": "ExternalFunc", + "sourceMapping": { + "start": 304, + "length": 41, + "filename": "tests/external_function.sol" + }, + "filename": "tests/external_function.sol", + "contract": "ContractWithFunctionNotCalled", + "func": "funcNotCalled2" + }, + { + "vuln": "ExternalFunc", + "sourceMapping": { + "start": 351, + "length": 40, + "filename": "tests/external_function.sol" + }, + "filename": "tests/external_function.sol", + "contract": "ContractWithFunctionNotCalled", + "func": "funcNotCalled" + }, + { + "vuln": "ExternalFunc", + "sourceMapping": { + "start": 552, + "length": 304, + "filename": "tests/external_function.sol" + }, + "filename": "tests/external_function.sol", + "contract": "ContractWithFunctionNotCalled2", + "func": "funcNotCalled" + } +] diff --git a/tests/inline_assembly_contract.assembly.json b/tests/inline_assembly_contract.assembly.json new file mode 100644 index 000000000..0333b2f0a --- /dev/null +++ b/tests/inline_assembly_contract.assembly.json @@ -0,0 +1,11 @@ +[ + { + "vuln": "Assembly", + "sourceMapping": [ + null + ], + "filename": "tests/inline_assembly_contract.sol", + "contract": "GetCode", + "function_name": "at" + } +] diff --git a/tests/inline_assembly_library.assembly.json b/tests/inline_assembly_library.assembly.json new file mode 100644 index 000000000..62bbf9fae --- /dev/null +++ b/tests/inline_assembly_library.assembly.json @@ -0,0 +1,20 @@ +[ + { + "vuln": "Assembly", + "sourceMapping": [ + null + ], + "filename": "tests/inline_assembly_library.sol", + "contract": "VectorSum", + "function_name": "sumAsm" + }, + { + "vuln": "Assembly", + "sourceMapping": [ + null + ], + "filename": "tests/inline_assembly_library.sol", + "contract": "VectorSum", + "function_name": "sumPureAsm" + } +] diff --git a/tests/locked_ether.locked-ether.json b/tests/locked_ether.locked-ether.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/locked_ether.locked-ether.json @@ -0,0 +1 @@ +[] diff --git a/tests/low_level_calls.low-level-calls.json b/tests/low_level_calls.low-level-calls.json new file mode 100644 index 000000000..7f30bf684 --- /dev/null +++ b/tests/low_level_calls.low-level-calls.json @@ -0,0 +1,11 @@ +[ + { + "vuln": "Low level call", + "sourceMapping": [ + null + ], + "filename": "tests/low_level_calls.sol", + "contract": "Sender", + "function_name": "send" + } +] diff --git a/tests/naming_convention.naming-convention.json b/tests/naming_convention.naming-convention.json new file mode 100644 index 000000000..2410e66f3 --- /dev/null +++ b/tests/naming_convention.naming-convention.json @@ -0,0 +1,131 @@ +[ + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "sourceMapping": { + "start": 26, + "length": 598, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "struct": "test", + "sourceMapping": { + "start": 227, + "length": 20, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "event": "event_", + "sourceMapping": null + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "function": "GetOne", + "sourceMapping": { + "start": 405, + "length": 71, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "function": "setInt", + "argument": "Number2", + "sourceMapping": { + "start": 512, + "length": 12, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "constant": "MY_other_CONSTANT", + "sourceMapping": { + "start": 141, + "length": 35, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "variable": "Var_One", + "sourceMapping": { + "start": 183, + "length": 16, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "enum": "numbers", + "sourceMapping": { + "start": 77, + "length": 23, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "naming", + "modifier": "CantDo", + "sourceMapping": { + "start": 545, + "length": 36, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "T", + "function": "test", + "argument": "_used", + "sourceMapping": { + "start": 748, + "length": 10, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "T", + "variable": "_myPublicVar", + "sourceMapping": { + "start": 695, + "length": 17, + "filename": "tests/naming_convention.sol" + } + }, + { + "vuln": "NamingConvention", + "filename": "tests/naming_convention.sol", + "contract": "T", + "constant": "l", + "sourceMapping": { + "start": 847, + "length": 10, + "filename": "tests/naming_convention.sol" + } + } +] diff --git a/tests/old_solc.sol.json.solc-version.json b/tests/old_solc.sol.json.solc-version.json new file mode 100644 index 000000000..8c349b7c2 --- /dev/null +++ b/tests/old_solc.sol.json.solc-version.json @@ -0,0 +1,15 @@ +[ + { + "vuln": "OldPragma", + "pragma": [ + "0.4.21" + ], + "sourceMapping": [ + { + "start": 0, + "length": 23, + "filename": "old_solc.sol" + } + ] + } +] diff --git a/tests/pragma.0.4.24.pragma.json b/tests/pragma.0.4.24.pragma.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/pragma.0.4.24.pragma.json @@ -0,0 +1 @@ +[] diff --git a/tests/reentrancy.reentrancy.json b/tests/reentrancy.reentrancy.json new file mode 100644 index 000000000..d4163f6aa --- /dev/null +++ b/tests/reentrancy.reentrancy.json @@ -0,0 +1,26 @@ +[ + { + "vuln": "Reentrancy", + "sourceMapping": [ + { + "start": 52, + "length": 37, + "filename": "tests/reentrancy.sol" + }, + null, + null + ], + "filename": "tests/reentrancy.sol", + "contract": "Reentrancy", + "function_name": "withdrawBalance()", + "calls": [ + "! (msg.sender.call.value(userBalance[msg.sender])())" + ], + "send_eth": [ + "! (msg.sender.call.value(userBalance[msg.sender])())" + ], + "varsWritten": [ + "userBalance" + ] + } +] diff --git a/tests/tx_origin.tx-origin.json b/tests/tx_origin.tx-origin.json new file mode 100644 index 000000000..fcc426df0 --- /dev/null +++ b/tests/tx_origin.tx-origin.json @@ -0,0 +1,20 @@ +[ + { + "vuln": "TxOrigin", + "sourceMapping": [ + null + ], + "filename": "tests/tx_origin.sol", + "contract": "TxOrigin", + "function_name": "bug0" + }, + { + "vuln": "TxOrigin", + "sourceMapping": [ + null + ], + "filename": "tests/tx_origin.sol", + "contract": "TxOrigin", + "function_name": "bug2" + } +] diff --git a/tests/uninitialized.uninitialized-state.json b/tests/uninitialized.uninitialized-state.json new file mode 100644 index 000000000..856dac396 --- /dev/null +++ b/tests/uninitialized.uninitialized-state.json @@ -0,0 +1,86 @@ +[ + { + "vuln": "UninitializedStateVars", + "sourceMapping": [ + { + "start": 55, + "length": 19, + "filename": "tests/uninitialized.sol" + }, + { + "start": 81, + "length": 82, + "filename": "tests/uninitialized.sol" + } + ], + "filename": "tests/uninitialized.sol", + "contract": "Uninitialized", + "functions": [ + "transfer" + ], + "variable": "destination" + }, + { + "vuln": "UninitializedStateVars", + "sourceMapping": [ + { + "start": 189, + "length": 34, + "filename": "tests/uninitialized.sol" + }, + { + "start": 356, + "length": 143, + "filename": "tests/uninitialized.sol" + } + ], + "filename": "tests/uninitialized.sol", + "contract": "Test", + "functions": [ + "use" + ], + "variable": "balances" + }, + { + "vuln": "UninitializedStateVars", + "sourceMapping": [ + { + "start": 695, + "length": 15, + "filename": "tests/uninitialized.sol" + }, + { + "start": 875, + "length": 117, + "filename": "tests/uninitialized.sol" + } + ], + "filename": "tests/uninitialized.sol", + "contract": "Test2", + "functions": [ + "use" + ], + "variable": "st" + }, + { + "vuln": "UninitializedStateVars", + "sourceMapping": [ + { + "start": 748, + "length": 6, + "filename": "tests/uninitialized.sol" + }, + { + "start": 817, + "length": 52, + "filename": "tests/uninitialized.sol" + } + ], + "filename": "tests/uninitialized.sol", + "contract": "Test2", + "functions": [ + "init" + ], + "variable": "v" + } +] diff --git a/tests/uninitialized_storage_pointer.uninitialized-storage.json b/tests/uninitialized_storage_pointer.uninitialized-storage.json new file mode 100644 index 000000000..81fc04e74 --- /dev/null +++ b/tests/uninitialized_storage_pointer.uninitialized-storage.json @@ -0,0 +1,21 @@ +[ + { + "vuln": "UninitializedStorageVars", + "sourceMapping": [ + { + "start": 67, + "length": 138, + "filename": "tests/uninitialized_storage_pointer.sol" + }, + { + "start": 171, + "length": 9, + "filename": "tests/uninitialized_storage_pointer.sol" + } + ], + "filename": "tests/uninitialized_storage_pointer.sol", + "contract": "Uninitialized", + "function": "func", + "variable": "st_bug" + } +] diff --git a/tests/unused_state.unused-state.json b/tests/unused_state.unused-state.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tests/unused_state.unused-state.json @@ -0,0 +1 @@ +[]