Skip to content

Commit 543ccf5

Browse files
committed
Added the basefee instruction in YulInterpreter
1 parent 95091f6 commit 543ccf5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

test/tools/yulInterpreter/EVMInstructionInterpreter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ u256 EVMInstructionInterpreter::eval(
220220
return m_state.gasprice;
221221
case Instruction::CHAINID:
222222
return m_state.chainid;
223+
case Instruction::BASEFEE:
224+
return m_state.basefee;
223225
case Instruction::EXTCODESIZE:
224226
return u256(keccak256(h256(arg[0]))) & 0xffffff;
225227
case Instruction::EXTCODEHASH:

test/tools/yulInterpreter/Interpreter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ struct InterpreterState
9090
u256 difficulty = 0x9999999;
9191
u256 gaslimit = 4000000;
9292
u256 chainid = 0x01;
93+
/// The minimum value of basefee: 7 wei.
94+
u256 basefee = 0x07;
9395
/// Log of changes / effects. Sholud be structured data in the future.
9496
std::vector<std::string> trace;
9597
/// This is actually an input parameter that more or less limits the runtime.
@@ -227,4 +229,3 @@ class ExpressionEvaluator: public ASTWalker
227229
};
228230

229231
}
230-

0 commit comments

Comments
 (0)