Skip to content

Commit

Permalink
Implement EIP-2929 for SELFDESTRUCT
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored and chfast committed Apr 7, 2021
1 parent 26f925b commit c53634e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/evmone/instructions.hpp
Expand Up @@ -725,6 +725,12 @@ inline evmc_status_code selfdestruct(ExecutionState& state) noexcept

const auto beneficiary = intx::be::trunc<evmc::address>(state.stack[0]);

if (state.rev >= EVMC_BERLIN && state.host.access_account(beneficiary) == EVMC_ACCESS_COLD)
{
if ((state.gas_left -= instr::cold_account_access_cost) < 0)
return EVMC_OUT_OF_GAS;
}

if (state.rev >= EVMC_TANGERINE_WHISTLE)
{
if (state.rev == EVMC_TANGERINE_WHISTLE || state.host.get_balance(state.msg->destination))
Expand Down

0 comments on commit c53634e

Please sign in to comment.