IShareClass
Inherits: IIssuedAsset
Functions
createLot
Creates a brand-new lot (e.g., an initial issuance) for a user.
function createLot(
address owner,
uint96 quantity,
address paymentCurrency,
uint96 costBasis,
uint64 acquisitionDate,
string memory uri,
bytes memory data
) external returns (bytes32 tokenId);
Parameters
owner
address
The owner of the lot.
quantity
uint96
The total raw quantity for this lot.
paymentCurrency
address
The payment currency for this lot.
costBasis
uint96
Raw cost basis per share/unit.
acquisitionDate
uint64
The original acquisition date.
uri
string
The URI of the lot.
data
bytes
Additional data associated with the lot.
Returns
tokenId
bytes32
The unique ID of the new lot.
sellFromToken
Sells a certain raw quantity from an existing lot. If partial, invalidates the old lot and creates a new remainder lot with the same cost basis.
function sellFromToken(address owner, bytes32 tokenId, uint96 realSellQuantity) external returns (bytes32 newTokenId);
Parameters
owner
address
The user who owns the lot.
tokenId
bytes32
The ID of the lot to sell from.
realSellQuantity
uint96
The raw quantity to sell from this lot.
Returns
newTokenId
bytes32
The new lot ID if partial remainder exists, else 0x0.
adjustToken
Creates a new lot as a child of an old lot, typically used for spin-offs, cost basis corrections, partial reclassifications, etc.
function adjustToken(bytes32 oldTokenId, uint96 newQuantity, uint96 newCostBasis, string calldata reason)
external
returns (bytes32 newTokenId);
Parameters
oldTokenId
bytes32
The old lot to be adjusted.
newQuantity
uint96
The raw quantity for the new lot.
newCostBasis
uint96
The raw cost basis for the new lot.
reason
string
A short string explaining the adjustment type, e.g. "SpinOff", "ManualCorrection".
Returns
newTokenId
bytes32
The ID of the newly created lot.
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.
function applyStockDividend(uint96 divNum, uint96 divDen, bool reducesBasis) external;
Parameters
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.
function applyStockSplit(uint96 splitNum, uint96 splitDen) external;
Parameters
splitNum
uint96
Numerator of the new split ratio.
splitDen
uint96
Denominator of the new split ratio.
getToken
Returns the stored data plus "real" (post-split+dividend) quantity and costBasis.
function getToken(bytes32 tokenId)
external
view
returns (
bytes32 parentTokenId,
bool isValid,
uint96 realQuantity,
uint96 realCostBasis,
uint64 acquisitionDate,
uint64 lastUpdate,
string memory uri,
bytes memory data
);
Parameters
tokenId
bytes32
The lot ID to query.
Returns
parentTokenId
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.
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.
getRawToken
Convenience function to return the raw stored data without transformations.
function getRawToken(bytes32 tokenId)
external
view
returns (
bytes32 parentTokenId,
bool isValid,
uint96 quantity,
uint96 costBasis,
uint64 acquisitionDate,
uint64 lastUpdate
);
Parameters
tokenId
bytes32
The lot ID to query.
Returns
parentTokenId
bytes32
Hash of the parent lot, or 0x0 if none.
isValid
bool
Whether the lot is active.
quantity
uint96
The raw quantity.
costBasis
uint96
The raw cost basis.
acquisitionDate
uint64
The original acquisition timestamp.
lastUpdate
uint64
The last time this lot was updated.
getVotingPower
Returns the voting power of an account.
function getVotingPower(address account) external view returns (uint256);
Parameters
account
address
The address of the account.
Returns
<none>
uint256
The voting power of the account.
operator
Returns the address of the current operator.
function operator() external view returns (address);
Returns
<none>
address
The operator address.
Events
StockSplitApplied
Events for corporate actions
event StockSplitApplied(uint96 splitNum, uint96 splitDen);
StockDividendApplied
event StockDividendApplied(uint96 divNum, uint96 divDen, bool reducesBasis);
Last updated
Was this helpful?