Skip to content

Commit

Permalink
Merge pull request #608 from lambdaclass/nonce-address-fix
Browse files Browse the repository at this point in the history
[EVM Equivalence] Fix evm contract nonces starting at 0 instead of 1
  • Loading branch information
jrchatruc authored Jul 31, 2024
2 parents 3695b24 + c5425c6 commit 97a8c94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system-contracts/contracts/ContractDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 97a8c94

Please sign in to comment.