CapSign
  • Home
  • Compliance Framework
  • Interactive Demos
    • Overview
  • Create an Account
  • Identity Verification
  • Investor Qualification
  • Guides for Individuals
    • Invest in an Offering
  • Guides for Corporations
    • Create a Share Class
    • Authorize Shares
    • Issue Shares
    • Upload a Document
    • Create a Document Template
    • Create an Offering
    • Manage Your Offering
    • Add a Trusted Attestor
    • Approve an Investment
  • API Reference
    • Overview
    • Compliance
      • Exemptions
        • FederalExemption.sol
          • FederalExemption
        • RegAExemption.sol
          • RegAExemption
        • RegCFExemption.sol
          • RegCFExemption
        • RegDExemption.sol
          • RegDExemption
        • Rule144Exemption.sol
          • Rule144Exemption
        • Rule701Exemption.sol
          • Rule701Exemption
      • IComplianceModule.sol
        • IComplianceModule
      • Vesting.sol
        • Vesting
    • Currencies
      • WETH.sol
        • WETH
      • CMX.sol
        • CMX
      • USD.sol
        • USD
    • Governance
      • BoardManagement.sol
        • BoardManagement
      • ProxyVoting.sol
        • ProxyVoting
    • Identity
      • AttestationRegistry.sol
        • AttestationRegistry
      • ERC20PaymentResolver.sol
        • ERC20PaymentResolver
      • Roles
        • BaseRoles.sol
          • BaseRoles
        • PrivateOfferingRoles.sol
          • PrivateOfferingRoles
        • PublicOfferingRoles.sol
          • PublicOfferingRoles
      • Whitelist.sol
        • Whitelist
    • Issuance
      • Compensation
        • CompensationFactory.sol
          • CompensationFactory
        • EmployeeStockOptionCompensation.sol
          • EmployeeStockOptionCompensation
        • RestrictedStockAwardCompensation.sol
          • RestrictedStockAwardCompensation
        • StockAppreciationRightsCompensation.sol
          • StockAppreciationRightCompensation
        • WarrantCompensation.sol
          • WarrantCompensation
      • Offering
        • ExemptOffering.sol
          • ExemptOffering
        • InitialPublicOffering.sol
          • InitialPublicOffering
        • Offering.sol
          • Offering
        • OfferingFactory.sol
          • OfferingFactory
        • Rule506bOffering.sol
          • Rule506bOffering
        • Rule506cOffering.sol
          • Rule506cOffering
        • TenderOffer.sol
          • TenderOffer
    • Investor Relations
      • DividendDistributor.sol
        • DividendDistributor
      • SubscriptionManager.sol
        • SubscriptionManager
        • IERC20
    • Ledgers
      • Ledger.sol
        • Ledger
      • LedgerManager.sol
        • LedgerManager
      • SettlementManager.sol
        • SettlementManager
    • Marketplace
      • AuctionMarket.sol
        • AuctionMarket
      • BaseMarket.sol
        • BaseMarket
      • BulletinBoardMarket.sol
        • BulletinBoardMarket
      • Contents
        • BaseCollateral.sol
          • BaseCollateral
        • ERC20Collateral.sol
          • ERC20Collateral
        • NativeCollateral.sol
          • NativeCollateral
      • LiquidityPoolMarket.sol
        • LiquidityPoolMarket
      • Contents
        • BaseMargin.sol
          • BaseMargin
        • MarginAccount.sol
          • MarginAccount
      • MarginOrderBookMarket.sol
        • MarginOrderBookMarket
      • OTCMarket.sol
        • OTCMarket
      • OrderBookMarket.sol
        • OrderBookMarket
      • Contents
        • BrokerNetSettlement.sol
          • BrokerNetSettlement
        • CustodyBridge.sol
          • CustodyBridge
        • DirectSettlement.sol
          • DirectSettlement
        • ListingRegistry.sol
          • ListingRegistry
    • Tokenization
      • Actions
        • CorporateActionManager.sol
          • CorporateActionManager
          • ICapitalAsset
        • ICorporateActionManager.sol
          • ICorporateActionManager
      • Assets
        • Asset.sol
          • Asset
          • Asset
        • ClosedEndFundClass.sol
          • ClosedEndFundClass
        • ClosedEndFundManager.sol
          • ClosedEndFundManager
        • EmployeeStockOption.sol
          • EmployeeStockOption
        • Contents
          • IAsset.sol
            • IAsset
          • IClosedEndFundClass.sol
            • IClosedEndFundClass
          • IIssuedAsset.sol
            • IIssuedAsset
          • IOpenEndFundClass.sol
            • IOpenEndFundClass
          • IShareClass.sol
            • IShareClass
        • IssuedAsset.sol
          • IssuedAsset
        • OpenEndFundClass.sol
          • OpenEndFundClass
        • OpenEndFundManager.sol
          • OpenEndFundManager
        • ShareClass.sol
          • ShareClass
        • StockAppreciationRight.sol
          • StockAppreciationRight
        • Warrant.sol
          • Warrant
      • TokenFactory.sol
        • TokenFactory
    • Utilities
      • PriceFeed.sol
        • SimplePriceFeed
        • IPriceFeed
    • Valuations
      • ValuationRegistry.sol
        • ValuationRegistry
    • Wallet
      • HookedSmartWallet.sol
        • HookedSmartWallet
      • Wallet.sol
        • Wallet
