Skip to content

Commit 99632ed

Browse files
authored
Merge pull request #42 from flashbots/L-03-followup/cache-storage-variable-for-small-gas-improvement
cache nonce value in FlashtestationRegistry:invalidatePreviousSignatu…
2 parents 261e75e + 18fc01d commit 99632ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/FlashtestationRegistry.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ contract FlashtestationRegistry is
245245

246246
/// @inheritdoc IFlashtestationRegistry
247247
function invalidatePreviousSignature(uint256 _nonce) external override {
248-
require(_nonce == nonces[msg.sender], InvalidNonce(nonces[msg.sender], _nonce));
248+
uint256 nonce = nonces[msg.sender];
249+
require(_nonce == nonce, InvalidNonce(nonce, _nonce));
249250
nonces[msg.sender]++;
250-
emit PreviousSignatureInvalidated(msg.sender, _nonce);
251+
emit PreviousSignatureInvalidated(msg.sender, nonce);
251252
}
252253

253254
/// @inheritdoc IFlashtestationRegistry

0 commit comments

Comments
 (0)