Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/state/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ evmc::Result Host::create(const evmc_message& msg) noexcept
if (m_rev >= EVMC_SPURIOUS_DRAGON && code.size() > MAX_CODE_SIZE)
return evmc::Result{EVMC_FAILURE};

// Reject new contract code starting with the 0xEF byte (EIP-3541).
if (m_rev >= EVMC_LONDON && code.starts_with(0xEF))
return evmc::Result{EVMC_CONTRACT_VALIDATION_FAILURE};
Comment on lines +305 to +307

// Code deployment cost.
const auto cost = std::ssize(code) * 200;
gas_left -= cost;
Expand All @@ -314,10 +318,6 @@ evmc::Result Host::create(const evmc_message& msg) noexcept

if (!code.empty())
{
// EIP-3541: Reject new contract code starting with the 0xEF byte.
if (m_rev >= EVMC_LONDON && code[0] == 0xEF)
return evmc::Result{EVMC_CONTRACT_VALIDATION_FAILURE};

new_acc->code_hash = keccak256(code);
new_acc->code = code;
new_acc->code_changed = true;
Expand Down