Yul interpreter: Return selfbalance constant for the expression

balance(address()) and balance constant otherwise.
This commit is contained in:
Bhargava Shastry
2020-06-30 16:59:13 +02:00
parent 76943023bd
commit d0ea1f97fd
2 changed files with 20 additions and 1 deletions
@@ -182,7 +182,10 @@ u256 EVMInstructionInterpreter::eval(
case Instruction::ADDRESS:
return m_state.address;
case Instruction::BALANCE:
return m_state.balance;
if (arg[0] == m_state.address)
return m_state.selfbalance;
else
return m_state.balance;
case Instruction::SELFBALANCE:
return m_state.selfbalance;
case Instruction::ORIGIN: