Zoltar

Registers universe forks, charges the fork admission haircut, and mints branch-specific child REP. Zoltar source contract

Read surface

Use universes, forkThresholdDivisor, forkBurnDivisor, zoltarQuestionData, genesisReputationToken, childReputationTokenCount, getForkTime, forkQuestionMatches, getRepToken, getForkThresholdAttoRep, getNonDecisionThresholdAttoRep, getUniverseTheoreticalSupplyAttoRep, getChildUniverseId, getDeployedChildUniverses, getMigrationRepBalanceAttoRep, and getChildMigrationRepAmountsAttoRep to reconstruct universe and migration state. The child migration getter accepts an array of child universe IDs and returns cumulative amounts in the same order, with zero for unused IDs. The fork threshold is the live universe theoretical supply divided by forkThresholdDivisor, rounded up, so every nonzero-supply universe has a positive fork cost. Construction requires a deployed genesis REP token with the REPv2 getTotalTheoreticalSupply() selector, theoretical supply from one attoREP through 11 million REP, and forkBurnDivisor >= 5, which caps the uncredited fork haircut at 20% of the threshold. Genesis REP uses ordinary ERC-20 approvals because the configured mainnet REPv2 token does not implement ERC-2612 or ERC-3009.

Security boundaries for these calls are A15 intended question selection and A25 safe immutable parameters.

State-changing interactions

Transaction Caller Main prerequisites State or asset effect Primary signals
forkUniverse(universeId, questionId) Any address able to fund the current fork threshold Initialized and unforked universe; existing ended question; sufficient caller REP. Genesis REP requires allowance; child REP is burned directly without allowance. Records the fork, removes threshold REP from the parent universe, and credits the caller with the threshold minus the configured uncredited haircut. UniverseForked
burnRep(universeId, amountAttoRep) Any REP holder; the caller can burn only its own balance Initialized universe; positive amount; sufficient caller REP and theoretical supply. Genesis REP requires allowance. Permanently removes REP without creating migration credit; escalation settlement uses this when the haircut was not paid through its own fork. RepBurned and the token burn or transfer event
deployChild(universeId, outcomeIndex) Anyone Parent forked; outcome is well formed; child is not already deployed. Deploys the deterministic child REP token and initializes the child universe. TheoreticalSupplySet, ReputationTokenInitialized, DeployChild, and ChildReputationTokenInitialized
addRepToMigrationBalance(universeId, amountAttoRep) Parent REP holder Universe forked; sufficient caller REP. Genesis REP requires allowance; child REP is burned directly without allowance. Burns or sinks additional parent REP and increases the caller's reusable migration balance. MigrationRepAdded
prepareAndSplitMigrationRep(universeId, amountAttoRep, outcomeIndexes, preparationAttoRep) Parent REP holder Forked universe; positive split amount; nonempty valid outcomes; sufficient parent REP for the exact preparationAttoRep supplied and sufficient migration credit for every split. Outcome order is unrestricted. Genesis REP requires allowance for preparation; child REP needs no allowance. Adds the supplied preparation amount to migration credit, then splits the requested REP into the supplied outcomes using the existing migration checks. Both steps revert together on failure. Callers compute any preparation shortfall from cumulative child migration amounts, rather than current child token holdings. MigrationRepAdded when preparationAttoRep is positive; DeployChild and ChildReputationTokenInitialized when children are deployed; child REP Transfer, Mint, and MigrationRepSplit for each destination
splitMigrationRep(universeId, amountAttoRep, outcomeIndexes) Migration-balance holder Universe forked. A nonempty list additionally requires every outcome to be well formed and the cumulative amount per child not to exceed the caller's migration balance. Mints amount of child REP into every selected branch, deploying missing children lazily. An empty outcome list returns after the universe-fork guard without outcome validation, deployment, minting, or events. A nonempty zero-amount call still validates every outcome, may deploy missing children, performs zero-value child REP mints, and records a zero split for every branch. TheoreticalSupplySet and DeployChild when needed; child REP Transfer and Mint, then MigrationRepSplit, per selected branch, including at zero amount; no event for an empty list