File tree Expand file tree Collapse file tree 4 files changed +41
-6
lines changed Expand file tree Collapse file tree 4 files changed +41
-6
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,10 @@ library LibDeployment {
57
57
return FacetCutInfo ({ name: "DiamondLoupeFacet " , selectors: selectors });
58
58
}
59
59
if (facetType == FacetType.Issuer) {
60
- bytes4 [] memory selectors = new bytes4 [](2 );
60
+ bytes4 [] memory selectors = new bytes4 [](3 );
61
61
selectors[0 ] = IssuerFacet.initializeIssuer.selector ;
62
62
selectors[1 ] = IssuerFacet.adjustIssuerAuthorizedShares.selector ;
63
+ selectors[2 ] = IssuerFacet.issuer.selector ;
63
64
return FacetCutInfo ({ name: "IssuerFacet " , selectors: selectors });
64
65
}
65
66
if (facetType == FacetType.Stakeholder) {
Original file line number Diff line number Diff line change @@ -7,12 +7,9 @@ import { Issuer } from "@libraries/Structs.sol";
7
7
import { TxHelper, TxType } from "@libraries/TxHelper.sol " ;
8
8
import { AccessControl } from "@libraries/AccessControl.sol " ;
9
9
import { console } from "forge-std/console.sol " ;
10
+ import { IIssuerFacet } from "@interfaces/IIssuerFacet.sol " ;
10
11
11
- contract IssuerFacet {
12
- error IssuerAlreadyInitialized ();
13
-
14
- event IssuerAuthorizedSharesAdjusted (uint256 newSharesAuthorized );
15
-
12
+ contract IssuerFacet is IIssuerFacet {
16
13
/// @notice Initialize the issuer with initial shares authorized
17
14
/// @dev Can only be called once by an admin during setup
18
15
function initializeIssuer (bytes16 id , uint256 initial_shares_authorized ) external {
@@ -30,6 +27,10 @@ contract IssuerFacet {
30
27
ds.issuer = Issuer ({ id: id, shares_issued: 0 , shares_authorized: initial_shares_authorized });
31
28
}
32
29
30
+ function issuer () external view returns (Issuer memory ) {
31
+ return StorageLib.get ().issuer;
32
+ }
33
+
33
34
/// @notice Adjust the total number of authorized shares for the issuer
34
35
/// @dev Only DEFAULT_ADMIN_ROLE can adjust authorized shares
35
36
function adjustIssuerAuthorizedShares (bytes16 id , uint256 newSharesAuthorized ) external {
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ interface IIssuerFacet {
16
16
/// @param initial_shares_authorized Initial number of authorized shares
17
17
function initializeIssuer (bytes16 id , uint256 initial_shares_authorized ) external ;
18
18
19
+ /// @notice Getter for the Issuer struct
20
+ function issuer () external view returns (Issuer memory );
21
+
19
22
/// @notice Adjust the total number of authorized shares for the issuer
20
23
/// @dev Only DEFAULT_ADMIN_ROLE can adjust authorized shares
21
24
/// @param id The unique identifier for the tx
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^ 0.8.0 ;
3
+
4
+ import "./TestBase.sol " ;
5
+ import {
6
+ StockActivePosition,
7
+ WarrantActivePosition,
8
+ ConvertibleActivePosition,
9
+ EquityCompensationActivePosition,
10
+ StakeholderPositions,
11
+ IssueStockParams,
12
+ IssueConvertibleParams,
13
+ IssueEquityCompensationParams,
14
+ Issuer
15
+ } from "@libraries/Structs.sol " ;
16
+ import { IStockFacet } from "@interfaces/IStockFacet.sol " ;
17
+ import { IConvertiblesFacet } from "@interfaces/IConvertiblesFacet.sol " ;
18
+ import { IEquityCompensationFacet } from "@interfaces/IEquityCompensationFacet.sol " ;
19
+ import {ICapTable} from "../src/interfaces/ICapTable.sol " ;
20
+
21
+ contract IssuerTest is DiamondTestBase {
22
+
23
+ function test_issuer () public {
24
+ ICapTable ct = ICapTable (address (capTable));
25
+ Issuer memory iss = ct.issuer ();
26
+ assertTrue (iss.id != bytes16 (0 ));
27
+ assertGt (iss.shares_authorized, 0 );
28
+ assertEq (iss.shares_issued, 0 );
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments