ShareToken
Stores universe-aware ERC-1155 outcome shares and materializes a holder's persistent source entitlement in selected fork branches. ShareToken source contract
Read surface
Base and relationship getters are name, symbol, zoltar, canonicalPoolByUniverse, _balances, _supplies, and _operatorApprovals. Standard ERC-1155 reads are supportsInterface, balanceOf, totalSupply, balanceOfBatch, and isApprovedForAll; protocol-specific reads are isAuthorized, totalSupplyForOutcome, maximumOutcomeSupply, balanceOfOutcome, balanceOfShares, getMigratedShareAmountAttoShares, getTokenId, getTokenIds, and unpackTokenId.
State-changing interactions
| Transaction | Caller | Main prerequisites | State or asset effect | Primary signals |
|---|---|---|---|---|
setApprovalForAll(operator, approved) |
Any token account setting its own operator approval | The operator differs from the caller. | Sets or clears the operator's authority over all of the caller's outcome-token balances. | ApprovalForAll |
Both safeTransferFrom(...) overloads |
Share holder or approved ERC-1155 operator | Caller holds the source balance or has operator approval; the source account has not materialized that token into any child branch; destination is nonzero; the source balance is sufficient; under A22 asset-recipient compatibility, a contract recipient accepts the ERC-1155 callback. | Transfers one outcome-token balance without changing supply. | TransferSingle |
Both safeBatchTransferFrom(...) overloads |
Share holder or approved ERC-1155 operator for a nonempty batch; any caller for an empty batch | ID and value array lengths match. A nonempty batch also requires holder or operator authority, no listed source token that the source account has already materialized into a child branch, a nonzero destination, sufficient source balances, and, under A22 asset-recipient compatibility, an accepting ERC-1155 callback from a contract recipient; the empty-batch no-op performs none of those checks. | A nonempty batch transfers each listed outcome-token balance without changing supply. Equal empty ID and value arrays return as a no-op without an event. | TransferBatch for a nonempty batch; no event for an empty batch |
migrate(fromId, targetOutcomeIndexes) |
Holder of the source token ID | Source universe forked; canonical source pool is Operational or PoolForked, and an Operational source has no inherited fixed outcome because auto-fork activation rejects one; positive source balance; nonempty, strictly increasing, well-formed outcomes; every target in a multi-target call already has a canonical child pool; after the branch-creation window, a single target must also already exist; at least one selected child has an unmaterialized balance; under A22 asset-recipient compatibility, a contract holder accepts onERC1155Received for every target mint. |
If needed, first freezes the operational source pool and records its fork snapshot. A single-target call may lazily create that child while the branch-creation window is open. It keeps and locks the holder's source entitlement, then mints each selected child-universe token ID up to the current source balance. Later source additions materialize only the unminted delta. A contract holder receives the ERC-1155 single-receiver callback for each mint; rejection rolls back the mint and preceding fork or child setup. | PoolForkModeActivated, PoolAccountingCheckpoint, SecurityPoolForkSnapshot, ParentRepLocked, and optionally DisputeStakedRepDrainedAtFork when auto-forking; SecurityPoolRegistered, DeploySecurityPool, AuthorizationUpdated, and ChildPoolLinked when lazily deploying, plus DeployChild, ChildRepSplit, PoolHeldRepSweptToChild, EscalationGameSet, GameContinuedFromFork, ForkCarryCheckpoint, and ChildDisputeStakedRepMaterialized as applicable; then one ERC-1155 mint TransferSingle and Migrate per materialized target on successful callbacks |
authorize(securityPoolCandidate) |
Initially authorized SecurityPoolFactory for an origin pool; an authorized parent SecurityPool for a child pool |
Caller is already authorized; the candidate reports this exact share token; its universe has no different canonical pool. | Establishes the candidate as canonicalPoolByUniverse for its universe and adds it to the set allowed to mint, burn, and authorize descendants. Reauthorizing the same candidate is a no-op. |
AuthorizationUpdated on first authorization; no event when the same candidate is already authorized |
mintCompleteSets(universeId, account, amountAttoShares) |
An authorized SecurityPool |
Caller is authorized; account is nonzero; amount is positive; under A22 asset-recipient compatibility, a contract account accepts onERC1155BatchReceived. |
Mints amount each of Invalid, Yes, and No to account, then invokes its ERC-1155 batch-receiver callback when it is a contract. Rejection rolls back the mint and the authorized pool's surrounding transaction. |
TransferBatch on a successful callback |
burnCompleteSets(universeId, account, amountAttoShares) |
An authorized SecurityPool |
Caller is authorized; account is nonzero and has at least amount of every outcome. |
Burns amount each of Invalid, Yes, and No from account; global outcome supplies may differ. |
TransferBatch |
burnTokenIdAndGetRemainingSupply(tokenId, account) |
An authorized SecurityPool |
account is nonzero; caller is authorized. |
Burns account's full balance of tokenId and returns the burned amount and that token ID's remaining supply. |
TransferSingle, including when the burned balance is zero |