mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
add chainid and selfbalance to lllc
This commit is contained in:
@@ -299,6 +299,8 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_functional)
|
||||
"(NUMBER)",
|
||||
"(DIFFICULTY)",
|
||||
"(GASLIMIT)",
|
||||
"(CHAINID)",
|
||||
"(SELFBALANCE)",
|
||||
"(POP 0)",
|
||||
"(MLOAD 0)",
|
||||
"(MSTORE 0 0)",
|
||||
|
||||
@@ -180,6 +180,8 @@ u256 EVMInstructionInterpreter::eval(
|
||||
return m_state.address;
|
||||
case Instruction::BALANCE:
|
||||
return m_state.balance;
|
||||
case Instruction::SELFBALANCE:
|
||||
return m_state.selfbalance;
|
||||
case Instruction::ORIGIN:
|
||||
return m_state.origin;
|
||||
case Instruction::CALLER:
|
||||
@@ -208,6 +210,8 @@ u256 EVMInstructionInterpreter::eval(
|
||||
return 0;
|
||||
case Instruction::GASPRICE:
|
||||
return m_state.gasprice;
|
||||
case Instruction::CHAINID:
|
||||
return m_state.chainid;
|
||||
case Instruction::EXTCODESIZE:
|
||||
return u256(keccak256(h256(arg[0]))) & 0xffffff;
|
||||
case Instruction::EXTCODEHASH:
|
||||
|
||||
@@ -70,6 +70,7 @@ struct InterpreterState
|
||||
std::map<dev::h256, dev::h256> storage;
|
||||
dev::u160 address = 0x11111111;
|
||||
dev::u256 balance = 0x22222222;
|
||||
dev::u256 selfbalance = 0x22223333;
|
||||
dev::u160 origin = 0x33333333;
|
||||
dev::u160 caller = 0x44444444;
|
||||
dev::u256 callvalue = 0x55555555;
|
||||
@@ -81,6 +82,7 @@ struct InterpreterState
|
||||
dev::u256 blockNumber = 1024;
|
||||
dev::u256 difficulty = 0x9999999;
|
||||
dev::u256 gaslimit = 4000000;
|
||||
dev::u256 chainid = 0x01;
|
||||
/// Log of changes / effects. Sholud be structured data in the future.
|
||||
std::vector<std::string> trace;
|
||||
/// This is actually an input parameter that more or less limits the runtime.
|
||||
|
||||
Reference in New Issue
Block a user