@@ -8,6 +8,8 @@ import { IYieldAggregator } from "contracts/interface/IYieldAggregator.sol";
8
8
import { BaseTest } from "../BaseTest.t.sol " ;
9
9
10
10
contract SharesFactoryTests is BaseTest {
11
+ string private constant URI = "https://vv.com/uri/ " ;
12
+
11
13
function setUp () public {
12
14
createFactory ();
13
15
_setUpShare ();
@@ -19,7 +21,7 @@ contract SharesFactoryTests is BaseTest {
19
21
20
22
// Alice mint & buy 1 share with 0 id
21
23
vm.prank (addrAlice);
22
- sharesFactory.mintShare (defaultCurveType);
24
+ sharesFactory.mintShare (defaultCurveType, URI );
23
25
_buyShare (addrAlice, 0 , 1 , referralReceiver);
24
26
25
27
// Bob mintAndBuy 1 share with 1 id
@@ -39,16 +41,18 @@ contract SharesFactoryTests is BaseTest {
39
41
40
42
function test_mintShare () public {
41
43
vm.prank (addrAlice);
42
- sharesFactory.mintShare (defaultCurveType);
44
+ sharesFactory.mintShare (defaultCurveType, URI );
43
45
44
46
uint256 shareIndex = sharesFactory.shareIndex ();
45
47
(address creator , uint8 curveType ) = sharesFactory.getShare (shareIndex - 1 );
48
+ string memory tokenURI = sharesNFT.tokenURIs (shareIndex - 1 );
46
49
47
50
assertEq (creator, addrAlice);
48
51
assertEq (curveType, defaultCurveType);
52
+ assertEq (tokenURI, URI);
49
53
50
54
vm.expectRevert (bytes ("Invalid curveType " ));
51
- sharesFactory.mintShare (99 );
55
+ sharesFactory.mintShare (99 , URI );
52
56
}
53
57
54
58
function test_minAndBuyShare () public {
@@ -59,10 +63,12 @@ contract SharesFactoryTests is BaseTest {
59
63
uint256 shareId = sharesFactory.shareIndex () - 1 ;
60
64
uint256 bobShareBal = sharesNFT.shareBalanceOf (addrBob, shareId);
61
65
(address creator , uint8 curveType ) = sharesFactory.getShare (shareId);
66
+ string memory tokenURI = sharesNFT.tokenURIs (shareId);
62
67
63
68
assertEq (creator, addrBob);
64
69
assertEq (curveType, defaultCurveType);
65
70
assertEq (bobShareBal, 99 );
71
+ assertEq (tokenURI, URI);
66
72
}
67
73
68
74
function test_buyShares () public {
@@ -534,7 +540,7 @@ contract SharesFactoryTests is BaseTest {
534
540
uint256 buyPrice = sharesFactory.getSubTotal (0 , quantity, curveType);
535
541
536
542
vm.prank (address (sender));
537
- sharesFactory.mintAndBuyShare { value: buyPrice * 110 / 100 }(curveType, quantity, referral);
543
+ sharesFactory.mintAndBuyShare { value: buyPrice * 110 / 100 }(curveType, quantity, URI, referral);
538
544
}
539
545
540
546
function _buyShare (address sender , uint256 shareId , uint32 quantity , address referral ) internal {
0 commit comments