fix(forge): fix nonce for tx with 7702 auth by grandizzy · Pull Request #10464 · foundry-rs/foundry (original) (raw)
yeah, so when we sign the auth we artificially increment the nonce amd here is the part where we attach the sig generated with incremented nonce. Mind that the tx is not executed here, but on the next call which should use the current nonce, not the one incremented for the sig. We want to avoid setting higher nonce in auth list than tx itself as in #10461 (comment)
{
"hash": null,
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x8d726e3092e7f92234f8463e8bf3ddfde7d89341",
"function": "increment()",
"arguments": [],
"transaction": {
"from": "0x8d726e3092e7f92234f8463e8bf3ddfde7d89341",
"to": "0x8d726e3092e7f92234f8463e8bf3ddfde7d89341",
"gas": "0xf889",
"value": "0x0",
"input": "0xd09de08a",
"nonce": "0x2",
"chainId": "0x1",
"authorizationList": [
{
"chainId": "0x1",
"address": "0x00df3e91238eb91192d60e01e73d661be87d52a9",
"nonce": "0x1",
"yParity": "0x1",
"r": "0xbc9c8cc66abb2c8700cc262c65993b5bae43a8627c2365c5f61a2ab5d14510e3",
"s": "0x8484ef8a3bfce668299ee5443bc3e37a38e40013a3cbb60e90820be4a63e764"
}
]
},
"additionalContracts": [],
"isFixedGasLimit": false
}