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, recoveredCompleteSetShares, _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, unpackTokenId, isPortfolioRecoveryEligible, and balanceOfPortfolioRecoveryRights. The eligibility getter applies the source recovery rules, preserving ordinary source-pool redemption for protected finalized questions. The balance getter returns unspent Invalid, Yes and No recovery rights, or all zeros when ineligible; the minimum bounds complete-set cash recovery. Received rights are included independently of the holder’s source-token balances.
State-changing interactions
Each call lists its parameter names in ABI order. The contract index defines the columns.
| 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 |
safeTransferFrom(from, to, id, value) and safeTransferFrom(from, to, id, value, data) |
Share holder or approved ERC-1155 operator | Caller holds the source balance or has operator approval; the source account has neither materialized that token into a child branch nor spent source-backed recovery rights by transferring or consuming them; 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 |
safeBatchTransferFrom(from, to, ids, values) and safeBatchTransferFrom(from, to, ids, values, data) |
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 already locked by child materialization or spending source-backed recovery rights, 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 |
transferPortfolioRecoveryRights(sourceUniverse, recipient, amountsAttoShares) |
Recovery-right holder transferring only their own rights; ERC-1155 operator approval does not authorize this call | Canonical source is a portfolio question in a forked universe with isPortfolioRecoveryEligible(sourceUniverse) == true (No live source recovery right); recipient is a different nonzero account; at least one amount is positive; every amount fits its corresponding unspent recovery-right balance. |
Transfers the specified Invalid, Yes and No recovery rights independently. Source and child token balances and every branch migration entitlement remain intact. Received credits are spent first; spending source-backed rights locks that source token against transfer. No token-receiver callback is invoked. | PortfolioRecoveryRightsTransferred |
consumePortfolioRecoveryCompleteSets(sourceUniverse, holder, amountAttoShares) |
The canonical source pool’s portfolio or its configured fork coordinator | Canonical source is a portfolio question in a forked universe with isPortfolioRecoveryEligible(sourceUniverse) == true (No live source recovery right); positive amount no greater than any of the holder’s three unspent recovery-right balances. The coordinator authenticates the holder and calculates the corresponding cash payout. |
Consumes equal amounts of Invalid, Yes and No recovery rights, using independently received credits before source-backed rights. Spending a source-backed right locks that source token against transfer; spending received credits alone does not. Source balances and every branch’s migration rights remain intact. Returns cumulative consumed shares. | PortfolioRecoveryRightsConsumed |
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; each target is an immediate native child, including when its bound question contract skips intermediate reporter ancestors; 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. | Canonical child preparation may emit SecurityPoolRegistered, DeploySecurityPool, and share-token AuthorizationUpdated. Successful materialization emits ERC-1155 TransferSingle and Migrate for each target. |
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; amountAttoShares is positive; under A22 asset-recipient compatibility, a contract account accepts onERC1155BatchReceived. |
Mints amountAttoShares 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, owner, amountAttoShares) |
An authorized SecurityPool |
Caller is authorized; owner is nonzero and has at least amountAttoShares of every outcome. Each remaining source balance must still cover its already-separated recovery rights. |
Burns amountAttoShares each of Invalid, Yes, and No from owner; global outcome supplies may differ. |
TransferBatch |
burnTokenIdAndGetRemainingSupply(tokenId, owner) |
An authorized SecurityPool |
owner is nonzero; caller is authorized; no source-backed recovery rights have already been separated for this token. |
Burns owner'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 |