Static Analyzer for Solidity
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
slither/tests/expected_json/incorrect_equality.incorrec...

1 lines
16 KiB

[{"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "ERC20TestBalance.bad0 (tests/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10)\n", "elements": [{"type": "function", "name": "bad0", "source_mapping": {"start": 404, "length": 101, "filename": "tests/incorrect_equality.sol", "lines": [21, 22, 23]}, "contract": {"type": "contract", "name": "ERC20TestBalance", "source_mapping": {"start": 165, "length": 445, "filename": "tests/incorrect_equality.sol", "lines": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]}}}, {"type": "expression", "expression": "require(bool)(erc.balanceOf(address(this)) == 10)", "source_mapping": {"start": 455, "length": 43, "filename": "tests/incorrect_equality.sol", "lines": [22]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "ERC20TestBalance.bad0 (tests/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10)\nERC20TestBalance.bad1 (tests/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10)\n", "elements": [{"type": "function", "name": "bad1", "source_mapping": {"start": 511, "length": 97, "filename": "tests/incorrect_equality.sol", "lines": [25, 26, 27]}, "contract": {"type": "contract", "name": "ERC20TestBalance", "source_mapping": {"start": 165, "length": 445, "filename": "tests/incorrect_equality.sol", "lines": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]}}}, {"type": "expression", "expression": "require(bool)(erc.balanceOf(msg.sender) == 10)", "source_mapping": {"start": 562, "length": 39, "filename": "tests/incorrect_equality.sol", "lines": [26]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\n", "elements": [{"type": "function", "name": "bad0", "source_mapping": {"start": 648, "length": 133, "filename": "tests/incorrect_equality.sol", "lines": [32, 33, 34, 35]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "require(bool)(address(address(this)).balance == 10000000000000000000)", "source_mapping": {"start": 683, "length": 51, "filename": "tests/incorrect_equality.sol", "lines": [33]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\nTestContractBalance.bad1 (tests/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance)\n", "elements": [{"type": "function", "name": "bad1", "source_mapping": {"start": 787, "length": 133, "filename": "tests/incorrect_equality.sol", "lines": [37, 38, 39, 40]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "require(bool)(10000000000000000000 == address(address(this)).balance)", "source_mapping": {"start": 822, "length": 51, "filename": "tests/incorrect_equality.sol", "lines": [38]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\nTestContractBalance.bad1 (tests/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance)\nTestContractBalance.bad2 (tests/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000)\n", "elements": [{"type": "function", "name": "bad2", "source_mapping": {"start": 926, "length": 124, "filename": "tests/incorrect_equality.sol", "lines": [42, 43, 44, 45]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "require(bool)(address(this).balance == 10000000000000000000)", "source_mapping": {"start": 961, "length": 42, "filename": "tests/incorrect_equality.sol", "lines": [43]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\nTestContractBalance.bad1 (tests/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance)\nTestContractBalance.bad2 (tests/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000)\nTestContractBalance.bad3 (tests/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance)\n", "elements": [{"type": "function", "name": "bad3", "source_mapping": {"start": 1056, "length": 124, "filename": "tests/incorrect_equality.sol", "lines": [47, 48, 49, 50]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "require(bool)(10000000000000000000 == address(this).balance)", "source_mapping": {"start": 1091, "length": 42, "filename": "tests/incorrect_equality.sol", "lines": [48]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\nTestContractBalance.bad1 (tests/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance)\nTestContractBalance.bad2 (tests/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000)\nTestContractBalance.bad3 (tests/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance)\nTestContractBalance.bad4 (tests/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000\n", "elements": [{"type": "function", "name": "bad4", "source_mapping": {"start": 1186, "length": 170, "filename": "tests/incorrect_equality.sol", "lines": [52, 53, 54, 55, 56, 57]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "balance == 10000000000000000000", "source_mapping": {"start": 1270, "length": 80, "filename": "tests/incorrect_equality.sol", "lines": [54, 55, 56]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\nTestContractBalance.bad1 (tests/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance)\nTestContractBalance.bad2 (tests/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000)\nTestContractBalance.bad3 (tests/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance)\nTestContractBalance.bad4 (tests/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000\nTestContractBalance.bad5 (tests/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance\n", "elements": [{"type": "function", "name": "bad5", "source_mapping": {"start": 1362, "length": 170, "filename": "tests/incorrect_equality.sol", "lines": [59, 60, 61, 62, 63, 64]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "10000000000000000000 == balance", "source_mapping": {"start": 1446, "length": 80, "filename": "tests/incorrect_equality.sol", "lines": [61, 62, 63]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestContractBalance.bad0 (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000)\nTestContractBalance.bad1 (tests/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance)\nTestContractBalance.bad2 (tests/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000)\nTestContractBalance.bad3 (tests/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance)\nTestContractBalance.bad4 (tests/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000\nTestContractBalance.bad5 (tests/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance\nTestContractBalance.bad6 (tests/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000\n", "elements": [{"type": "function", "name": "bad6", "source_mapping": {"start": 1538, "length": 179, "filename": "tests/incorrect_equality.sol", "lines": [66, 67, 68, 69, 70, 71]}, "contract": {"type": "contract", "name": "TestContractBalance", "source_mapping": {"start": 612, "length": 1754, "filename": "tests/incorrect_equality.sol", "lines": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97]}}}, {"type": "expression", "expression": "balance == 10000000000000000000", "source_mapping": {"start": 1631, "length": 80, "filename": "tests/incorrect_equality.sol", "lines": [68, 69, 70]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestSolidityKeyword.bad0 (tests/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0)\n", "elements": [{"type": "function", "name": "bad0", "source_mapping": {"start": 2935, "length": 59, "filename": "tests/incorrect_equality.sol", "lines": [123, 124, 125]}, "contract": {"type": "contract", "name": "TestSolidityKeyword", "source_mapping": {"start": 2368, "length": 774, "filename": "tests/incorrect_equality.sol", "lines": [99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135]}}}, {"type": "expression", "expression": "require(bool)(now == 0)", "source_mapping": {"start": 2969, "length": 18, "filename": "tests/incorrect_equality.sol", "lines": [124]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestSolidityKeyword.bad0 (tests/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0)\nTestSolidityKeyword.bad1 (tests/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0)\n", "elements": [{"type": "function", "name": "bad1", "source_mapping": {"start": 3000, "length": 66, "filename": "tests/incorrect_equality.sol", "lines": [127, 128, 129]}, "contract": {"type": "contract", "name": "TestSolidityKeyword", "source_mapping": {"start": 2368, "length": 774, "filename": "tests/incorrect_equality.sol", "lines": [99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135]}}}, {"type": "expression", "expression": "require(bool)(block.number == 0)", "source_mapping": {"start": 3034, "length": 25, "filename": "tests/incorrect_equality.sol", "lines": [128]}}]}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "description": "TestSolidityKeyword.bad0 (tests/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0)\nTestSolidityKeyword.bad1 (tests/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0)\nTestSolidityKeyword.bad2 (tests/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0)\n", "elements": [{"type": "function", "name": "bad2", "source_mapping": {"start": 3072, "length": 67, "filename": "tests/incorrect_equality.sol", "lines": [131, 132, 133]}, "contract": {"type": "contract", "name": "TestSolidityKeyword", "source_mapping": {"start": 2368, "length": 774, "filename": "tests/incorrect_equality.sol", "lines": [99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135]}}}, {"type": "expression", "expression": "require(bool)(block.number == 0)", "source_mapping": {"start": 3106, "length": 26, "filename": "tests/incorrect_equality.sol", "lines": [132]}}]}]