@@ -16,30 +16,30 @@ contract SignatureDropTest is BaseTest {
1616 event TokenURIRevealed (uint256 index , string revealedURI );
1717
1818 SignatureDrop public sigdrop;
19- address deployer_signer ;
20- bytes32 typehash ;
21- bytes32 nameHash;
22- bytes32 versionHash;
23- bytes32 _TYPE_HASH ;
24- bytes32 domainSeparator;
19+ address internal deployerSigner ;
20+ bytes32 internal typehashMintRequest ;
21+ bytes32 internal nameHash;
22+ bytes32 internal versionHash;
23+ bytes32 internal typehasEip712 ;
24+ bytes32 internal domainSeparator;
2525
2626 using stdStorage for StdStorage;
2727
2828 function setUp () public override {
2929 super .setUp ();
30- deployer_signer = signer;
30+ deployerSigner = signer;
3131 sigdrop = SignatureDrop (getContract ("SignatureDrop " ));
3232
33- erc20.mint (deployer_signer , 1_000_000 );
34- vm.deal (deployer_signer , 1_000 );
33+ erc20.mint (deployerSigner , 1_000_000 );
34+ vm.deal (deployerSigner , 1_000 );
3535
36- typehash = keccak256 (
36+ typehashMintRequest = keccak256 (
3737 "MintRequest(address to,address royaltyRecipient,uint256 royaltyBps,address primarySaleRecipient,string uri,uint256 quantity,uint256 pricePerToken,address currency,uint128 validityStartTimestamp,uint128 validityEndTimestamp,bytes32 uid) "
3838 );
3939 nameHash = keccak256 (bytes ("SignatureMintERC721 " ));
4040 versionHash = keccak256 (bytes ("1 " ));
41- _TYPE_HASH = keccak256 ("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract) " );
42- domainSeparator = keccak256 (abi.encode (_TYPE_HASH , nameHash, versionHash, block .chainid , sigdrop.sigMint ()));
41+ typehasEip712 = keccak256 ("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract) " );
42+ domainSeparator = keccak256 (abi.encode (typehasEip712 , nameHash, versionHash, block .chainid , sigdrop.sigMint ()));
4343 }
4444
4545 /*///////////////////////////////////////////////////////////////
@@ -56,7 +56,7 @@ contract SignatureDropTest is BaseTest {
5656
5757 uint256 nextTokenIdToMintBefore = sigdrop.nextTokenIdToMint ();
5858
59- vm.startPrank (deployer_signer );
59+ vm.startPrank (deployerSigner );
6060 uint256 batchId = sigdrop.lazyMint (amountToLazyMint, baseURI, encryptedBaseURI);
6161
6262 assertEq (nextTokenIdToMintBefore + amountToLazyMint, sigdrop.nextTokenIdToMint ());
@@ -81,7 +81,7 @@ contract SignatureDropTest is BaseTest {
8181
8282 uint256 nextTokenIdToMintBefore = sigdrop.nextTokenIdToMint ();
8383
84- vm.startPrank (deployer_signer );
84+ vm.startPrank (deployerSigner );
8585 uint256 batchId = sigdrop.lazyMint (amountToLazyMint, baseURI, encryptedBaseURI);
8686
8787 assertEq (nextTokenIdToMintBefore + amountToLazyMint, sigdrop.nextTokenIdToMint ());
@@ -114,7 +114,7 @@ contract SignatureDropTest is BaseTest {
114114 * note: Testing revert condition; calling tokenURI for invalid batch id.
115115 */
116116 function test_revert_lazyMint_URIForNonLazyMintedToken () public {
117- vm.startPrank (deployer_signer );
117+ vm.startPrank (deployerSigner );
118118
119119 sigdrop.lazyMint (100 , "ipfs:// " , "" );
120120
@@ -128,7 +128,7 @@ contract SignatureDropTest is BaseTest {
128128 * note: Testing event emission; tokens lazy minted.
129129 */
130130 function test_event_lazyMint_TokensLazyMinted () public {
131- vm.startPrank (deployer_signer );
131+ vm.startPrank (deployerSigner );
132132
133133 vm.expectEmit (false , false , false , true );
134134 emit TokensLazyMinted (0 , 100 , "ipfs:// " , "" );
@@ -150,7 +150,7 @@ contract SignatureDropTest is BaseTest {
150150
151151 uint256 nextTokenIdToMintBefore = sigdrop.nextTokenIdToMint ();
152152
153- vm.startPrank (deployer_signer );
153+ vm.startPrank (deployerSigner );
154154 uint256 batchId = sigdrop.lazyMint (amountToLazyMint, baseURI, encryptedBaseURI);
155155
156156 assertEq (nextTokenIdToMintBefore + amountToLazyMint, sigdrop.nextTokenIdToMint ());
@@ -186,7 +186,7 @@ contract SignatureDropTest is BaseTest {
186186
187187 uint256 nextTokenIdToMintBefore = sigdrop.nextTokenIdToMint ();
188188
189- vm.startPrank (deployer_signer );
189+ vm.startPrank (deployerSigner );
190190 uint256 batchId = sigdrop.lazyMint (amountToLazyMint, baseURI, encryptedBaseURI);
191191
192192 assertEq (nextTokenIdToMintBefore + amountToLazyMint, sigdrop.nextTokenIdToMint ());
@@ -218,10 +218,10 @@ contract SignatureDropTest is BaseTest {
218218 */
219219 function test_revert_delayedReveal_minterRole () public {
220220 bytes memory encryptedURI = sigdrop.encryptDecrypt ("ipfs:// " , "key " );
221- vm.prank (deployer_signer );
221+ vm.prank (deployerSigner );
222222 sigdrop.lazyMint (100 , "" , encryptedURI);
223223
224- vm.prank (deployer_signer );
224+ vm.prank (deployerSigner );
225225 sigdrop.reveal (0 , "key " );
226226
227227 bytes memory errorMessage = abi.encodePacked (
@@ -239,7 +239,7 @@ contract SignatureDropTest is BaseTest {
239239 * note: Testing revert condition; trying to reveal URI for non-existent batch.
240240 */
241241 function test_revert_delayedReveal_getBatchIdAtIndex () public {
242- vm.startPrank (deployer_signer );
242+ vm.startPrank (deployerSigner );
243243
244244 bytes memory encryptedURI = sigdrop.encryptDecrypt ("ipfs:// " , "key " );
245245 sigdrop.lazyMint (100 , "" , encryptedURI);
@@ -256,7 +256,7 @@ contract SignatureDropTest is BaseTest {
256256 * note: Testing state changes; URI revealed for a batch of tokens.
257257 */
258258 function test_state_delayedReveal_getRevealURI () public {
259- vm.startPrank (deployer_signer );
259+ vm.startPrank (deployerSigner );
260260
261261 bytes memory encryptedURI = sigdrop.encryptDecrypt ("ipfs:// " , "key " );
262262 sigdrop.lazyMint (100 , "" , encryptedURI);
@@ -271,7 +271,7 @@ contract SignatureDropTest is BaseTest {
271271 * note: Testing state changes; revealing URI with an incorrect key.
272272 */
273273 function testFail_delayedReveal_incorrectKey () public {
274- vm.startPrank (deployer_signer );
274+ vm.startPrank (deployerSigner );
275275
276276 bytes memory encryptedURI = sigdrop.encryptDecrypt ("ipfs:// " , "key " );
277277 sigdrop.lazyMint (100 , "" , encryptedURI);
@@ -286,7 +286,7 @@ contract SignatureDropTest is BaseTest {
286286 * note: Testing state changes; check baseURI after reveal for a batch of tokens.
287287 */
288288 function test_state_delayedReveal_setBaseURI () public {
289- vm.startPrank (deployer_signer );
289+ vm.startPrank (deployerSigner );
290290
291291 bytes memory encryptedURI = sigdrop.encryptDecrypt ("ipfs:// " , "key " );
292292 sigdrop.lazyMint (100 , "" , encryptedURI);
@@ -302,7 +302,7 @@ contract SignatureDropTest is BaseTest {
302302 * note: Testing event emission; token URI revealed.
303303 */
304304 function test_event_delayedReveal_event () public {
305- vm.startPrank (deployer_signer );
305+ vm.startPrank (deployerSigner );
306306
307307 bytes memory encryptedURI = sigdrop.encryptDecrypt ("ipfs:// " , "key " );
308308 sigdrop.lazyMint (100 , "" , encryptedURI);
@@ -322,7 +322,7 @@ contract SignatureDropTest is BaseTest {
322322 * note: Testing revert condition; invalid signature.
323323 */
324324 function test_revert_mintWithSignature_processRequestAndRecoverSigner () public {
325- vm.prank (deployer_signer );
325+ vm.prank (deployerSigner );
326326 sigdrop.lazyMint (100 , "ipfs:// " , "" );
327327 uint256 id = 0 ;
328328
@@ -340,7 +340,7 @@ contract SignatureDropTest is BaseTest {
340340 mintrequest.uid = bytes32 (id);
341341
342342 bytes memory encodedRequest = abi.encode (
343- typehash ,
343+ typehashMintRequest ,
344344 mintrequest.to,
345345 mintrequest.royaltyRecipient,
346346 mintrequest.royaltyBps,
@@ -371,7 +371,7 @@ contract SignatureDropTest is BaseTest {
371371 * note: Testing state changes; minting with signature, for a given price and currency.
372372 */
373373 function test_state_mintWithSignature_priceAndCurrency () public {
374- vm.prank (deployer_signer );
374+ vm.prank (deployerSigner );
375375 sigdrop.lazyMint (100 , "ipfs:// " , "" );
376376 uint256 id = 0 ;
377377 ISignatureMintERC721.MintRequest memory mintrequest;
@@ -390,7 +390,7 @@ contract SignatureDropTest is BaseTest {
390390
391391 {
392392 bytes memory encodedRequest = abi.encode (
393- typehash ,
393+ typehashMintRequest ,
394394 mintrequest.to,
395395 mintrequest.royaltyRecipient,
396396 mintrequest.royaltyBps,
@@ -408,7 +408,7 @@ contract SignatureDropTest is BaseTest {
408408
409409 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (privateKey, typedDataHash);
410410 bytes memory signature = abi.encodePacked (r, s, v);
411- vm.startPrank (deployer_signer );
411+ vm.startPrank (deployerSigner );
412412 vm.warp (1000 );
413413 erc20.approve (address (sigdrop), 1 );
414414 sigdrop.mintWithSignature (mintrequest, signature);
@@ -420,7 +420,7 @@ contract SignatureDropTest is BaseTest {
420420 id = 1 ;
421421 mintrequest.uid = bytes32 (id);
422422 bytes memory encodedRequest = abi.encode (
423- typehash ,
423+ typehashMintRequest ,
424424 mintrequest.to,
425425 mintrequest.royaltyRecipient,
426426 mintrequest.royaltyBps,
@@ -438,7 +438,7 @@ contract SignatureDropTest is BaseTest {
438438
439439 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (privateKey, typedDataHash);
440440 bytes memory signature = abi.encodePacked (r, s, v);
441- vm.startPrank (address (deployer_signer ));
441+ vm.startPrank (address (deployerSigner ));
442442 vm.warp (1000 );
443443 sigdrop.mintWithSignature { value: mintrequest.pricePerToken }(mintrequest, signature);
444444 vm.stopPrank ();
@@ -449,7 +449,7 @@ contract SignatureDropTest is BaseTest {
449449 * note: Testing token balances; checking balance and owner of tokens after minting with signature.
450450 */
451451 function test_balances_mintWithSignature_checkBalanceAndOwner () public {
452- vm.prank (deployer_signer );
452+ vm.prank (deployerSigner );
453453 sigdrop.lazyMint (100 , "ipfs:// " , "" );
454454 uint256 id = 0 ;
455455 ISignatureMintERC721.MintRequest memory mintrequest;
@@ -468,7 +468,7 @@ contract SignatureDropTest is BaseTest {
468468
469469 {
470470 bytes memory encodedRequest = abi.encode (
471- typehash ,
471+ typehashMintRequest ,
472472 mintrequest.to,
473473 mintrequest.royaltyRecipient,
474474 mintrequest.royaltyBps,
@@ -486,17 +486,17 @@ contract SignatureDropTest is BaseTest {
486486
487487 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (privateKey, typedDataHash);
488488 bytes memory signature = abi.encodePacked (r, s, v);
489- vm.startPrank (deployer_signer );
489+ vm.startPrank (deployerSigner );
490490 vm.warp (1000 );
491491 erc20.approve (address (sigdrop), 1 );
492492 sigdrop.mintWithSignature (mintrequest, signature);
493493 vm.stopPrank ();
494494
495- uint256 balance = sigdrop.balanceOf (address (deployer_signer ));
495+ uint256 balance = sigdrop.balanceOf (address (deployerSigner ));
496496 assertEq (balance, 1 );
497497
498498 address owner = sigdrop.ownerOf (0 );
499- assertEq (deployer_signer , owner);
499+ assertEq (deployerSigner , owner);
500500
501501 vm.expectRevert (abi.encodeWithSignature ("OwnerQueryForNonexistentToken() " ));
502502 owner = sigdrop.ownerOf (1 );
@@ -507,13 +507,13 @@ contract SignatureDropTest is BaseTest {
507507 * note: Testing state changes; minting with signature, for a given price and currency.
508508 */
509509 function mintWithSignature_priceAndCurrency (ISignatureMintERC721.MintRequest memory mintrequest ) internal {
510- vm.prank (deployer_signer );
510+ vm.prank (deployerSigner );
511511 sigdrop.lazyMint (100 , "ipfs:// " , "" );
512512 uint256 id = 0 ;
513513
514514 {
515515 bytes memory encodedRequest = abi.encode (
516- typehash ,
516+ typehashMintRequest ,
517517 mintrequest.to,
518518 mintrequest.royaltyRecipient,
519519 mintrequest.royaltyBps,
@@ -531,7 +531,7 @@ contract SignatureDropTest is BaseTest {
531531
532532 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (privateKey, typedDataHash);
533533 bytes memory signature = abi.encodePacked (r, s, v);
534- vm.startPrank (deployer_signer );
534+ vm.startPrank (deployerSigner );
535535 vm.warp (mintrequest.validityStartTimestamp);
536536 erc20.approve (address (sigdrop), 1 );
537537 sigdrop.mintWithSignature (mintrequest, signature);
@@ -543,7 +543,7 @@ contract SignatureDropTest is BaseTest {
543543 id = 1 ;
544544 mintrequest.uid = bytes32 (id);
545545 bytes memory encodedRequest = abi.encode (
546- typehash ,
546+ typehashMintRequest ,
547547 mintrequest.to,
548548 mintrequest.royaltyRecipient,
549549 mintrequest.royaltyBps,
@@ -561,7 +561,7 @@ contract SignatureDropTest is BaseTest {
561561
562562 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (privateKey, typedDataHash);
563563 bytes memory signature = abi.encodePacked (r, s, v);
564- vm.startPrank (address (deployer_signer ));
564+ vm.startPrank (address (deployerSigner ));
565565 vm.warp (mintrequest.validityStartTimestamp);
566566 sigdrop.mintWithSignature { value: mintrequest.pricePerToken }(mintrequest, signature);
567567 vm.stopPrank ();
@@ -597,7 +597,7 @@ contract SignatureDropTest is BaseTest {
597597 * note: Testing state changes; check startId and count after setting claim conditions.
598598 */
599599 function test_state_claimCondition_startIdAndCount () public {
600- vm.startPrank (deployer_signer );
600+ vm.startPrank (deployerSigner );
601601
602602 uint256 currentStartId = 0 ;
603603 uint256 count = 0 ;
@@ -633,7 +633,7 @@ contract SignatureDropTest is BaseTest {
633633 * note: Testing state changes; check activeConditionId based on changes in block timestamp.
634634 */
635635 function test_state_claimCondition_startPhase () public {
636- vm.startPrank (deployer_signer );
636+ vm.startPrank (deployerSigner );
637637
638638 uint256 activeConditionId = 0 ;
639639
@@ -692,9 +692,9 @@ contract SignatureDropTest is BaseTest {
692692 conditions[0 ].quantityLimitPerTransaction = 100 ;
693693 conditions[0 ].waitTimeInSecondsBetweenClaims = type (uint256 ).max;
694694
695- vm.prank (deployer_signer );
695+ vm.prank (deployerSigner );
696696 sigdrop.lazyMint (100 , "ipfs:// " , "" );
697- vm.prank (deployer_signer );
697+ vm.prank (deployerSigner );
698698 sigdrop.setClaimConditions (conditions, false , "" );
699699
700700 vm.prank (getActor (5 ), getActor (5 ));
@@ -722,7 +722,7 @@ contract SignatureDropTest is BaseTest {
722722 conditions[0 ].quantityLimitPerTransaction = 100 ;
723723 conditions[0 ].waitTimeInSecondsBetweenClaims = type (uint256 ).max;
724724
725- vm.prank (deployer_signer );
725+ vm.prank (deployerSigner );
726726 sigdrop.lazyMint (100 , "ipfs:// " , "" );
727727
728728 vm.prank (deployer);
0 commit comments