From a2a2354155335ed9e70e66c0819e8739e7afc2ed Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Mon, 6 Jul 2020 13:45:50 +0200 Subject: [PATCH] vm -> tangerineWhistle: added spuriousDragon HF separation switch for account creation and CREATE nonce increment (EIP-161) --- packages/vm/lib/evm/evm.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vm/lib/evm/evm.ts b/packages/vm/lib/evm/evm.ts index 88acdae009..52df32be56 100644 --- a/packages/vm/lib/evm/evm.ts +++ b/packages/vm/lib/evm/evm.ts @@ -221,7 +221,10 @@ export default class EVM { await this._vm._emit('newContract', newContractEvent) toAccount = await this._state.getAccount(message.to) - toAccount.nonce = new BN(toAccount.nonce).addn(1).toArrayLike(Buffer) + // EIP-161 on account creation and CREATE execution + if (this._vm._common.gteHardfork('spuriousDragon')) { + toAccount.nonce = new BN(toAccount.nonce).addn(1).toArrayLike(Buffer) + } // Add tx value to the `to` account let errorMessage