Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

types.gno

1.89 Kb · 63 lines
 1// Package memba_notes_v1 stores versioned Markdown notes and their receipts.
 2// Publication is immutable; deployment is gated on the complete contract audit.
 3package memba_notes_v1
 4
 5import "gno.land/p/samcrew/avl"
 6
 7const RealmPath = "gno.land/r/samcrew/memba_notes_v1"
 8const ReserveAddress address = "g1jw76lxvzjafw2kyjhdnzwggcftyhnlfjaer2u0"
 9const (
10	ModePrivate uint8 = iota
11	ModeShared
12	ModeLink
13	ModePublic
14	ModePublicOpen
15)
16const (
17	MaxBodyBytes        = 131072
18	MaxCipherBodyBytes  = 135223
19	MaxTitleBytes       = 160
20	MaxCipherTitleBytes = 231
21	MaxReaders          = 32
22	MaxPage             = 50
23)
24
25type receipt struct {
26	Operation [16]byte
27	Actor     address
28	Height    int64
29}
30type note struct {
31	ID                                    [16]byte
32	Owner, PendingOwner                   address
33	OwnerGeneration                       uint64
34	Writers                               []address
35	Readers                               []address
36	OwnerIsRealm                          bool
37	Policies                              [3]string
38	RequestCount                          uint16
39	GovWriters                            bool
40	LastExecutor                          address
41	Mode                                  uint8
42	Revision, TitleRevision, BodyRevision uint64
43	Epoch                                 uint32
44	Title, Body, Commitment               []byte
45	BodyBytes                             int
46	CreatedHeight                         int64
47	Sequence                              uint64
48	CommentSequence                       uint64
49	Last                                  receipt
50	Deleted, Listed                       bool
51	ModeratorHidden                       bool
52}
53
54var notes = avl.NewTree()
55var ownerIndex = avl.NewTree()
56var publicIndex = avl.NewTree()
57var sharedIndex = avl.NewTree()
58var sequence uint64
59var busy bool
60var admin, pendingAdmin address
61var treasury = ReserveAddress
62var createFee int64 = 100000
63var paused bool