Search Apps Documentation Source Content File Folder Download Copy Actions Download

genesis.gno

0.91 Kb · 39 lines
 1package commondao
 2
 3import (
 4	"chain/runtime"
 5
 6	"gno.land/p/nt/commondao/v0"
 7)
 8
 9func init() {
10	// Create a DAO for the realm
11	id := daoID.Next()
12	dao := commondao.New(
13		commondao.WithID(uint64(id)),
14		commondao.WithName("Common DAO"),
15		commondao.WithDescription(
16			"This DAO is responsible for managing `commondao` realm functionalities.",
17		),
18	)
19
20	// Add initial members
21	dao.Members().Add("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
22	dao.Members().Add("g1manfred47kzduec920z88wfr64ylksmdcedlf5") // @moul
23
24	// Index DAO
25	daos.Set(id.String(), dao)
26
27	// Make commondao realm the owner of Common DAO
28	commonRealm := runtime.CurrentRealm()
29	ownership.Set(commonRealm.Address().String(), []uint64{CommonDAOID})
30
31	// Save DAO configuration
32	options.Set(id.String(), &Options{
33		AllowListing:       true,
34		AllowRender:        true,
35		AllowVoting:        true,
36		AllowExecution:     true,
37		AllowMembersUpdate: true,
38	})
39}