gno icon indicating copy to clipboard operation
gno copied to clipboard

feat: add a generic treasury pkg and integrate it to the govdao v3

Open aeddi opened this issue 6 months ago β€’ 1 comments

This PR:

  • Adds a p/demo/treasury package meant to be generic / reusable by other Realms and DAOs. It can use multiple Banker, currently two are implemented:
    • a GRC20 tokens banker
    • a std.Coins banker
  • Adds a r/gov/dao/v3/treasury Realms that use this p/demo/treasury package.
  • Adds a NewTreasuryPaymentRequest() method to the govdao.

There are some 'NOTE' comments in these changes on points where I was uncertain. Also I'm not sure if the path are relevant for both p/demo/treasury and p/aeddi/utils packages.

To Do:

  • [ ] Finish writing tests in p/demo/treasury and p/aeddi/panictoerr packages.
  • [ ] Write a gno.land/pkg/integration/testdata/govdao_proposal_treasury_payment.txtar
  • [ ] Fix lint errors

Depends on https://github.com/gnolang/gno/pull/4373.

aeddi avatar Jun 13 '25 14:06 aeddi

πŸ›  PR Checks Summary

All Automated Checks passed. βœ…

Manual Checks (for Reviewers):
  • [ ] IGNORE the bot requirements for this PR (force green CI check)
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)

β˜‘οΈ 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: aeddi/gno)

Then

🟒 Requirement satisfied
└── 🟒 Maintainer can modify this pull request

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

Gno2D2 avatar Jun 13 '25 14:06 Gno2D2

Closes https://github.com/gnolang/gno/issues/4094

Kouteki avatar Jul 07 '25 10:07 Kouteki

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Jul 16 '25 17:07 codecov[bot]

@moul @zivkovicmilos The tests are working now. Do we only authorize govdao members (or even only members of a specific tier) to:

  1. Create a payment proposal
(https://github.com/gnolang/gno/pull/4374/files#diff-3a2d1baf6d57fe1d2380abbaea30f64e29eb17ec13dab348d79e205e11f984edR146)
  2. Vote on a payment proposal (https://github.com/gnolang/gno/pull/4374/files#diff-3a2d1baf6d57fe1d2380abbaea30f64e29eb17ec13dab348d79e205e11f984edR171)

aeddi avatar Jul 17 '25 09:07 aeddi

@aeddi

Generally props for GovDAO are allowed only by the members; so you do not need to check for this in your realms. About tiering, that's a different topic and I don't have an answer to that.

ie, this was added to govdao v3 recently: https://github.com/gnolang/gno/pull/4464

leohhhn avatar Jul 17 '25 10:07 leohhhn

@moul @zivkovicmilos The tests are working now. Do we only authorize govdao members (or even only members of a specific tier) to:

  1. Create a payment proposal
 (#4374 (files))
  2. Vote on a payment proposal (#4374 (files))

I discussed this point with @zivkovicmilos on another discussion channel, and we concluded the current limitation to DAO members was enough to merge this PR as is. We will potentially add filters (dynamic or not) in the future.

aeddi avatar Jul 18 '25 14:07 aeddi