Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit NonceSubmitted when a nonce is canceled #219

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/quark-core/src/QuarkNonceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ contract QuarkNonceManager {
error InvalidSubmissionToken(address wallet, bytes32 nonce, bytes32 submissionToken);

event NonceSubmitted(address wallet, bytes32 nonce, bytes32 submissionToken);
event NonceCanceled(address wallet, bytes32 nonce);

/// @notice Represents the unclaimed bytes32 value.
bytes32 public constant FREE = QuarkNonceManagerMetadata.FREE;
Expand All @@ -39,7 +38,7 @@ contract QuarkNonceManager {
*/
function cancel(bytes32 nonce) external {
submissions[msg.sender][nonce] = EXHAUSTED;
emit NonceCanceled(msg.sender, nonce);
emit NonceSubmitted(msg.sender, nonce, EXHAUSTED);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/quark-core/QuarkWallet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ contract QuarkWalletTest is Test {
new SignatureHelper().signOp(alicePrivateKey, aliceWallet, cancelOp);
vm.resumeGasMetering();
vm.expectEmit(true, true, true, true);
emit QuarkNonceManager.NonceCanceled(address(aliceWallet), op.nonce);
emit QuarkNonceManager.NonceSubmitted(address(aliceWallet), op.nonce, bytes32(type(uint256).max));
aliceWallet.executeQuarkOperationWithSubmissionToken(cancelOp, submissionTokens[1], cancelV, cancelR, cancelS);

// and now you can no longer replay
Expand Down
Loading