regenrate expected json for tests

pull/67/head
Alexander Remie 6 years ago
parent 4cb3a13eb1
commit d8c21daf45
  1. 24
      tests/expected_json/arbitrary_send.arbitrary-send.json
  2. 10
      tests/expected_json/backdoor.backdoor.json
  3. 14
      tests/expected_json/backdoor.suicidal.json
  4. 68
      tests/expected_json/const_state_variables.constable-states.json
  5. 56
      tests/expected_json/external_function.external-function.json
  6. 10
      tests/expected_json/inline_assembly_contract.assembly.json
  7. 20
      tests/expected_json/inline_assembly_library.assembly.json
  8. 12
      tests/expected_json/locked_ether.locked-ether.json
  9. 10
      tests/expected_json/low_level_calls.low-level-calls.json
  10. 166
      tests/expected_json/naming_convention.naming-convention.json
  11. 10
      tests/expected_json/old_solc.sol.json.solc-version.json
  12. 18
      tests/expected_json/pragma.0.4.24.pragma.json
  13. 24
      tests/expected_json/reentrancy.reentrancy.json
  14. 20
      tests/expected_json/tx_origin.tx-origin.json
  15. 88
      tests/expected_json/uninitialized.uninitialized-state.json
  16. 22
      tests/expected_json/uninitialized_storage_pointer.uninitialized-storage.json
  17. 14
      tests/expected_json/unused_state.unused-state.json

@ -2,25 +2,25 @@
{ {
"calls": [ "calls": [
"msg.sender.send(this.balance)" "msg.sender.send(this.balance)"
], ],
"contract": "Test", "contract": "Test",
"filename": "tests/arbitrary_send.sol", "filename": "tests/arbitrary_send.sol",
"func": "direct", "func": "direct",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "SuicidalFunc" "vuln": "SuicidalFunc"
}, },
{ {
"calls": [ "calls": [
"destination.send(this.balance)" "destination.send(this.balance)"
], ],
"contract": "Test", "contract": "Test",
"filename": "tests/arbitrary_send.sol", "filename": "tests/arbitrary_send.sol",
"func": "indirect", "func": "indirect",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "SuicidalFunc" "vuln": "SuicidalFunc"
} }
] ]

@ -1,11 +1,11 @@
[ [
{ {
"contract": "C", "contract": "C",
"sourceMapping": { "sourceMapping": {
"filename": "tests/backdoor.sol", "filename": "tests/backdoor.sol",
"length": 74, "length": 74,
"start": 42 "start": 42
}, },
"vuln": "backdoor" "vuln": "backdoor"
} }
] ]

@ -1,13 +1,13 @@
[ [
{ {
"contract": "C", "contract": "C",
"filename": "tests/backdoor.sol", "filename": "tests/backdoor.sol",
"func": "i_am_a_backdoor", "func": "i_am_a_backdoor",
"sourceMapping": { "sourceMapping": {
"filename": "tests/backdoor.sol", "filename": "tests/backdoor.sol",
"length": 74, "length": 74,
"start": 42 "start": 42
}, },
"vuln": "SuicidalFunc" "vuln": "SuicidalFunc"
} }
] ]

@ -1,64 +1,64 @@
[ [
{ {
"contract": "B", "contract": "B",
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 76, "length": 76,
"start": 130 "start": 130
}, },
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 20, "length": 20,
"start": 235 "start": 235
}, },
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 20, "length": 20,
"start": 331 "start": 331
}, },
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 76, "length": 76,
"start": 494 "start": 494
} }
], ],
"unusedVars": [ "unusedVars": [
"myFriendsAddress", "myFriendsAddress",
"test", "test",
"text2" "text2"
], ],
"vuln": "ConstStateVariableCandidates" "vuln": "ConstStateVariableCandidates"
}, },
{ {
"contract": "B", "contract": "B",
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 76, "length": 76,
"start": 130 "start": 130
}, },
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 20, "length": 20,
"start": 235 "start": 235
}, },
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 20, "length": 20,
"start": 331 "start": 331
}, },
{ {
"filename": "tests/const_state_variables.sol", "filename": "tests/const_state_variables.sol",
"length": 76, "length": 76,
"start": 494 "start": 494
} }
], ],
"unusedVars": [ "unusedVars": [
"mySistersAddress" "mySistersAddress"
], ],
"vuln": "ConstStateVariableCandidates" "vuln": "ConstStateVariableCandidates"
} }
] ]

