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{"g158vx2ckhwqtl5c66c2wnt8zupfmd0ary9ngv6l"},
23 Gatekeepers: []string{},
24 Title: "Samouraï Friends Night",
25 Description: "**Samouraï Friends Night** is a free and open afterwork in Paris aiming to gather a diversity of humans from creative world and open source world around beers.\n\nPeople joining are composing a big patchwork of humans, like open source developers, distributed protocol engineers, film makers, designers, motion designers, smart contract hackers, builders for commons.\nYou can invite your friends, wherever they come from.\n\nThere you'll find friends to discuss open source, tech, art, and future of humanity.\n\nThis even is powered by Samouraï Coop crew : \nhttps://www.samourai.world",
26 ImageURI: "ipfs://bafybeie6evrjz2fmcpaey23t7yvp5azm5ftfx63ycp3ls4ax6657mc4zvy",
27 StartDate: 1742590800,
28 EndDate: 1742612100,
29 Capacity: 150,
30 GetProfileString: profile.GetStringField,
31 SetProfileString: profile.SetStringField,
32 ZenaoAdminAddr: "g1djrkw9tf4px658j85cc6fhsvm50uf9s0g6kfsm",
33 Location: &zenaov1.EventLocation{
34 Address: &zenaov1.AddressCustom{
35 Address: "150",
36 Timezone: "America/Santiago",
37 },
38 },
39 ParticipationPubkey: "",
40 }
41 event = events.NewEvent(&conf)
42 daoPrivate = event.DAOPrivate
43 DAO = event.DAO
44 eventreg.Register(func() *zenaov1.EventInfo { return event.Info() })
45 social_feed.NewFeed("main", false, IsMember)
46}
47
48// Set public to be used as auth layer for external entities (e.g polls)
49func IsMember(memberId string) bool {
50 return daoPrivate.Members.IsMember(memberId)
51}
52
53func Vote(proposalID uint64, vote daocond.Vote) {
54 DAO.Vote(proposalID, vote)
55}
56
57func Execute(proposalID uint64) {
58 DAO.Execute(proposalID)
59}
60
61func Render(path string) string {
62 return event.Render(path)
63}
event.gno
2.17 Kb · 63 lines