Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Nov 20, 2024
1 parent 16fe3b4 commit a3fb34b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
3 changes: 3 additions & 0 deletions examples/gno.land/p/moul/xdao/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module gno.land/p/moul/xdao

require gno.land/p/moul/udao v0.0.0-latest
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Package whitelist is a simple udao implementation that allow any whitelisted address to manage proposals.
package whitelist
package xdao

import (
"std"
Expand All @@ -11,14 +10,14 @@ import (
// It can allow a trusted list of addresses to share the administration of realms that are designed to be managed by "DAOs".
// It's not a DAO per say. But makes sense to be used to bootstrap a realm until the DAO can replace itself with a really decnetralized autonomous organization. Asan inception.
// It's also useful for people who manages multiple keys, like on different computers so they can simulte being a single entity while managing several addresses.
type DAO struct {
type WhitelistDAO struct {
admins []std.Address // for the sake of simplicity and because this simple DAO implementation isn't designed to scale, we just keep a simple slice
}

// check that DAO implements the udao.DAO interface.
var _ udao.DAO = (*DAO)(nil)
var _ udao.DAO = (*WhitelistDAO)(nil)

func New() *DAO {
func NewWhitelistDAO() *WhitelistDAO {
caller := std.PrevRealm().Addr()
return &DAO{
admins: []std.Address{caller},
Expand All @@ -28,15 +27,18 @@ func New() *DAO {
// udao.DAO methods
//

func (d *DAO) Propose(prop udao.Proposal) (uint64, error) { panic("not implemented") }
func (d DAO) GetProposalStatus(id uint64) (udao.ProposalStatus, error) { panic("not implemented") }
func (d *DAO) Execute(id uint64) error { panic("not implemented") }
func (d DAO) GetProposal(id uint64) (udao.Proposal, error) { panic("not implemented") }
func (d *WhitelistDAO) Propose(prop udao.Proposal) (uint64, error) { panic("not implemented") }

func (d WhitelistDAO) GetProposalStatus(id uint64) (udao.ProposalStatus, error) {
panic("not implemented")
}
func (d *WhitelistDAO) Execute(id uint64) error { panic("not implemented") }
func (d WhitelistDAO) GetProposal(id uint64) (udao.Proposal, error) { panic("not implemented") }

// other methods
//

func (d *DAO) AddAdmin(addr std.Address) { panic("not implemented") }
func (d *DAO) DelAdmin(addr std.Address) { panic("not implemented") }
func (d DAO) ListAdmins() []std.Address { return d.admins[:] }
func (d DAO) Render(path string) string { return "TODO" }
func (d *WhitelistDAO) AddAdmin(addr std.Address) { panic("not implemented") }
func (d *WhitelistDAO) DelAdmin(addr std.Address) { panic("not implemented") }
func (d WhitelistDAO) ListAdmins() []std.Address { return d.admins[:] }
func (d WhitelistDAO) Render(path string) string { return "TODO" }
4 changes: 2 additions & 2 deletions examples/gno.land/r/manfred/dao/dao.gno
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dao

import "gno.land/p/moul/udao/whitelist"
import "gno.land/p/moul/xdao"

var DAO = whitelist.New()
var DAO = xdao.NewWhitelistDAO()

func Render(path string) string {
return DAO.Render(path)
Expand Down
4 changes: 3 additions & 1 deletion examples/gno.land/r/manfred/dao/gno.mod
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module gno.land/r/manfred/dao
module gno.land/r/manfred/dao

require gno.land/p/moul/xdao v0.0.0-latest
6 changes: 5 additions & 1 deletion examples/gno.land/r/manfred/home/gno.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module gno.land/r/manfred/home

require gno.land/r/manfred/config v0.0.0-latest
require (
gno.land/p/moul/udao v0.0.0-latest
gno.land/r/manfred/config v0.0.0-latest
gno.land/r/moul/dao v0.0.0-latest
)

0 comments on commit a3fb34b

Please sign in to comment.