Powered by GitBook
On this page
  • State Variables
  • cumulativeSplitNum
  • cumulativeSplitDen
  • cumulativeDivNum
  • cumulativeDivDen
  • cumulativeDivCostBasisNum
  • cumulativeDivCostBasisDen
  • userRawTotals
  • isPublicIssuer
  • authorizedAmount
  • complianceModules
  • Functions
  • initialize
  • addComplianceModule
  • removeComplianceModule
  • _beforeTransferHook
  • applyStockDividend
  • applyStockSplit
  • createLot
  • transferFrom
  • getVotingPower
  • _getRealQuantity
  • _convertRealToRawQuantity
  • _getRealCostBasis
  • getTotalRealSupply
  • getLot
  • getRawLot
  • setIssuerPublicStatus
  • setAuthorizedAmount
  • Events
  • ComplianceModuleAdded
  • ComplianceModuleRemoved
  • StockSplitApplied
  • StockDividendApplied
  • IssuerPublicStatusUpdated
  • AuthorizedAmountUpdated

Was this helpful?

  1. API Reference
  2. Tokenization
  3. Assets
  4. ShareClass.sol

ShareClass

PreviousShareClass.solNextStockAppreciationRight.sol

Last updated 3 months ago

Was this helpful?

Inherits:

Author: CapSign Inc.

Extends the IssuedAsset contract to add features specific to share classes, such as dividends, splits, and corporate actions.

State Variables

cumulativeSplitNum

*We maintain cumulative multipliers:

  • cumulativeSplitNum / cumulativeSplitDen track how splits have changed quantity/cost basis.

  • cumulativeDivNum / cumulativeDivDen track how stock dividends have changed quantity. Example:

  • 1st split: 2-for-1 => multiply (2/1) into cumulativeSplitNum/Den

  • 2nd split: 3-for-1 => multiply again => final ratio = (2/1) * (3/1) = (6/1)

  • 1st dividend: 10% => multiply (110/100) into (cumulativeDivNum/cumulativeDivDen)*

uint96 public cumulativeSplitNum = 1;

cumulativeSplitDen

uint96 public cumulativeSplitDen = 1;

cumulativeDivNum

uint96 public cumulativeDivNum = 1;

cumulativeDivDen

uint96 public cumulativeDivDen = 1;

cumulativeDivCostBasisNum

uint96 public cumulativeDivCostBasisNum = 1;

cumulativeDivCostBasisDen

uint96 public cumulativeDivCostBasisDen = 1;

userRawTotals

mapping(address => uint96) public userRawTotals;

isPublicIssuer

bool public isPublicIssuer;

authorizedAmount

The authorized amount of shares that can be issued.

uint256 public authorizedAmount;

complianceModules

address[] public complianceModules;

Functions

initialize

function initialize(address _issuer, string memory _name, string memory _prefix) public virtual initializer;

addComplianceModule

Adds a transfer restriction module.

Only callable by an admin.

function addComplianceModule(address _module) external onlyAdmin;

removeComplianceModule

Removes a transfer restriction module by index.

Only callable by an admin.

function removeComplianceModule(uint256 index) external onlyAdmin;

_beforeTransferHook

Runs registered transfer restriction module checks.

function _beforeTransferHook(address from, address to, uint96 quantity, bytes32 tokenId, bytes memory data)
    internal
    view;

Parameters

Name
Type
Description

from

address

The sender (or address(0) for createLoting).

to

address

The recipient.

quantity

uint96

The "real" token quantity involved.

tokenId

bytes32

The lot identifier (or zero if not yet assigned).

data

bytes

applyStockDividend

*Applies a stock dividend. If reducesBasis is true, we treat it like a split for cost basis. Otherwise, only the share quantity ratio is updated. Example usage:

  • applyStockDividend(110, 100, false) -> 10% dividend, does NOT reduce cost basis.

  • applyStockDividend(150, 100, true) -> 50% dividend, does reduce cost basis.*

function applyStockDividend(uint96 divNum, uint96 divDen, bool reducesBasis) external onlyAdmin;

Parameters

Name
Type
Description

divNum

uint96

Numerator of the dividend ratio.

divDen

uint96

Denominator of the dividend ratio.

reducesBasis

bool

Whether this dividend reduces cost basis.

applyStockSplit

*Applies a new stock split ratio (e.g., 2-for-1). This function updates the cumulativeSplitNum/cumulativeSplitDen ratio multiplicatively. Example:

  • If you already had a 2-for-1 in effect (2/1), and you call this with (3,1), your final ratio is (23)/(11) = (6/1).*

function applyStockSplit(uint96 splitNum, uint96 splitDen) external onlyAdmin;

Parameters

Name
Type
Description

splitNum

uint96

Numerator of the new split ratio.

splitDen

uint96

Denominator of the new split ratio.

createLot

Overridden createLot, which expects the user to specify a "real" quantity. Internally, we convert it to a "raw" quantity before storing.

function createLot(
    address to,
    uint96 realAmount,
    address paymentCurrency,
    uint96 costBasis,
    uint64 acquisitionDate,
    string memory uri,
    bytes memory data
) public virtual override onlyAdmin returns (bytes32 tokenId);

transferFrom

Overridden transferFrom: we interpret 'transferQuantity' as a "real" quantity, then convert to raw, and call the base function.

function transferFrom(
    bytes32 tokenId,
    address from,
    address to,
    uint96 transferRealQuantity,
    string memory uri,
    bytes memory data
) public virtual override onlyAdmin;

getVotingPower

Convert raw total to real using ratio

function getVotingPower(address account) external view returns (uint256 votingPower);

_getRealQuantity

Helper to compute the real (post-split + post-dividend) quantity. We apply: realQuantity = rawQuantity (cumulativeSplitNum / cumulativeSplitDen) (cumulativeDivNum / cumulativeDivDen)

function _getRealQuantity(uint96 rawQuantity) internal view returns (uint96);

_convertRealToRawQuantity

Helper to convert real (post-split + dividend) quantity back to raw. Inverse of _getRealQuantity.

function _convertRealToRawQuantity(uint96 realQuantity) internal view returns (uint96);

_getRealCostBasis

Helper to compute the real (post-split + post-dividend) cost basis. For splits, cost basis = rawBasis * (splitDen / splitNum). For large dividends (that reduce basis): cost basis is also scaled by (divCostBasisDen / divCostBasisNum). For small dividends, that ratio remains 1/1 (unchanged).

function _getRealCostBasis(uint96 rawBasis) internal view returns (uint96);

getTotalRealSupply

Returns the total real supply of shares, adjusted for splits and dividends.

function getTotalRealSupply() external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total real supply of shares.

getLot

Returns the stored data plus "real" (post-split+dividend) quantity and costBasis.

function getLot(bytes32 lotId)
    external
    view
    override
    returns (
        bytes32 parentLotId,
        bool isValid,
        uint96 realQuantity,
        address paymentCurrency,
        uint96 realCostBasis,
        uint64 acquisitionDate,
        uint64 lastUpdate,
        string memory uri,
        bytes memory data
    );

Parameters

Name
Type
Description

lotId

bytes32

The lot ID to query.

Returns

Name
Type
Description

parentLotId

bytes32

Hash of the parent lot, or 0x0 if none.

isValid

bool

Whether the lot is active.

realQuantity

uint96

The adjusted quantity after splits/dividends.

paymentCurrency

address

The payment currency for this lot.

realCostBasis

uint96

The adjusted cost basis after splits (and optionally dividends).

acquisitionDate

uint64

The original acquisition timestamp (unmodified).

lastUpdate

uint64

The last time this lot was updated.

uri

string

The URI of the lot.

data

bytes

Additional data associated with the lot.

getRawLot

Convenience function to return the raw stored data without transformations.

function getRawLot(bytes32 lotId)
    external
    view
    returns (
        bytes32 parentLotId,
        bool isValid,
        uint96 quantity,
        address paymentCurrency,
        uint96 costBasis,
        uint64 acquisitionDate,
        uint64 lastUpdate,
        string memory uri,
        bytes memory data
    );

setIssuerPublicStatus

Sets the issuer public status. If _isPublic is true, the share class issuer is considered public (registered with the SEC). Otherwise, it is considered private. Only callable by an admin.

function setIssuerPublicStatus(bool _isPublic) external onlyAdmin;

setAuthorizedAmount

Sets the authorized amount of shares that can be issued. Only callable by an admin.

function setAuthorizedAmount(uint256 _authorizedAmount) external onlyAdmin;

Events

ComplianceModuleAdded

event ComplianceModuleAdded(address module);

ComplianceModuleRemoved

event ComplianceModuleRemoved(address module);

StockSplitApplied

Events for corporate actions

event StockSplitApplied(uint96 splitNum, uint96 splitDen);

StockDividendApplied

event StockDividendApplied(uint96 divNum, uint96 divDen, bool reducesBasis);

IssuerPublicStatusUpdated

Event that emits when the issuer public status is updated.

event IssuerPublicStatusUpdated(bool isPublic);

AuthorizedAmountUpdated

Event that emits when the authorized amount is updated.

event AuthorizedAmountUpdated(uint256 authorizedAmount);
Git Source
IssuedAsset