|
|
@ -168,13 +168,19 @@ class IntegerOverflowUnderflowModule(DetectionModule): |
|
|
|
continue |
|
|
|
continue |
|
|
|
ostate = annotation.overflowing_state |
|
|
|
ostate = annotation.overflowing_state |
|
|
|
node = ostate.node |
|
|
|
node = ostate.node |
|
|
|
|
|
|
|
title = ( |
|
|
|
|
|
|
|
"Integer Underflow" |
|
|
|
|
|
|
|
if annotation.operator == "subtraction" |
|
|
|
|
|
|
|
else "Integer Overflow" |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
issue = Issue( |
|
|
|
issue = Issue( |
|
|
|
contract=node.contract_name, |
|
|
|
contract=node.contract_name, |
|
|
|
function_name=node.function_name, |
|
|
|
function_name=node.function_name, |
|
|
|
address=ostate.get_current_instruction()["address"], |
|
|
|
address=ostate.get_current_instruction()["address"], |
|
|
|
swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW, |
|
|
|
swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW, |
|
|
|
bytecode=ostate.environment.code.bytecode, |
|
|
|
bytecode=ostate.environment.code.bytecode, |
|
|
|
title="Integer Overflow", |
|
|
|
title=title, |
|
|
|
_type="Warning", |
|
|
|
_type="Warning", |
|
|
|
gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), |
|
|
|
gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), |
|
|
|
) |
|
|
|
) |
|
|
|