@ -1,46 +1,46 @@
[ [
{ {
"contract": "ContractWithFunctionNotCalled", "contract": "ContractWithFunctionNotCalled",
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"func": "funcNotCalled", "func": "funcNotCalled",
"sourceMapping": { "sourceMapping": {
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"length": 40, "length": 40,
"start": 351 "start": 351
}, },
"vuln": "ExternalFunc" "vuln": "ExternalFunc"
}, },
{ {
"contract": "ContractWithFunctionNotCalled", "contract": "ContractWithFunctionNotCalled",
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"func": "funcNotCalled2", "func": "funcNotCalled2",
"sourceMapping": { "sourceMapping": {
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"length": 41, "length": 41,
"start": 304 "start": 304
}, },
"vuln": "ExternalFunc" "vuln": "ExternalFunc"
}, },
{ {
"contract": "ContractWithFunctionNotCalled", "contract": "ContractWithFunctionNotCalled",
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"func": "funcNotCalled3", "func": "funcNotCalled3",
"sourceMapping": { "sourceMapping": {
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"length": 41, "length": 41,
"start": 257 "start": 257
}, },
"vuln": "ExternalFunc" "vuln": "ExternalFunc"
}, },
{ {
"contract": "ContractWithFunctionNotCalled2", "contract": "ContractWithFunctionNotCalled2",
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"func": "funcNotCalled", "func": "funcNotCalled",
"sourceMapping": { "sourceMapping": {
"filename": "tests/external_function.sol", "filename": "tests/external_function.sol",
"length": 304, "length": 304,
"start": 552 "start": 552
}, },
"vuln": "ExternalFunc" "vuln": "ExternalFunc"
} }
] ]

@ -1,11 +1,11 @@
[ [
{ {
"contract": "GetCode", "contract": "GetCode",
"filename": "tests/inline_assembly_contract.sol", "filename": "tests/inline_assembly_contract.sol",
"function_name": "at", "function_name": "at",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "Assembly" "vuln": "Assembly"
} }
] ]

@ -1,20 +1,20 @@
[ [
{ {
"contract": "VectorSum", "contract": "VectorSum",
"filename": "tests/inline_assembly_library.sol", "filename": "tests/inline_assembly_library.sol",
"function_name": "sumAsm", "function_name": "sumAsm",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "Assembly" "vuln": "Assembly"
}, },
{ {
"contract": "VectorSum", "contract": "VectorSum",
"filename": "tests/inline_assembly_library.sol", "filename": "tests/inline_assembly_library.sol",
"function_name": "sumPureAsm", "function_name": "sumPureAsm",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "Assembly" "vuln": "Assembly"
} }
] ]

@ -1,16 +1,16 @@
[ [
{ {
"contract": "OnlyLocked", "contract": "OnlyLocked",
"functions_payable": [ "functions_payable": [
"receive" "receive"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/locked_ether.sol", "filename": "tests/locked_ether.sol",
"length": 72, "length": 72,
"start": 46 "start": 46
} }
], ],
"vuln": "LockedEther" "vuln": "LockedEther"
} }
] ]

@ -1,11 +1,11 @@
[ [
{ {
"contract": "Sender", "contract": "Sender",
"filename": "tests/low_level_calls.sol", "filename": "tests/low_level_calls.sol",
"function_name": "send", "function_name": "send",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "Low level call" "vuln": "Low level call"
} }
] ]

@ -1,131 +1,131 @@
[ [
{ {
"argument": "_used", "argument": "_used",
"contract": "T", "contract": "T",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"function": "test", "function": "test",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 10, "length": 10,
"start": 748 "start": 748
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "T", "contract": "T",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 17, "length": 17,
"start": 695 "start": 695
}, },
"variable": "_myPublicVar", "variable": "_myPublicVar",
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"constant": "l", "constant": "l",
"contract": "T", "contract": "T",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 10, "length": 10,
"start": 847 "start": 847
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 598, "length": 598,
"start": 26 "start": 26
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 20, "length": 20,
"start": 227 "start": 227
}, },
"struct": "test", "struct": "test",
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"event": "event_", "event": "event_",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": null, "sourceMapping": null,
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"function": "GetOne", "function": "GetOne",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 71, "length": 71,
"start": 405 "start": 405
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"argument": "Number2", "argument": "Number2",
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"function": "setInt", "function": "setInt",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 12, "length": 12,
"start": 512 "start": 512
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"constant": "MY_other_CONSTANT", "constant": "MY_other_CONSTANT",
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 35, "length": 35,
"start": 141 "start": 141
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 16, "length": 16,
"start": 183 "start": 183
}, },
"variable": "Var_One", "variable": "Var_One",
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"enum": "numbers", "enum": "numbers",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 23, "length": 23,
"start": 77 "start": 77
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
}, },
{ {
"contract": "naming", "contract": "naming",
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"modifier": "CantDo", "modifier": "CantDo",
"sourceMapping": { "sourceMapping": {
"filename": "tests/naming_convention.sol", "filename": "tests/naming_convention.sol",
"length": 36, "length": 36,
"start": 545 "start": 545
}, },
"vuln": "NamingConvention" "vuln": "NamingConvention"
} }
] ]

@ -2,14 +2,14 @@
{ {
"pragma": [ "pragma": [
"0.4.21" "0.4.21"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "old_solc.sol", "filename": "old_solc.sol",
"length": 23, "length": 23,
"start": 0 "start": 0
} }
], ],
"vuln": "OldPragma" "vuln": "OldPragma"
} }
] ]

