{ "proposal": { "type": "object", "documentsMutable": true, "documentsKeepHistory": true, "canBeDeleted": false, "indices": [ { "name": "byEndDate", "properties": [ { "endDate": "asc" }, { "$createdAt": "asc" } ] }, { "name": "byOwner", "properties": [ { "$ownerId": "asc" }, { "$createdAt": "asc" } ] }, { "name": "byCreatedAt", "properties": [ { "$createdAt": "asc" } ] } ], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 128, "maxBytes": 512, "description": "The question, in one line", "position": 0 }, "description": { "type": "string", "minLength": 1, "maxLength": 4096, "maxBytes": 4096, "description": "What a yes and a no mean", "position": 1 }, "url": { "type": "string", "format": "uri", "minLength": 1, "maxLength": 512, "maxBytes": 512, "description": "Where the proposal is discussed", "position": 2 }, "passPercent": { "type": "integer", "minimum": 50, "maximum": 80, "description": "The proposal passes when the yes voting power is strictly more than this percent of the yes plus no voting power", "position": 3 }, "minimumTurnoutPercent": { "type": "integer", "minimum": 0, "maximum": 50, "description": "The least yes plus no voting power the proposal needs, as a percent of the masternode list's total voting power when it closes, rounded up", "position": 4 }, "endDate": { "type": "integer", "minimum": 0, "description": "When voting closes, in milliseconds since the Unix epoch", "position": 5 } }, "required": [ "$createdAt", "$updatedAt", "title", "description", "passPercent", "minimumTurnoutPercent", "endDate" ], "immutable": [ "passPercent", "minimumTurnoutPercent", "endDate", { "property": "title", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, { "min": [ 86400000, { "divide": [ { "subtract": [ "endDate", "$createdAt" ] }, 5 ] } ] } ] } }, { "property": "description", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, { "min": [ 86400000, { "divide": [ { "subtract": [ "endDate", "$createdAt" ] }, 5 ] } ] } ] } }, { "property": "url", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, { "min": [ 86400000, { "divide": [ { "subtract": [ "endDate", "$createdAt" ] }, 5 ] } ] } ] } } ], "additionalProperties": false, "description": "A yes/no question put to the masternodes. Creating one opens its vote poll, funded by its owner. Its title, description and url may be edited for a day after it is created, or a fifth of the time it runs if that is shorter; its rule never changes" }, "multipleChoiceProposal": { "type": "object", "documentsMutable": true, "documentsKeepHistory": true, "canBeDeleted": false, "indices": [ { "name": "byOwner", "properties": [ { "$ownerId": "asc" }, { "$createdAt": "asc" } ] }, { "name": "byCreatedAt", "properties": [ { "$createdAt": "asc" } ] } ], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 128, "maxBytes": 512, "description": "The question, in one line", "position": 0 }, "descriptionId": { "type": "array", "byteArray": true, "minItems": 32, "maxItems": 32, "contentMediaType": "application/x.dash.dpp.identifier", "refersTo": { "type": "moderatedDocument", "contractId": "$self.descriptionContractId", "documentType": "$self.descriptionDocumentType", "documentTypeRequirements": { "when": { "allOf": [ { "contains": [ "$electedAbilities", { "const": "deleteDocuments" } ] }, { "anyOf": [ { "absent": "$moderatorAbilities.deleteWithin" }, { "allOf": [ { "present": "$moderatorAbilities.deleteSettled" }, { "absent": "$moderatorAbilities.deleteSettled.approversPredateDocument" } ] } ] } ] }, "properties": { "body": { "name": "$any", "type": "string", "when": { "allOf": [ { "not": { "contains": [ "$moderatorAbilities.deleteKeepsFields", "$property" ] } }, { "not": { "contains": [ "$moderatorAbilities.changeFields", "$property" ] } } ] } }, "bodyBytes": { "name": "$any", "type": "array", "byteArray": true, "when": { "allOf": [ { "not": { "contains": [ "$moderatorAbilities.deleteKeepsFields", "$property" ] } }, { "not": { "contains": [ "$moderatorAbilities.changeFields", "$property" ] } } ] } } }, "require": { "anyOf": [ "body", "bodyBytes" ] } } }, "description": "The document saying what is being decided, when the proposal points at one: a document of a moderated type its contract's elected team may delete, at any time after it is written, holding text its author wrote that the removal takes away with it. Left out, with the two properties naming where it lives, by a proposal described at its url", "position": 1 }, "descriptionContractId": { "type": "array", "byteArray": true, "minItems": 32, "maxItems": 32, "contentMediaType": "application/x.dash.dpp.identifier", "refersTo": { "type": "contract", "contractRequirements": { "moderation": "elected", "ownerProtected": false } }, "description": "The contract the description document lives in, one whose moderators the masternodes elect and whose owner they may moderate like anyone. Given with descriptionId, and only with it", "position": 2 }, "descriptionDocumentType": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The document type of the description document. Given with descriptionId, and only with it", "position": 3 }, "url": { "type": "string", "format": "uri", "minLength": 1, "maxLength": 512, "maxBytes": 512, "description": "Where what is being decided is described, for a proposal that points at no description document; where it is discussed, for one that does. Required when descriptionId is left out", "position": 4 }, "open": { "type": "boolean", "description": "Whether anyone may enter choices; only the proposal's owner may when it is false", "position": 5 } }, "required": [ "$createdAt", "$updatedAt", "title", "open" ], "immutable": [ "open", { "property": "title", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, 7200000 ] } }, { "property": "descriptionId", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, 7200000 ] } }, { "property": "descriptionContractId", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, 7200000 ] } }, { "property": "descriptionDocumentType", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, 7200000 ] } }, { "property": "url", "when": { "greaterThan": [ { "subtract": [ "$updatedAt", "$createdAt" ] }, 7200000 ] } } ], "propertyConstraints": { "describedByADocumentOrAUrl": { "anyOf": [ { "present": "descriptionId" }, { "present": "url" } ] }, "descriptionDocumentNamedWhole": { "in": [ { "countPresent": [ "descriptionId", "descriptionContractId", "descriptionDocumentType" ] }, [ 0, 3 ] ] } }, "additionalProperties": false, "description": "A question put to the masternodes whose answers are the choices entered for it. What is being decided is said in one of two places, or both: a document the proposal points at, of a moderated type of a contract whose moderators the masternodes elect, so that they can take it down; or a url, which nothing on chain moderates. Anyone may enter choices when it is open, and only its owner when it is not. Its title, url and the description it points at may be changed for two hours after it is created; whether it is open never changes, and it is never deleted" }, "choice": { "type": "object", "documentsMutable": false, "canBeDeleted": false, "indices": [ { "name": "byProposal", "properties": [ { "proposalId": "asc" } ], "unique": true, "contested": { "resolution": 2, "description": "The choices entered for one multiple choice proposal contend in a masternode vote, each on its own; a lock means none of them" } } ], "properties": { "proposalId": { "type": "array", "byteArray": true, "minItems": 32, "maxItems": 32, "contentMediaType": "application/x.dash.dpp.identifier", "refersTo": { "type": "permanentDocument", "documentType": "multipleChoiceProposal" }, "description": "The multiple choice proposal this is an answer to", "position": 0 }, "title": { "type": "string", "minLength": 1, "maxLength": 128, "maxBytes": 512, "description": "The answer, in one line", "position": 1 }, "description": { "type": "string", "minLength": 1, "maxLength": 4096, "maxBytes": 4096, "description": "What voting for this answer means", "position": 2 } }, "required": [ "$createdAt", "proposalId", "title" ], "propertyConstraints": { "closedProposalTakesItsOwnersChoices": { "ifThen": [ { "equal": [ { "referenced": [ "proposalId", "open" ] }, 0 ] }, { "equal": [ { "referenced": [ "proposalId", "$ownerId" ] }, "$ownerId" ] } ] } }, "additionalProperties": false, "description": "An answer to a multiple choice proposal. Entering one opens the masternode vote among the proposal's choices, or joins it; an identity may enter several, and the choice with the most votes is kept" } }