event.gno

1.62 Kb · 54 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)
12
13var (
14	DAO        daokit.DAO
15	daoPrivate *basedao.DAOPrivate
16	event      *events.Event
17)
18
19func init() {
20	conf := events.Config{
21		Creator:          "g1mvfv0chg625pacmq8f3pwxz4clvnrcg9avwkr2",
22		Title:            "Release",
23		Description:      "I'M JUST A LOST GUY – REVEAL PROJECTION FEBRUARY 25, 2025\n\nIs this the life you once imagined?\nDid you choose this path, or did it choose you?\nSometimes, getting lost is the only way to figure things out.\n\nOn February 25, 2025, take a step back and see where the journey leads.\n\n#ImJustALostGuy #ShortFilm #FindingTheWay",
24		ImageURI:         "ipfs://bafybeidpd3ydnbxidme65pcyeqnlnjswbh3rgzszifwqik5vnp3j67sl24",
25		StartDate:        1740506400,
26		EndDate:          1740520800,
27		Capacity:         150,
28		GetProfileString: profile.GetStringField,
29		SetProfileString: profile.SetStringField,
30		ZenaoAdminAddr:   "g1djrkw9tf4px658j85cc6fhsvm50uf9s0g6kfsm",
31		Location: &zenaov1.EventLocation{
32			Address: &zenaov1.AddressCustom{
33				Address:  "1 Bd Poissonnière, 75002 Paris",
34				Timezone: "Europe/Paris",
35			},
36		},
37	}
38	event = events.NewEvent(&conf)
39	daoPrivate = event.DAOPrivate
40	DAO = event.DAO
41	eventreg.Register(func() *zenaov1.EventInfo { return event.Info() })
42}
43
44func Vote(proposalID uint64, vote daocond.Vote) {
45	DAO.Vote(proposalID, vote)
46}
47
48func Execute(proposalID uint64) {
49	DAO.Execute(proposalID)
50}
51
52func Render(path string) string {
53	return event.Render(path)
54}