feat: p/demo/accesscontrol & p/demo/timelock
We have developed two packages: accesscontrol and timelock inspired by openzeppelin contracts. These packages were created in collaboration with @mous1985 , @DIGIX666 , and myself.
The accesscontrol package was primarily designed to support the development of the timelock package, but it can also be used independently for many other use cases.
Features
Accesscontrol
The accesscontrol package provides a library for managing roles and permissions within Gno. It allows for the creation, assignment, and management of roles with specific administrative privileges, ensuring that only authorized accounts can perform certain actions.
Timelock
The timelock package offers a library for scheduling, canceling, and executing time-locked operations in Gno. It ensures that operations are only carried out after a specified delay and provides mechanisms to manage and verify the status of these operations. The creation of the accesscontrol package was necessary to provide role and permission management required for the administrative tasks of timelock.
Use Cases
Accesscontrol
- Realm Administration Management: Create administrator roles to manage realms and assign or revoke roles as needed.
- Role-Based Access Control (RBAC): Implement an RBAC system to control who can access which resources and perform which actions within a Gno dApp.
- Security and Compliance: Use roles to ensure that only authorized individuals can perform critical actions, helping to meet security and compliance regulations.
Timelock
- Delayed Transactions: Schedule transactions or actions to be executed at a specific future time.
- Asset Locking: Implement asset locking mechanisms where users must wait for a certain period before they can access or move assets.
- Task Automation: Automate periodic or conditional tasks using specific time delays.
These examples of use cases are not exhaustive, and many other things are possible with these packages.
Contributors' checklist...
- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a
BREAKING CHANGE: xxxmessage was included in the description - [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to generated graphs, if any. More info here.
I'm just a contributor who enjoy your features, I leave a few comments (mainly nitpicks) hoping it's useful so we can have the best quality packages 🙏
@gnolang/tech-staff @kazai777 We are planning to use a timelock when implementing governance this time. What is the current status of the review for this PR?
@gnolang/tech-staff @kazai777 We are planning to use a
timelockwhen implementing governance this time. What is the current status of the review for this PR?
So far only @deelawn has reviewed it, we're waiting for the other reviews to come in. 🙃
@kazai777 @notJoon
Coming with a review today! Sorry for the delay 🙏🏻
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
:loudspeaker: Thoughts on this report? Let us know!
🛠 PR Checks Summary
All Automated Checks passed. ✅
Manual Checks (for Reviewers):
- [ ] IGNORE the bot requirements for this PR (force green CI check)
- [x] The pull request description provides enough details (checked by @thehowl)
Read More
🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.
✅ Automated Checks (for Contributors):
🟢 Maintainers must be able to edit this pull request (more info) 🟢 Pending initial approval by a review team member, or review from tech-staff
☑️ Contributor Actions:
- Fix any issues flagged by automated checks.
- Follow the Contributor Checklist to ensure your PR is ready for review.
- Add new tests, or document why they are unnecessary.
- Provide clear examples/screenshots, if necessary.
- Update documentation, if required.
- Ensure no breaking changes, or include
BREAKING CHANGEnotes. - Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
- Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)
If
🟢 Condition met └── 🟢 And ├── 🟢 The base branch matches this pattern: ^master$ └── 🟢 The pull request was created from a fork (head branch repo: kazai777/gno)Then
🟢 Requirement satisfied └── 🟢 Maintainer can modify this pull requestPending initial approval by a review team member, or review from tech-staff
If
🟢 Condition met └── 🟢 And ├── 🟢 The base branch matches this pattern: ^master$ └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)Then
🟢 Requirement satisfied └── 🟢 If ├── 🟢 Condition │ └── 🟢 Or │ ├── 🟢 At least 1 user(s) of the organization reviewed the pull request (with state "APPROVED") │ ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request │ └── 🔴 This pull request is a draft └── 🟢 Then └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)
If
🟢 Condition met └── 🟢 On every pull requestCan be checked by
- Any user with comment edit permission
The pull request description provides enough details
If
🟢 Condition met └── 🟢 And ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors) └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])Can be checked by
- team core-contributors
@DIGIX666 If you still want to work on this (apologies for the delay) can you update this PR and fix it up against master?
@DIGIX666 If you still want to work on this (apologies for the delay) can you update this PR and fix it up against master?
it's done 👍🏼
let's move these to a namespace other than
demo
It's done 👍🏼