@ -2,20 +2,20 @@
{ {
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/pragma.0.4.23.sol", "filename": "tests/pragma.0.4.23.sol",
"length": 24, "length": 24,
"start": 0 "start": 0
}, },
{ {
"filename": "tests/pragma.0.4.24.sol", "filename": "tests/pragma.0.4.24.sol",
"length": 23, "length": 23,
"start": 0 "start": 0
} }
], ],
"versions": [ "versions": [
"0.4.24", "0.4.24",
"^0.4.23" "^0.4.23"
], ],
"vuln": "ConstantPragma" "vuln": "ConstantPragma"
} }
] ]

@ -2,25 +2,25 @@
{ {
"calls": [ "calls": [
"! (msg.sender.call.value(userBalance[msg.sender])())" "! (msg.sender.call.value(userBalance[msg.sender])())"
], ],
"contract": "Reentrancy", "contract": "Reentrancy",
"filename": "tests/reentrancy.sol", "filename": "tests/reentrancy.sol",
"function_name": "withdrawBalance()", "function_name": "withdrawBalance()",
"send_eth": [ "send_eth": [
"! (msg.sender.call.value(userBalance[msg.sender])())" "! (msg.sender.call.value(userBalance[msg.sender])())"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/reentrancy.sol", "filename": "tests/reentrancy.sol",
"length": 37, "length": 37,
"start": 52 "start": 52
}, },
null, null,
null null
], ],
"varsWritten": [ "varsWritten": [
"userBalance" "userBalance"
], ],
"vuln": "Reentrancy" "vuln": "Reentrancy"
} }
] ]

@ -1,20 +1,20 @@
[ [
{ {
"contract": "TxOrigin", "contract": "TxOrigin",
"filename": "tests/tx_origin.sol", "filename": "tests/tx_origin.sol",
"function_name": "bug0", "function_name": "bug0",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "TxOrigin" "vuln": "TxOrigin"
}, },
{ {
"contract": "TxOrigin", "contract": "TxOrigin",
"filename": "tests/tx_origin.sol", "filename": "tests/tx_origin.sol",
"function_name": "bug2", "function_name": "bug2",
"sourceMapping": [ "sourceMapping": [
null null
], ],
"vuln": "TxOrigin" "vuln": "TxOrigin"
} }
] ]

@ -1,86 +1,86 @@
[ [
{ {
"contract": "Test", "contract": "Test",
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"functions": [ "functions": [
"use" "use"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 34, "length": 34,
"start": 189 "start": 189
}, },
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 143, "length": 143,
"start": 356 "start": 356
} }
], ],
"variable": "balances", "variable": "balances",
"vuln": "UninitializedStateVars" "vuln": "UninitializedStateVars"
}, },
{ {
"contract": "Test2", "contract": "Test2",
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"functions": [ "functions": [
"use" "use"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 15, "length": 15,
"start": 695 "start": 695
}, },
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 117, "length": 117,
"start": 875 "start": 875
} }
], ],
"variable": "st", "variable": "st",
"vuln": "UninitializedStateVars" "vuln": "UninitializedStateVars"
}, },
{ {
"contract": "Test2", "contract": "Test2",
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"functions": [ "functions": [
"init" "init"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 6, "length": 6,
"start": 748 "start": 748
}, },
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 52, "length": 52,
"start": 817 "start": 817
} }
], ],
"variable": "v", "variable": "v",
"vuln": "UninitializedStateVars" "vuln": "UninitializedStateVars"
}, },
{ {
"contract": "Uninitialized", "contract": "Uninitialized",
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"functions": [ "functions": [
"transfer" "transfer"
], ],
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 19, "length": 19,
"start": 55 "start": 55
}, },
{ {
"filename": "tests/uninitialized.sol", "filename": "tests/uninitialized.sol",
"length": 82, "length": 82,
"start": 81 "start": 81
} }
], ],
"variable": "destination", "variable": "destination",
"vuln": "UninitializedStateVars" "vuln": "UninitializedStateVars"
} }
] ]

@ -1,21 +1,21 @@
[ [
{ {
"contract": "Uninitialized", "contract": "Uninitialized",
"filename": "tests/uninitialized_storage_pointer.sol", "filename": "tests/uninitialized_storage_pointer.sol",
"function": "func", "function": "func",
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/uninitialized_storage_pointer.sol", "filename": "tests/uninitialized_storage_pointer.sol",
"length": 138, "length": 138,
"start": 67 "start": 67
}, },
{ {
"filename": "tests/uninitialized_storage_pointer.sol", "filename": "tests/uninitialized_storage_pointer.sol",
"length": 9, "length": 9,
"start": 171 "start": 171
} }
], ],
"variable": "st_bug", "variable": "st_bug",
"vuln": "UninitializedStorageVars" "vuln": "UninitializedStorageVars"
} }
] ]

@ -1,17 +1,17 @@
[ [
{ {
"contract": "B", "contract": "B",
"filename": "tests/unused_state.sol", "filename": "tests/unused_state.sol",
"sourceMapping": [ "sourceMapping": [
{ {
"filename": "tests/unused_state.sol", "filename": "tests/unused_state.sol",
"length": 14, "length": 14,
"start": 41 "start": 41
} }
], ],
"unusedVars": [ "unusedVars": [
"unused" "unused"
], ],
"vuln": "unusedStateVars" "vuln": "unusedStateVars"
} }
] ]
Loading…
Cancel
Save