Skip to content

Commit

Permalink
Merge pull request #599 from eosnetworkfoundation/yarkin/merge_releas…
Browse files Browse the repository at this point in the history
…e_fix_trace

[0.5->main]Handle transfers from reserved address in the same way as other places
  • Loading branch information
yarkinwho authored Jun 19, 2023
2 parents 280a590 + 61f5b70 commit a2887da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions silkrpc/core/evm_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ boost::asio::awaitable<ExecutionResult> EVMExecutor<WorldState, VM>::call(
assert(txn.from.has_value());
state_.access_account(*txn.from);

if(silkworm::is_reserved_address(*txn.from)) {
//must mirror contract's initial state of reserved address
state_.set_balance(*txn.from, txn.value + intx::uint256(txn.gas_limit) * txn.max_fee_per_gas);
state_.set_nonce(*txn.from, txn.nonce);
}

const evmc_revision rev{evm.revision()};
const intx::uint256 base_fee_per_gas{evm.block().header.base_fee_per_gas.value_or(0)};
const intx::uint128 g0{silkworm::intrinsic_gas(txn, rev >= EVMC_HOMESTEAD, rev >= EVMC_ISTANBUL)};
Expand Down

0 comments on commit a2887da

Please sign in to comment.