From c5766a0c8ee4d8a972c3e4f409ef40fa3b17d46c Mon Sep 17 00:00:00 2001 From: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:42:42 -0300 Subject: [PATCH] Fix nonce not starting at 0 --- system-contracts/contracts/ContractDeployer.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-contracts/contracts/ContractDeployer.sol b/system-contracts/contracts/ContractDeployer.sol index 3e1f4b1a2..ba7a733de 100644 --- a/system-contracts/contracts/ContractDeployer.sol +++ b/system-contracts/contracts/ContractDeployer.sol @@ -187,7 +187,7 @@ contract ContractDeployer is IContractDeployer, ISystemContract { // Subtract 1 for EOA since the nonce has already been incremented for this transaction uint256 senderNonce = msg.sender == tx.origin ? NONCE_HOLDER_SYSTEM_CONTRACT.getMinNonce(msg.sender) - 1 - : NONCE_HOLDER_SYSTEM_CONTRACT.incrementDeploymentNonce(msg.sender); + : NONCE_HOLDER_SYSTEM_CONTRACT.incrementDeploymentNonce(msg.sender) + 1; address newAddress = Utils.getNewAddressCreateEVM(msg.sender, senderNonce); _evmDeployOnAddress(newAddress, _initCode); return newAddress;