Skip to content

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

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

Merged
merged 28 commits into from
Jul 18, 2025

Conversation

aeddi
Copy link
Contributor

@aeddi aeddi commented Jun 13, 2025

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/nt/treasury and p/aeddi/panictoerr packages.
  • Write a gno.land/pkg/integration/testdata/govdao_proposal_treasury_payment.txtar
  • Fix lint errors

Depends on #4373.

@aeddi aeddi requested review from moul and ajnavarro June 13, 2025 14:55
@aeddi aeddi self-assigned this Jun 13, 2025
@aeddi aeddi marked this pull request as draft June 13, 2025 14:55
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jun 13, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Jun 13, 2025

🛠 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

@aeddi aeddi changed the title feat: add a generic treasury and integrate it to the govdao v3 feat: add a generic treasury pkg and integrate it to the govdao v3 Jun 13, 2025
@aeddi aeddi requested a review from leohhhn June 18, 2025 10:31
Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

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

leaving some comments, didn't go through the whole thing yet. Need to go on a plane, coming back to this in a bit

@github-actions github-actions bot added 📦 ⛰️ gno.land Issues or PRs gno.land package related 🤝 contribs labels Jul 7, 2025
@Kouteki
Copy link
Contributor

Kouteki commented Jul 7, 2025

Closes #4094

@Kouteki Kouteki moved this from Triage to In Progress in 🧙‍♂️gno.land core team Jul 7, 2025
@Kouteki Kouteki added this to the 🚀 Mainnet beta launch milestone Jul 7, 2025
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@aeddi aeddi marked this pull request as ready for review July 16, 2025 20:27
@aeddi
Copy link
Contributor Author

aeddi commented Jul 17, 2025

@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 aeddi requested a review from leohhhn July 17, 2025 10:00
@leohhhn
Copy link
Contributor

leohhhn commented Jul 17, 2025

@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: #4464

@Kouteki Kouteki moved this from In Progress to In Review in 🧙‍♂️gno.land core team Jul 17, 2025
@aeddi
Copy link
Contributor Author

aeddi commented Jul 18, 2025

@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.

Copy link
Contributor

@ajnavarro ajnavarro left a comment

Choose a reason for hiding this comment

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

I found some performance improvements that might cause node crashes when a lot of transactions are rendered.

Also, I proposed a solution to avoid having public functions only intended for tests.

Apart from that, LGTM. We can merge what we have and add these improvements later on, to start iterating.

@aeddi aeddi merged commit 688d110 into gnolang:master Jul 18, 2025
125 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in 💪 Bounties & Worx Jul 18, 2025
@aeddi aeddi deleted the dev/aeddi/govdao-treasury branch July 18, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤝 contribs 📦 ⛰️ gno.land Issues or PRs gno.land package related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants