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(examples): add p/thox/{accesscontrol,timelock} #2307

Merged
merged 110 commits into from
Mar 5, 2025

Conversation

kazai777
Copy link
Contributor

@kazai777 kazai777 commented Jun 7, 2024

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: xxx message 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.

@kazai777 kazai777 requested review from a team as code owners June 7, 2024 21:09
@kazai777 kazai777 requested review from thehowl and ltzmaxwell and removed request for a team June 7, 2024 21:09
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jun 7, 2024
Copy link
Contributor

@deelawn deelawn left a comment

Choose a reason for hiding this comment

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

Great stuff -- looks pretty good overall. There are some things that I think need to be changed and a bunch of other comments asking questions about why something is the way it is.

mous1985 and others added 2 commits June 8, 2024 09:55
Co-authored-by: deelawn <dboltz03@gmail.com>
Co-authored-by: deelawn <dboltz03@gmail.com>
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Feb 20, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
  • 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:
  1. Fix any issues flagged by automated checks.
  2. 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 CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. 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 request

Pending 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 request

Can 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

@thehowl
Copy link
Member

thehowl commented Feb 20, 2025

@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
Copy link
Contributor

@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 👍🏼

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

let's move these to a namespace other than demo

@DIGIX666
Copy link
Contributor

DIGIX666 commented Mar 4, 2025

let's move these to a namespace other than demo

It's done 👍🏼

@thehowl thehowl changed the title feat: p/demo/accesscontrol & p/demo/timelock feat(examples): add p/thox/{accesscontrol,timelock} Mar 5, 2025
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

good with the flexibility we're allowing for examples/ pkgs

@thehowl thehowl merged commit cbaaf39 into gnolang:master Mar 5, 2025
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.