Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📜 Add v3.0.0 contracts documentation version #326

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/okp4-cognitarium.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,4 @@ Represents a condition in a [WhereClause].

---

*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-cognitarium.json` (`f3c6fe24ffc06133`)*
*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-cognitarium.json` (`0b746186a6e8df78`)*
2 changes: 1 addition & 1 deletion contracts/okp4-law-stone.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ A string containing Base64-encoded data.

---

*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-law-stone.json` (`d2b5da624dff3dad`)*
*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-law-stone.json` (`023b72150b485c6b`)*
2 changes: 1 addition & 1 deletion contracts/okp4-objectarium.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,4 +516,4 @@ A string containing a 128-bit integer in decimal representation.

---

*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-objectarium.json` (`c9bbaeefb8b85833`)*
*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-objectarium.json` (`51f0131cd7a4ebf9`)*
481 changes: 481 additions & 0 deletions contracts_versioned_docs/version-v3.0.0/okp4-cognitarium.md

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions contracts_versioned_docs/version-v3.0.0/okp4-law-stone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Law Stone

## Overview

The `okp4-law-stone` smart contract aims to provide GaaS (i.e. Governance as a Service) in any [Cosmos blockchains](https://cosmos.network/) using the [CosmWasm](https://cosmwasm.com/) framework and the [Logic](https://docs.okp4.network/modules/next/logic) OKP4 module.

This contract is built around a Prolog program describing the law by rules and facts. The law stone is immutable, this means it can only be questioned, there are no update mechanisms.

The `okp4-law-stone` responsibility is to guarantee the availability of its rules in order to question them, but not to ensure the rules application.

To ensure reliability over time, the associated Prolog program is stored and pinned in a `okp4-objectarium` contract. Moreover, all the eventual loaded files must be stored in a `okp4-objectarium` contract as well, allowing the contract to pin them.

To be able to free the underlying resources (i.e. objects in `okp4-objectarium`) if not used anymore, the contract admin can break the stone.

➡️ Checkout the [examples](https://github.com/okp4/contracts/tree/main/contracts/okp4-law-stone/examples/) for usage information.

## InstantiateMsg

Instantiate message

|parameter|description|
|----------|-----------|
|`program`|*(Required.) * **[Binary](#binary)**. The Prolog program carrying law rules and facts.|
|`storage_address`|*(Required.) * **string**. The `okp4-objectarium` contract address on which to store the law program.|

## ExecuteMsg

Execute messages

### ExecuteMsg::BreakStone

Break the stone making this contract unusable, by clearing all the related resources: - Unpin all the pinned objects on `okp4-objectarium` contracts, if any. - Forget the main program (i.e. or at least unpin it). Only the contract admin is authorized to break it, if any. If already broken, this is a no-op.

|literal|
|-------|
|`"break_stone"`|

## QueryMsg

Query messages

### QueryMsg::Ask

If not broken, ask the logic module the provided query with the law program loaded.

|parameter|description|
|----------|-----------|
|`ask`|*(Required.) * **object**. |
|`ask.query`|*(Required.) * **string**. |

### QueryMsg::Program

If not broken, returns the law program location information.

|literal|
|-------|
|`"program"`|

## Responses

### ask



|property|description|
|----------|-----------|
|`answer`|**[Answer](#answer)\|null**. |
|`gas_used`|*(Required.) * **integer**. |
|`height`|*(Required.) * **integer**. |

### program

ProgramResponse carry elements to locate the program in a `okp4-objectarium` contract.

|property|description|
|----------|-----------|
|`object_id`|*(Required.) * **string**. The program object id in the `okp4-objectarium` contract.|
|`storage_address`|*(Required.) * **string**. The `okp4-objectarium` contract address on which the law program is stored.|

## Definitions

### Answer



|property|description|
|----------|-----------|
|`has_more`|*(Required.) * **boolean**. |
|`results`|*(Required.) * **Array<[Result](#result)>**. |
|`success`|*(Required.) * **boolean**. |
|`variables`|*(Required.) * **Array<string>**. |

### Binary

A string containing Base64-encoded data.

|type|
|----|
|**string**.|

### Result



|property|description|
|----------|-----------|
|`substitutions`|*(Required.) * **Array<[Substitution](#substitution)>**. |

### Substitution



|property|description|
|----------|-----------|
|`term`|*(Required.) * **object**. |
|`variable`|*(Required.) * **string**. |

### Term



|property|description|
|----------|-----------|
|`arguments`|*(Required.) * **Array<[Term](#term)>**. |
|`name`|*(Required.) * **string**. |

---

*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `okp4-law-stone.json` (`023b72150b485c6b`)*
Loading