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

Feat/cw law stone spec #143

Merged
merged 7 commits into from
Mar 17, 2023
Merged

Feat/cw law stone spec #143

merged 7 commits into from
Mar 17, 2023

Conversation

amimart
Copy link
Member

@amimart amimart commented Mar 14, 2023

📝 Purpose

This brings the specification of the new cw-law-stone (the name can be discussed) smart contract, providing a mean to expose immutable governance rules as Prolog programs, and to question them by querying the OKP4 logic module.

This idea is simple, the contract ensure the rules availability until the stone is broken. It relies on the cw-storage contract to ensure the availability of the Prolog program by pinning all the loaded objects.

Instantiation

The provided Prolog program defining the law is stored and pinned in the provided cw-storage address.

To ensure availability of eventual loaded files, the logic module is queried to identify and pin them, I think to avoid breaking a governance we must enforce that all the loaded files are stored in a cw-storage contract.

Query

  • Ask: Takes a Prolog query and ask the logic module by providing the main program.
  • Program: Retrieve the law stone program location information, the cw-storage contract address in which it is stored along with its ibject id.

Break

If not used anymore, I think we need a mean to free all the related objects on cw-storage, this is the purpose of the BreakStone message which can be invoked only by the contract admin.

@amimart amimart self-assigned this Mar 14, 2023
@bot-anik
Copy link
Member

bot-anik commented Mar 14, 2023

size-limit report 📦

Path Size
target/wasm32-unknown-unknown/release/cw_template.wasm 178.07 KB (0%)
target/wasm32-unknown-unknown/release/cw_logic_sample.wasm 203.83 KB (0%)
target/wasm32-unknown-unknown/release/cw_storage.wasm 261.71 KB (0%)
target/wasm32-unknown-unknown/release/cw_law_stone.wasm 169.05 KB (+100% 🔺)

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Merging #143 (4be47fe) into main (df7196a) will decrease coverage by 3.43%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
- Coverage   92.76%   89.34%   -3.43%     
==========================================
  Files          11       13       +2     
  Lines         235      244       +9     
==========================================
  Hits          218      218              
- Misses         17       26       +9     
Impacted Files Coverage Δ
contracts/cw-law-stone/src/bin/schema.rs 0.00% <0.00%> (ø)
contracts/cw-law-stone/src/contract.rs 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@ccamel ccamel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments that we can discuss.

contracts/cw-law-stone/src/msg.rs Outdated Show resolved Hide resolved
contracts/cw-law-stone/src/msg.rs Outdated Show resolved Hide resolved
contracts/cw-law-stone/src/msg.rs Show resolved Hide resolved
@amimart amimart requested a review from ccamel March 16, 2023 15:43
Copy link
Member

@ccamel ccamel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! There's room for improvement, of course, but this is a great start. Thanks. ❤️

contracts/cw-law-stone/src/msg.rs Show resolved Hide resolved
@amimart amimart merged commit 7c3b165 into main Mar 17, 2023
@amimart amimart deleted the feat/cw-law-stone-spec branch March 17, 2023 08:34
@bot-anik
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@bot-anik
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants