Docs/Smart contracts/Implementation registry
Implementation registry
Approve clone-compatible IState templates and map stable template identifiers to implementations.
Approval model#
The owner calls setImplementation(templateId, implementation, approved). Approval requires a non-zero ID, deployed bytecode, and a readable non-zero creator(). Replacing one implementation for an ID automatically disables the previous implementation. Approval controls official verification, not whether third-party clients can create a market.
Template requirements#
- Implement
IState.read() returns (bool). - Be compatible with OpenZeppelin minimal proxy clones.
- Expose a one-time initializer because clone constructors do not run.
- Expose an immutable, non-zero
creator()for the 10% template-creator trading-fee allocation. - If the template exposes
stateDeadline(), it must return the market deadline and can only be created with At deadline resolution. - Define manipulation resistance and failure behavior in the reader itself.
Both verified and unverified implementations must expose creator(). For unverified third-party templates this value is self-reported by the implementation. Official templates inherit StateTemplate, which records the implementation deployer as an immutable creator. Official clients do not index, display, trade, or resolve zero-template-ID markets.