Skip to content

Commit

Permalink
gas
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds committed Nov 9, 2022
1 parent 6440231 commit d865412
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 6 additions & 5 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ CompactSignature:testCompactSignature27() (gas: 253)
CompactSignature:testCompactSignature28() (gas: 141)
EIP712Test:testDomainSeparator() (gas: 5759)
EIP712Test:testDomainSeparatorAfterFork() (gas: 10652)
NonceBitmapTest:testHighNonces() (gas: 35958)
NonceBitmapTest:testHighNonces() (gas: 35980)
NonceBitmapTest:testInvalidateFullWord() (gas: 62805)
NonceBitmapTest:testInvalidateNonzeroWord() (gas: 85285)
NonceBitmapTest:testLowNonces() (gas: 40671)
NonceBitmapTest:testNonceWordBoundary() (gas: 42042)
NonceBitmapTest:testUseTwoRandomNonces(uint256,uint256) (runs: 256, μ: 48832, ~: 51523)
NonceBitmapTest:testUsingNonceTwiceFails(uint256) (runs: 256, μ: 21775, ~: 21798)
NonceBitmapTest:testLowNonces() (gas: 40693)
NonceBitmapTest:testNonceLLL() (gas: 21789)
NonceBitmapTest:testNonceWordBoundary() (gas: 42060)
NonceBitmapTest:testUseTwoRandomNonces(uint256,uint256) (runs: 256, μ: 48918, ~: 51523)
NonceBitmapTest:testUsingNonceTwiceFails(uint256) (runs: 256, μ: 21793, ~: 21816)
Permit2LibTest:testOZSafePermit() (gas: 24311)
Permit2LibTest:testOZSafePermitPlusOZSafeTransferFrom() (gas: 129066)
Permit2LibTest:testOZSafeTransferFrom() (gas: 38787)
Expand Down
4 changes: 0 additions & 4 deletions src/SignatureTransfer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import {SignatureVerification} from "./libraries/SignatureVerification.sol";
import {PermitHash} from "./libraries/PermitHash.sol";
import {EIP712} from "./EIP712.sol";

import {console2} from "forge-std/console2.sol";

contract SignatureTransfer is ISignatureTransfer, EIP712 {
using SignatureVerification for bytes;
using SafeTransferLib for ERC20;
Expand Down Expand Up @@ -156,8 +154,6 @@ contract SignatureTransfer is ISignatureTransfer, EIP712 {
uint256 bit = 1 << bitPos;
uint256 flipped = nonceBitmap[from][wordPos] ^= bit;

console2.log(bit);
console2.log(flipped);
if (flipped & bit == 0) revert InvalidNonce();
}
}

0 comments on commit d865412

Please sign in to comment.