diff --git a/examples/gno.land/p/moul/xdao/gno.mod b/examples/gno.land/p/moul/xdao/gno.mod new file mode 100644 index 00000000000..c4ab72acfeb --- /dev/null +++ b/examples/gno.land/p/moul/xdao/gno.mod @@ -0,0 +1,3 @@ +module gno.land/p/moul/xdao + +require gno.land/p/moul/udao v0.0.0-latest diff --git a/examples/gno.land/p/moul/udao/whitelist/whitelist.gno b/examples/gno.land/p/moul/xdao/xdao.gno similarity index 51% rename from examples/gno.land/p/moul/udao/whitelist/whitelist.gno rename to examples/gno.land/p/moul/xdao/xdao.gno index bd85578dadd..84b17846f9b 100644 --- a/examples/gno.land/p/moul/udao/whitelist/whitelist.gno +++ b/examples/gno.land/p/moul/xdao/xdao.gno @@ -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" @@ -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}, @@ -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" } diff --git a/examples/gno.land/r/manfred/dao/dao.gno b/examples/gno.land/r/manfred/dao/dao.gno index 5805175a255..428c4eddc59 100644 --- a/examples/gno.land/r/manfred/dao/dao.gno +++ b/examples/gno.land/r/manfred/dao/dao.gno @@ -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) diff --git a/examples/gno.land/r/manfred/dao/gno.mod b/examples/gno.land/r/manfred/dao/gno.mod index 657ad601848..e8ce9a4289f 100644 --- a/examples/gno.land/r/manfred/dao/gno.mod +++ b/examples/gno.land/r/manfred/dao/gno.mod @@ -1 +1,3 @@ -module gno.land/r/manfred/dao \ No newline at end of file +module gno.land/r/manfred/dao + +require gno.land/p/moul/xdao v0.0.0-latest diff --git a/examples/gno.land/r/manfred/home/gno.mod b/examples/gno.land/r/manfred/home/gno.mod index 6e7aac70cc7..b77af3bb43b 100644 --- a/examples/gno.land/r/manfred/home/gno.mod +++ b/examples/gno.land/r/manfred/home/gno.mod @@ -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 +)