Search Apps Documentation Source Content File Folder Download Copy

gnode.gno

1.34 Kb ยท 65 lines
 1package gnode
 2
 3// XXX what about Gnodes signing on behalf of others?
 4// XXX like a multi-sig of Gnodes?
 5
 6type Name string
 7
 8type Gnode interface {
 9	//----------------------------------------
10	// Basic properties
11	GetName() Name
12
13	//----------------------------------------
14	// Affiliate Gnodes
15	NumAffiliates() int
16	GetAffiliates(Name) Affiliate
17	AddAffiliate(Affiliate) error // must be affiliated
18	RemAffiliate(Name) error      // must have become unaffiliated
19
20	//----------------------------------------
21	// Signing
22	NumSignedDocuments() int
23	GetSignedDocument(idx int) Document
24	SignDocument(doc Document) (int, error) // index relative to signer
25
26	//----------------------------------------
27	// Rendering
28	RenderLines() []string
29}
30
31type Affiliate struct {
32	Type  string
33	Gnode Gnode
34	Tags  []string
35}
36
37type MyGnode struct {
38	Name
39	// Owners     // voting set, something that gives authority of action.
40	// Treasury   //
41	// Affiliates //
42	// Board      // discussions
43	// Data       // XXX ?
44}
45
46type Affiliates []*Affiliate
47
48// Documents are equal if they compare equal.
49// NOTE: requires all fields to be comparable.
50type Document struct {
51	Authors string
52	// Timestamp
53	// Body
54	// Attachments
55}
56
57// ACTIONS
58
59// * Lend tokens
60// * Pay tokens
61// * Administrate transferrable and non-transferrable tokens
62// * Sum tokens
63// * Passthrough dependencies
64// * Code
65// * ...