@@ -9,7 +9,7 @@ import { IERC1155 } from "openzeppelin/interfaces/IERC1155.sol";
99import { ERC1155 } from "openzeppelin/token/ERC1155/ERC1155.sol " ;
1010import { IERC20Permit } from "openzeppelin/token/ERC20/extensions/IERC20Permit.sol " ;
1111
12- import { MultiToken, ICryptoKitties } from "multitoken/MultiToken.sol " ;
12+ import { MultiToken, Asset, Category, ICryptoKitties } from "multitoken/MultiToken.sol " ;
1313
1414
1515abstract contract MultiTokenIntegrationTest is Test {
@@ -60,7 +60,7 @@ contract T1155 is ERC1155("test") {
6060|*----------------------------------------------------------*/
6161
6262contract MultiToken_Transfer_IntegrationTest is MultiTokenIntegrationTest {
63- using MultiToken for MultiToken. Asset;
63+ using MultiToken for Asset;
6464
6565 // ERC20
6666
@@ -139,7 +139,7 @@ contract MultiToken_Transfer_IntegrationTest is MultiTokenIntegrationTest {
139139
140140 function test_transferERC20_whenCallerIsNotSource () external {
141141 bool success;
142- MultiToken. Asset memory asset;
142+ Asset memory asset;
143143
144144 // WETH - transfer & transferFrom returning bool
145145 vm.prank (WETH); // Assuming WETH contract has at least `amount` tokens
@@ -269,7 +269,7 @@ contract MultiToken_Transfer_IntegrationTest is MultiTokenIntegrationTest {
269269 T1155 t1155 = new T1155 ();
270270 t1155.mint (chandler, id, amount);
271271
272- MultiToken. Asset memory asset = MultiToken.ERC1155 (address (t1155), id, 0 );
272+ Asset memory asset = MultiToken.ERC1155 (address (t1155), id, 0 );
273273
274274 vm.prank (chandler);
275275 asset.approveAsset (address (this ));
@@ -294,7 +294,7 @@ contract MultiToken_Transfer_IntegrationTest is MultiTokenIntegrationTest {
294294 T1155 t1155 = new T1155 ();
295295 t1155.mint (chandler, id, amount);
296296
297- MultiToken. Asset memory asset = MultiToken.ERC1155 (address (t1155), id, amount);
297+ Asset memory asset = MultiToken.ERC1155 (address (t1155), id, amount);
298298
299299 vm.prank (chandler);
300300 asset.approveAsset (address (this ));
@@ -337,7 +337,7 @@ contract MultiToken_Transfer_IntegrationTest is MultiTokenIntegrationTest {
337337 }
338338
339339 function test_transferCryptoKitties_whenCallerIsNotSource () external {
340- MultiToken. Asset memory asset = MultiToken.CryptoKitties (CK, id);
340+ Asset memory asset = MultiToken.CryptoKitties (CK, id);
341341 address trueOwner = ICryptoKitties (CK).ownerOf (id);
342342 vm.prank (trueOwner);
343343 ICryptoKitties (CK).transfer (chandler, id);
@@ -367,7 +367,7 @@ contract MultiToken_Transfer_IntegrationTest is MultiTokenIntegrationTest {
367367|*----------------------------------------------------------*/
368368
369369contract MultiToken_Permit_IntegrationTest is MultiTokenIntegrationTest {
370- using MultiToken for MultiToken. Asset;
370+ using MultiToken for Asset;
371371
372372
373373 function _signPermit () private returns (uint8 v , bytes32 r , bytes32 s ) {
@@ -428,7 +428,7 @@ contract MultiToken_Permit_IntegrationTest is MultiTokenIntegrationTest {
428428|*----------------------------------------------------------*/
429429
430430contract MultiToken_Approve_IntegrationTest is MultiTokenIntegrationTest {
431- using MultiToken for MultiToken. Asset;
431+ using MultiToken for Asset;
432432
433433
434434 function test_approveAmount_whenERC20 () external {
@@ -472,7 +472,7 @@ contract MultiToken_Approve_IntegrationTest is MultiTokenIntegrationTest {
472472
473473 // CryptoKitties doesn't implement `getApproved` function. The approve is tested by a transfer.
474474 function test_approveId_whenCryptoKitties () external {
475- MultiToken. Asset memory asset = MultiToken.CryptoKitties (CK, id);
475+ Asset memory asset = MultiToken.CryptoKitties (CK, id);
476476 address trueOwner = ICryptoKitties (CK).ownerOf (id);
477477 vm.prank (trueOwner);
478478 ICryptoKitties (CK).transfer (chandler, id);
@@ -500,7 +500,7 @@ contract MultiToken_Approve_IntegrationTest is MultiTokenIntegrationTest {
500500|*----------------------------------------------------------*/
501501
502502contract MultiToken_IsValid_IntegrationTest is MultiTokenIntegrationTest {
503- using MultiToken for MultiToken. Asset;
503+ using MultiToken for Asset;
504504
505505 address t1155;
506506
@@ -514,121 +514,121 @@ contract MultiToken_IsValid_IntegrationTest is MultiTokenIntegrationTest {
514514
515515 function test_returnTrue_whenValidERC20 () external {
516516 assertTrue (
517- MultiToken. Asset (MultiToken. Category.ERC20 , USDC, 0 , amount).isValid ()
517+ Asset (Category.ERC20 , USDC, 0 , amount).isValid ()
518518 );
519519 }
520520
521521 function test_returnFalse_whenERC20_withNonZeroId () external {
522522 assertFalse (
523- MultiToken. Asset (MultiToken. Category.ERC20 , USDC, id, amount).isValid ()
523+ Asset (Category.ERC20 , USDC, id, amount).isValid ()
524524 );
525525 }
526526
527527 function test_returnFalse_whenERC20_withERC721Category () external {
528528 assertFalse (
529- MultiToken. Asset (MultiToken. Category.ERC721 , USDC, id, 0 ).isValid ()
529+ Asset (Category.ERC721 , USDC, id, 0 ).isValid ()
530530 );
531531 }
532532
533533 function test_returnFalse_whenERC20_withERC1155Category () external {
534534 assertFalse (
535- MultiToken. Asset (MultiToken. Category.ERC1155 , USDC, id, amount).isValid ()
535+ Asset (Category.ERC1155 , USDC, id, amount).isValid ()
536536 );
537537 }
538538
539539 function test_returnFalse_whenERC20_withCryptoKittiesCategory () external {
540540 assertFalse (
541- MultiToken. Asset (MultiToken. Category.CryptoKitties, USDC, id, 0 ).isValid ()
541+ Asset (Category.CryptoKitties, USDC, id, 0 ).isValid ()
542542 );
543543 }
544544
545545 // ERC721
546546
547547 function test_returnTrue_whenValidERC721 () external {
548548 assertTrue (
549- MultiToken. Asset (MultiToken. Category.ERC721 , DOODLE, id, 0 ).isValid ()
549+ Asset (Category.ERC721 , DOODLE, id, 0 ).isValid ()
550550 );
551551 }
552552
553553 function test_returnFalse_whenERC721_withNonZeroAmount () external {
554554 assertFalse (
555- MultiToken. Asset (MultiToken. Category.ERC721 , DOODLE, id, 1 ).isValid ()
555+ Asset (Category.ERC721 , DOODLE, id, 1 ).isValid ()
556556 );
557557 }
558558
559559 function test_returnFalse_whenERC721_withERC20Category () external {
560560 assertFalse (
561- MultiToken. Asset (MultiToken. Category.ERC20 , DOODLE, 0 , amount).isValid ()
561+ Asset (Category.ERC20 , DOODLE, 0 , amount).isValid ()
562562 );
563563 }
564564
565565 function test_returnFalse_whenERC721_withERC1155Category () external {
566566 assertFalse (
567- MultiToken. Asset (MultiToken. Category.ERC1155 , DOODLE, id, amount).isValid ()
567+ Asset (Category.ERC1155 , DOODLE, id, amount).isValid ()
568568 );
569569 }
570570
571571 function test_returnFalse_whenERC721_withCryptoKittiesCategory () external {
572572 assertFalse (
573- MultiToken. Asset (MultiToken. Category.CryptoKitties, DOODLE, id, 0 ).isValid ()
573+ Asset (Category.CryptoKitties, DOODLE, id, 0 ).isValid ()
574574 );
575575 }
576576
577577 // ERC1155
578578
579579 function test_returnTrue_whenValidERC1155 () external {
580580 assertTrue (
581- MultiToken. Asset (MultiToken. Category.ERC1155 , t1155, id, amount).isValid ()
581+ Asset (Category.ERC1155 , t1155, id, amount).isValid ()
582582 );
583583 }
584584
585585 function test_returnFalse_whenERC1155_withERC20Category () external {
586586 assertFalse (
587- MultiToken. Asset (MultiToken. Category.ERC20 , t1155, 0 , amount).isValid ()
587+ Asset (Category.ERC20 , t1155, 0 , amount).isValid ()
588588 );
589589 }
590590
591591 function test_returnFalse_whenERC1155_withERC721Category () external {
592592 assertFalse (
593- MultiToken. Asset (MultiToken. Category.ERC721 , t1155, id, 0 ).isValid ()
593+ Asset (Category.ERC721 , t1155, id, 0 ).isValid ()
594594 );
595595 }
596596
597597 function test_returnFalse_whenERC1155_withCryptoKittiesCategory () external {
598598 assertFalse (
599- MultiToken. Asset (MultiToken. Category.CryptoKitties, t1155, id, 0 ).isValid ()
599+ Asset (Category.CryptoKitties, t1155, id, 0 ).isValid ()
600600 );
601601 }
602602
603603 // CryptoKitties
604604
605605 function test_returnTrue_whenValidCryptoKitties () external {
606606 assertTrue (
607- MultiToken. Asset (MultiToken. Category.CryptoKitties, CK, id, 0 ).isValid ()
607+ Asset (Category.CryptoKitties, CK, id, 0 ).isValid ()
608608 );
609609 }
610610
611611 function test_returnFalse_whenCryptoKitties_withNonZeroAmount () external {
612612 assertFalse (
613- MultiToken. Asset (MultiToken. Category.CryptoKitties, CK, id, 1 ).isValid ()
613+ Asset (Category.CryptoKitties, CK, id, 1 ).isValid ()
614614 );
615615 }
616616
617617 function test_returnFalse_whenCryptoKitties_withERC20Category () external {
618618 assertFalse (
619- MultiToken. Asset (MultiToken. Category.ERC20 , CK, 0 , amount).isValid ()
619+ Asset (Category.ERC20 , CK, 0 , amount).isValid ()
620620 );
621621 }
622622
623623 function test_returnFalse_whenCryptoKitties_withERC721Category () external {
624624 assertFalse (
625- MultiToken. Asset (MultiToken. Category.ERC721 , CK, id, 0 ).isValid ()
625+ Asset (Category.ERC721 , CK, id, 0 ).isValid ()
626626 );
627627 }
628628
629629 function test_returnFalse_whenCryptoKitties_withERC1155Category () external {
630630 assertFalse (
631- MultiToken. Asset (MultiToken. Category.ERC1155 , CK, id, amount).isValid ()
631+ Asset (Category.ERC1155 , CK, id, amount).isValid ()
632632 );
633633 }
634634
0 commit comments