Example #1
0
 def test_int_ovf(self):
     mevm = ManticoreEVM()
     mevm.register_detector(IntegerOverflow())
     filename = os.path.join(THIS_DIR, 'binaries/int_overflow.sol')
     mevm.multi_tx_analysis(filename)
     self.assertEqual(len(mevm.global_findings), 3)
     all_findings = ''.join(map(lambda x: x[2], mevm.global_findings))
     self.assertIn('underflow at SUB', all_findings)
     self.assertIn('overflow at ADD', all_findings)
     self.assertIn('overflow at MUL', all_findings)
Example #2
0
 def setUp(self):
     self.io = IntegerOverflow()
     self.state = self.make_mock_evm_state()