event.gno

2.27 Kb ยท 62 lines
 1package event
 2
 3import (
 4	"gno.land/p/zenao/basedao"
 5	"gno.land/p/zenao/daocond"
 6	"gno.land/p/zenao/daokit"
 7	"gno.land/p/zenao/events"
 8	zenaov1 "gno.land/p/zenao/zenao/v1"
 9	"gno.land/r/demo/profile"
10	"gno.land/r/zenao/eventreg"
11	"gno.land/r/zenao/social_feed"
12)
13
14var (
15	DAO        daokit.DAO
16	daoPrivate *basedao.DAOPrivate
17	event      *events.Event
18)
19
20func init() {
21	conf := events.Config{
22		Organizers:       []string{"g1kthljn2vefxm732kaj9t8xq6khzymqa7ljwaf0"},
23		Gatekeepers:      []string{},
24		Title:            "Gno Contributors Call (Demo event)",
25		Description:      "# Contributor Technical Discussions (demo event)\n\n*To goal of this meeting is to have structured, in depth technical discussions between the contributors and the gno.land core team.*\n\nIf you have a demo or a discussion to propose, simply put it on the list, along with the proposer name. The proposer is expected to hold the demo, or to set the stage for the discussion.\n\nNominate the topics in HackMD to add it to the meeting agenda:\n- Demos (submitted beforehand)\n- Technical discussions (submitted beforehand)\n- Technical discussions (ad-hoc)\n\n---\nNote:\nThis event is for demo on the today's gno contributor call.\nComplementary discussions on the dedicated Signal group.",
26		ImageURI:         "ipfs://bafkreic5rmvpjo74xtli4zwdiy5kmmlbhucz7dz2t6cf3itrp2ifhw7vgi",
27		StartDate:        1746036000,
28		EndDate:          1746049500,
29		Capacity:         50,
30		GetProfileString: profile.GetStringField,
31		SetProfileString: profile.SetStringField,
32		ZenaoAdminAddr:   "g1djrkw9tf4px658j85cc6fhsvm50uf9s0g6kfsm",
33		Location: &zenaov1.EventLocation{
34			Address: &zenaov1.AddressVirtual{
35				Uri: "https://meet.google.com/omw-duip-jmi",
36			},
37		},
38		ParticipationPubkey: "",
39	}
40	event = events.NewEvent(&conf)
41	daoPrivate = event.DAOPrivate
42	DAO = event.DAO
43	eventreg.Register(func() *zenaov1.EventInfo { return event.Info() })
44	social_feed.NewFeed("main", false, IsMember)
45}
46
47// Set public to be used as auth layer for external entities (e.g polls)
48func IsMember(memberId string) bool {
49	return daoPrivate.Members.IsMember(memberId)
50}
51
52func Vote(proposalID uint64, vote daocond.Vote) {
53	DAO.Vote(proposalID, vote)
54}
55
56func Execute(proposalID uint64) {
57	DAO.Execute(proposalID)
58}
59
60func Render(path string) string {
61	return event.Render(path)
62}