@ottochain/sdk 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/apps/contracts/index.js +6 -10
  2. package/dist/cjs/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +381 -330
  3. package/dist/cjs/apps/corporate/index.js +12 -24
  4. package/dist/cjs/apps/corporate/state-machines/index.js +10246 -0
  5. package/dist/cjs/apps/governance/index.js +11 -22
  6. package/dist/cjs/apps/governance/state-machines/index.js +4755 -0
  7. package/dist/cjs/apps/identity/index.js +3 -6
  8. package/dist/{esm/apps/identity/state-machines/agent-identity.json → cjs/apps/identity/state-machines/index.js} +9 -2
  9. package/dist/cjs/apps/markets/index.js +2 -5
  10. package/dist/{esm/apps/markets/state-machines/market-universal.json → cjs/apps/markets/state-machines/index.js} +9 -2
  11. package/dist/cjs/apps/oracles/index.js +2 -5
  12. package/dist/{esm/apps/oracles/state-machines/oracle.json → cjs/apps/oracles/state-machines/index.js} +9 -2
  13. package/dist/cjs/ottochain/index.js +4 -1
  14. package/dist/cjs/ottochain/normalize.js +17 -3
  15. package/dist/cjs/ottochain/types.js +12 -0
  16. package/dist/esm/apps/contracts/index.js +2 -3
  17. package/dist/esm/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +378 -330
  18. package/dist/esm/apps/corporate/index.js +2 -11
  19. package/dist/esm/apps/corporate/state-machines/index.js +10243 -0
  20. package/dist/esm/apps/governance/index.js +2 -10
  21. package/dist/esm/apps/governance/state-machines/index.js +4752 -0
  22. package/dist/esm/apps/identity/index.js +2 -2
  23. package/dist/{cjs/apps/identity/state-machines/agent-identity.json → esm/apps/identity/state-machines/index.js} +6 -2
  24. package/dist/esm/apps/markets/index.js +1 -1
  25. package/dist/{cjs/apps/markets/state-machines/market-universal.json → esm/apps/markets/state-machines/index.js} +6 -2
  26. package/dist/esm/apps/oracles/index.js +1 -1
  27. package/dist/{cjs/apps/oracles/state-machines/oracle.json → esm/apps/oracles/state-machines/index.js} +6 -2
  28. package/dist/esm/ottochain/index.js +2 -0
  29. package/dist/esm/ottochain/normalize.js +17 -3
  30. package/dist/esm/ottochain/types.js +11 -1
  31. package/dist/types/apps/contracts/state-machines/index.d.ts +549 -0
  32. package/dist/types/apps/corporate/state-machines/index.d.ts +9121 -0
  33. package/dist/types/apps/governance/state-machines/index.d.ts +3551 -0
  34. package/dist/types/apps/identity/state-machines/index.d.ts +206 -0
  35. package/dist/types/apps/markets/state-machines/index.d.ts +448 -0
  36. package/dist/types/apps/oracles/state-machines/index.d.ts +312 -0
  37. package/dist/types/ottochain/index.d.ts +2 -1
  38. package/dist/types/ottochain/normalize.d.ts +14 -0
  39. package/dist/types/ottochain/types.d.ts +9 -0
  40. package/package.json +4 -3
  41. package/dist/cjs/apps/contracts/state-machines/contract.json +0 -352
  42. package/dist/cjs/apps/contracts/state-machines/escrow.json +0 -354
  43. package/dist/cjs/apps/corporate/state-machines/corporate-board.json +0 -1064
  44. package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  45. package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +0 -957
  46. package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  47. package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +0 -861
  48. package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +0 -843
  49. package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +0 -783
  50. package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  51. package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +0 -1215
  52. package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  53. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +0 -667
  54. package/dist/cjs/apps/governance/state-machines/dao-single.json +0 -230
  55. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +0 -624
  56. package/dist/cjs/apps/governance/state-machines/dao-token.json +0 -638
  57. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +0 -357
  58. package/dist/cjs/apps/governance/state-machines/governance-executive.json +0 -387
  59. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +0 -558
  60. package/dist/cjs/apps/governance/state-machines/governance-simple.json +0 -625
  61. package/dist/esm/apps/contracts/state-machines/contract.json +0 -352
  62. package/dist/esm/apps/contracts/state-machines/escrow.json +0 -354
  63. package/dist/esm/apps/corporate/state-machines/corporate-board.json +0 -1064
  64. package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  65. package/dist/esm/apps/corporate/state-machines/corporate-committee.json +0 -957
  66. package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  67. package/dist/esm/apps/corporate/state-machines/corporate-entity.json +0 -861
  68. package/dist/esm/apps/corporate/state-machines/corporate-officers.json +0 -843
  69. package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +0 -783
  70. package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  71. package/dist/esm/apps/corporate/state-machines/corporate-securities.json +0 -1215
  72. package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  73. package/dist/esm/apps/governance/state-machines/dao-multisig.json +0 -667
  74. package/dist/esm/apps/governance/state-machines/dao-single.json +0 -230
  75. package/dist/esm/apps/governance/state-machines/dao-threshold.json +0 -624
  76. package/dist/esm/apps/governance/state-machines/dao-token.json +0 -638
  77. package/dist/esm/apps/governance/state-machines/governance-constitution.json +0 -357
  78. package/dist/esm/apps/governance/state-machines/governance-executive.json +0 -387
  79. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +0 -558
  80. package/dist/esm/apps/governance/state-machines/governance-simple.json +0 -625
@@ -1,751 +0,0 @@
1
- {
2
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3
- "name": "corporate-bylaws",
4
- "version": "1.0.0",
5
- "category": "corporate-governance",
6
- "description": "Bylaws state machine tracking the adoption, amendment, and restatement of corporate bylaws. Maintains version history and amendment requirements.",
7
- "context": {
8
- "bylawsId": {
9
- "type": "string",
10
- "description": "Unique identifier for this bylaws instance"
11
- },
12
- "entityId": {
13
- "type": "string",
14
- "description": "Reference to parent corporate-entity"
15
- },
16
- "currentVersion": {
17
- "type": "string",
18
- "description": "Current version number (semantic versioning)"
19
- },
20
- "originalAdoptionDate": {
21
- "type": "string",
22
- "format": "date"
23
- },
24
- "lastAmendedDate": {
25
- "type": "string",
26
- "format": "date",
27
- "nullable": true
28
- },
29
- "documentRef": {
30
- "type": "string",
31
- "description": "Reference to current bylaws document"
32
- },
33
- "sections": {
34
- "type": "array",
35
- "description": "Bylaws organized by section",
36
- "items": {
37
- "type": "object",
38
- "properties": {
39
- "sectionId": {
40
- "type": "string"
41
- },
42
- "sectionNumber": {
43
- "type": "string",
44
- "description": "e.g., 'Article III, Section 2'"
45
- },
46
- "title": {
47
- "type": "string"
48
- },
49
- "content": {
50
- "type": "string"
51
- },
52
- "amendmentRequirement": {
53
- "type": "string",
54
- "enum": [
55
- "BOARD_ONLY",
56
- "BOARD_OR_SHAREHOLDERS",
57
- "SHAREHOLDERS_ONLY",
58
- "SUPERMAJORITY_SHAREHOLDERS"
59
- ],
60
- "description": "Who can amend this section"
61
- },
62
- "supermajorityThreshold": {
63
- "type": "number",
64
- "nullable": true
65
- },
66
- "lastModifiedVersion": {
67
- "type": "string"
68
- }
69
- }
70
- }
71
- },
72
- "keyProvisions": {
73
- "type": "object",
74
- "description": "Quick reference to key bylaw provisions",
75
- "properties": {
76
- "boardSize": {
77
- "type": "object",
78
- "properties": {
79
- "minimum": {
80
- "type": "integer"
81
- },
82
- "maximum": {
83
- "type": "integer"
84
- },
85
- "sectionRef": {
86
- "type": "string"
87
- }
88
- }
89
- },
90
- "quorumRequirements": {
91
- "type": "object",
92
- "properties": {
93
- "boardQuorum": {
94
- "type": "number"
95
- },
96
- "shareholderQuorum": {
97
- "type": "number"
98
- },
99
- "sectionRef": {
100
- "type": "string"
101
- }
102
- }
103
- },
104
- "meetingNotice": {
105
- "type": "object",
106
- "properties": {
107
- "annualMeetingNotice": {
108
- "type": "integer",
109
- "description": "Days of notice required"
110
- },
111
- "specialMeetingNotice": {
112
- "type": "integer"
113
- },
114
- "boardMeetingNotice": {
115
- "type": "integer"
116
- },
117
- "sectionRef": {
118
- "type": "string"
119
- }
120
- }
121
- },
122
- "indemnification": {
123
- "type": "object",
124
- "properties": {
125
- "directorsIndemnified": {
126
- "type": "boolean"
127
- },
128
- "officersIndemnified": {
129
- "type": "boolean"
130
- },
131
- "mandatory": {
132
- "type": "boolean"
133
- },
134
- "advancementOfExpenses": {
135
- "type": "boolean"
136
- },
137
- "sectionRef": {
138
- "type": "string"
139
- }
140
- }
141
- },
142
- "specialMeetingThreshold": {
143
- "type": "object",
144
- "properties": {
145
- "boardCanCall": {
146
- "type": "boolean"
147
- },
148
- "shareholderThreshold": {
149
- "type": "number",
150
- "description": "% of shares to call special meeting"
151
- },
152
- "sectionRef": {
153
- "type": "string"
154
- }
155
- }
156
- }
157
- }
158
- },
159
- "pendingAmendment": {
160
- "type": "object",
161
- "nullable": true,
162
- "properties": {
163
- "amendmentId": {
164
- "type": "string"
165
- },
166
- "description": {
167
- "type": "string"
168
- },
169
- "proposedBy": {
170
- "type": "string"
171
- },
172
- "proposedDate": {
173
- "type": "string",
174
- "format": "date"
175
- },
176
- "sectionsAffected": {
177
- "type": "array",
178
- "items": {
179
- "type": "string"
180
- }
181
- },
182
- "proposedChanges": {
183
- "type": "array",
184
- "items": {
185
- "type": "object"
186
- }
187
- },
188
- "approvalRequired": {
189
- "type": "string"
190
- },
191
- "boardApprovalRef": {
192
- "type": "string",
193
- "nullable": true
194
- },
195
- "shareholderApprovalRef": {
196
- "type": "string",
197
- "nullable": true
198
- },
199
- "status": {
200
- "type": "string",
201
- "enum": [
202
- "PROPOSED",
203
- "BOARD_APPROVED",
204
- "SHAREHOLDER_APPROVED",
205
- "REJECTED"
206
- ]
207
- }
208
- }
209
- },
210
- "amendmentHistory": {
211
- "type": "array",
212
- "items": {
213
- "type": "object",
214
- "properties": {
215
- "amendmentId": {
216
- "type": "string"
217
- },
218
- "version": {
219
- "type": "string"
220
- },
221
- "description": {
222
- "type": "string"
223
- },
224
- "sectionsAffected": {
225
- "type": "array",
226
- "items": {
227
- "type": "string"
228
- }
229
- },
230
- "effectiveDate": {
231
- "type": "string",
232
- "format": "date"
233
- },
234
- "approvedBy": {
235
- "type": "string",
236
- "enum": [
237
- "BOARD",
238
- "SHAREHOLDERS",
239
- "BOTH"
240
- ]
241
- },
242
- "boardResolutionRef": {
243
- "type": "string",
244
- "nullable": true
245
- },
246
- "shareholderResolutionRef": {
247
- "type": "string",
248
- "nullable": true
249
- },
250
- "documentRef": {
251
- "type": "string"
252
- }
253
- }
254
- }
255
- },
256
- "createdAt": {
257
- "type": "string",
258
- "format": "date-time"
259
- },
260
- "updatedAt": {
261
- "type": "string",
262
- "format": "date-time"
263
- }
264
- },
265
- "states": {
266
- "DRAFT": {
267
- "description": "Initial bylaws being drafted prior to incorporation or adoption",
268
- "metadata": null
269
- },
270
- "ADOPTED": {
271
- "description": "Bylaws have been formally adopted and are in effect",
272
- "metadata": null
273
- },
274
- "AMENDING": {
275
- "description": "Amendment in progress - proposed changes pending approval",
276
- "metadata": null
277
- }
278
- },
279
- "initialState": "DRAFT",
280
- "transitions": {
281
- "adopt": {
282
- "from": "DRAFT",
283
- "to": "ADOPTED",
284
- "description": "Initial adoption of bylaws (typically by incorporators or initial board)",
285
- "event": {
286
- "name": "adopt",
287
- "payload": {
288
- "adoptionDate": {
289
- "type": "string",
290
- "format": "date",
291
- "required": true
292
- },
293
- "adoptedBy": {
294
- "type": "string",
295
- "enum": [
296
- "INCORPORATORS",
297
- "INITIAL_BOARD"
298
- ],
299
- "required": true
300
- },
301
- "resolutionRef": {
302
- "type": "string",
303
- "required": true
304
- },
305
- "documentRef": {
306
- "type": "string",
307
- "required": true
308
- },
309
- "sections": {
310
- "type": "array",
311
- "required": true
312
- },
313
- "keyProvisions": {
314
- "type": "object"
315
- }
316
- }
317
- },
318
- "effects": [
319
- {
320
- "type": "SET_CONTEXT",
321
- "path": "currentVersion",
322
- "value": "1.0.0"
323
- },
324
- {
325
- "type": "SET_CONTEXT",
326
- "path": "originalAdoptionDate",
327
- "value": "{{ event.adoptionDate }}"
328
- },
329
- {
330
- "type": "SET_CONTEXT",
331
- "path": "documentRef",
332
- "value": "{{ event.documentRef }}"
333
- },
334
- {
335
- "type": "SET_CONTEXT",
336
- "path": "sections",
337
- "value": "{{ event.sections }}"
338
- },
339
- {
340
- "type": "SET_CONTEXT",
341
- "path": "keyProvisions",
342
- "value": "{{ event.keyProvisions }}"
343
- },
344
- {
345
- "type": "EMIT_EVENT",
346
- "eventType": "BYLAWS_ADOPTED",
347
- "payload": {
348
- "entityId": "{{ context.entityId }}",
349
- "bylawsId": "{{ context.bylawsId }}",
350
- "version": "1.0.0"
351
- }
352
- }
353
- ]
354
- },
355
- "propose_amendment": {
356
- "from": "ADOPTED",
357
- "to": "AMENDING",
358
- "description": "Propose an amendment to the bylaws",
359
- "event": {
360
- "name": "propose_amendment",
361
- "payload": {
362
- "amendmentId": {
363
- "type": "string",
364
- "required": true
365
- },
366
- "description": {
367
- "type": "string",
368
- "required": true
369
- },
370
- "proposedBy": {
371
- "type": "string",
372
- "required": true,
373
- "description": "Director ID, officer ID, or SHAREHOLDER_PROPOSAL"
374
- },
375
- "sectionsAffected": {
376
- "type": "array",
377
- "items": {
378
- "type": "string"
379
- },
380
- "required": true
381
- },
382
- "proposedChanges": {
383
- "type": "array",
384
- "required": true,
385
- "items": {
386
- "type": "object",
387
- "properties": {
388
- "sectionId": {
389
- "type": "string"
390
- },
391
- "changeType": {
392
- "type": "string",
393
- "enum": [
394
- "MODIFY",
395
- "ADD",
396
- "DELETE"
397
- ]
398
- },
399
- "currentContent": {
400
- "type": "string"
401
- },
402
- "proposedContent": {
403
- "type": "string"
404
- }
405
- }
406
- }
407
- }
408
- }
409
- },
410
- "guards": [
411
- {
412
- "name": "validProposer",
413
- "description": "Amendment must be proposed by authorized party",
414
- "expression": "true"
415
- }
416
- ],
417
- "effects": [
418
- {
419
- "type": "COMPUTE",
420
- "path": "pendingAmendment.approvalRequired",
421
- "expression": "context.sections.filter(s => event.sectionsAffected.includes(s.sectionId)).some(s => s.amendmentRequirement === 'SHAREHOLDERS_ONLY' || s.amendmentRequirement === 'SUPERMAJORITY_SHAREHOLDERS') ? 'SHAREHOLDERS_REQUIRED' : 'BOARD_ONLY'"
422
- },
423
- {
424
- "type": "SET_CONTEXT",
425
- "path": "pendingAmendment",
426
- "value": {
427
- "amendmentId": "{{ event.amendmentId }}",
428
- "description": "{{ event.description }}",
429
- "proposedBy": "{{ event.proposedBy }}",
430
- "proposedDate": "{{ today() }}",
431
- "sectionsAffected": "{{ event.sectionsAffected }}",
432
- "proposedChanges": "{{ event.proposedChanges }}",
433
- "status": "PROPOSED"
434
- }
435
- },
436
- {
437
- "type": "EMIT_EVENT",
438
- "eventType": "BYLAW_AMENDMENT_PROPOSED",
439
- "payload": {
440
- "entityId": "{{ context.entityId }}",
441
- "amendmentId": "{{ event.amendmentId }}",
442
- "sectionsAffected": "{{ event.sectionsAffected }}"
443
- }
444
- }
445
- ]
446
- },
447
- "board_approve_amendment": {
448
- "from": "AMENDING",
449
- "to": "AMENDING",
450
- "description": "Board approves the proposed amendment",
451
- "event": {
452
- "name": "board_approve_amendment",
453
- "payload": {
454
- "resolutionRef": {
455
- "type": "string",
456
- "required": true
457
- },
458
- "approvalDate": {
459
- "type": "string",
460
- "format": "date",
461
- "required": true
462
- }
463
- }
464
- },
465
- "guards": [
466
- {
467
- "name": "hasPendingAmendment",
468
- "expression": "context.pendingAmendment != null && context.pendingAmendment.status === 'PROPOSED'"
469
- },
470
- {
471
- "name": "boardResolutionExecuted",
472
- "crossMachine": {
473
- "machine": "corporate-resolution",
474
- "instanceRef": "{{ event.resolutionRef }}",
475
- "requiredState": "EXECUTED"
476
- }
477
- }
478
- ],
479
- "effects": [
480
- {
481
- "type": "SET_CONTEXT",
482
- "path": "pendingAmendment.boardApprovalRef",
483
- "value": "{{ event.resolutionRef }}"
484
- },
485
- {
486
- "type": "SET_CONTEXT",
487
- "path": "pendingAmendment.status",
488
- "value": "BOARD_APPROVED"
489
- }
490
- ]
491
- },
492
- "approve_amendment": {
493
- "from": "AMENDING",
494
- "to": "ADOPTED",
495
- "description": "Finalize and approve the amendment (after required approvals obtained)",
496
- "event": {
497
- "name": "approve_amendment",
498
- "payload": {
499
- "effectiveDate": {
500
- "type": "string",
501
- "format": "date",
502
- "required": true
503
- },
504
- "shareholderResolutionRef": {
505
- "type": "string",
506
- "description": "Required if shareholders must approve"
507
- },
508
- "newDocumentRef": {
509
- "type": "string",
510
- "required": true
511
- }
512
- }
513
- },
514
- "guards": [
515
- {
516
- "name": "boardApproved",
517
- "description": "Board must have approved",
518
- "expression": "context.pendingAmendment.boardApprovalRef != null"
519
- },
520
- {
521
- "name": "shareholderApprovedIfRequired",
522
- "description": "If shareholder approval required, must have it",
523
- "expression": "context.pendingAmendment.approvalRequired !== 'SHAREHOLDERS_REQUIRED' || event.shareholderResolutionRef != null"
524
- }
525
- ],
526
- "effects": [
527
- {
528
- "type": "COMPUTE",
529
- "path": "currentVersion",
530
- "expression": "(parseFloat(context.currentVersion) + 0.1).toFixed(1) + '.0'"
531
- },
532
- {
533
- "type": "SET_CONTEXT",
534
- "path": "lastAmendedDate",
535
- "value": "{{ event.effectiveDate }}"
536
- },
537
- {
538
- "type": "SET_CONTEXT",
539
- "path": "documentRef",
540
- "value": "{{ event.newDocumentRef }}"
541
- },
542
- {
543
- "type": "FOR_EACH",
544
- "array": "{{ context.pendingAmendment.proposedChanges }}",
545
- "do": {
546
- "type": "UPDATE_ARRAY_ITEM",
547
- "path": "sections",
548
- "matchKey": "sectionId",
549
- "matchValue": "{{ item.sectionId }}",
550
- "updates": {
551
- "content": "{{ item.proposedContent }}",
552
- "lastModifiedVersion": "{{ context.currentVersion }}"
553
- }
554
- }
555
- },
556
- {
557
- "type": "APPEND_ARRAY",
558
- "path": "amendmentHistory",
559
- "value": {
560
- "amendmentId": "{{ context.pendingAmendment.amendmentId }}",
561
- "version": "{{ context.currentVersion }}",
562
- "description": "{{ context.pendingAmendment.description }}",
563
- "sectionsAffected": "{{ context.pendingAmendment.sectionsAffected }}",
564
- "effectiveDate": "{{ event.effectiveDate }}",
565
- "approvedBy": "{{ event.shareholderResolutionRef ? 'BOTH' : 'BOARD' }}",
566
- "boardResolutionRef": "{{ context.pendingAmendment.boardApprovalRef }}",
567
- "shareholderResolutionRef": "{{ event.shareholderResolutionRef }}",
568
- "documentRef": "{{ event.newDocumentRef }}"
569
- }
570
- },
571
- {
572
- "type": "SET_CONTEXT",
573
- "path": "pendingAmendment",
574
- "value": null
575
- },
576
- {
577
- "type": "EMIT_EVENT",
578
- "eventType": "BYLAWS_AMENDED",
579
- "payload": {
580
- "entityId": "{{ context.entityId }}",
581
- "bylawsId": "{{ context.bylawsId }}",
582
- "newVersion": "{{ context.currentVersion }}",
583
- "effectiveDate": "{{ event.effectiveDate }}"
584
- }
585
- }
586
- ]
587
- },
588
- "reject_amendment": {
589
- "from": "AMENDING",
590
- "to": "ADOPTED",
591
- "description": "Amendment rejected by board or shareholders",
592
- "event": {
593
- "name": "reject_amendment",
594
- "payload": {
595
- "rejectedBy": {
596
- "type": "string",
597
- "enum": [
598
- "BOARD",
599
- "SHAREHOLDERS"
600
- ],
601
- "required": true
602
- },
603
- "reason": {
604
- "type": "string"
605
- }
606
- }
607
- },
608
- "effects": [
609
- {
610
- "type": "SET_CONTEXT",
611
- "path": "pendingAmendment.status",
612
- "value": "REJECTED"
613
- },
614
- {
615
- "type": "EMIT_EVENT",
616
- "eventType": "BYLAW_AMENDMENT_REJECTED",
617
- "payload": {
618
- "entityId": "{{ context.entityId }}",
619
- "amendmentId": "{{ context.pendingAmendment.amendmentId }}",
620
- "rejectedBy": "{{ event.rejectedBy }}"
621
- }
622
- },
623
- {
624
- "type": "SET_CONTEXT",
625
- "path": "pendingAmendment",
626
- "value": null
627
- }
628
- ]
629
- },
630
- "restate": {
631
- "from": "ADOPTED",
632
- "to": "ADOPTED",
633
- "description": "Complete restatement of bylaws (consolidating all amendments)",
634
- "event": {
635
- "name": "restate",
636
- "payload": {
637
- "restatedDate": {
638
- "type": "string",
639
- "format": "date",
640
- "required": true
641
- },
642
- "boardResolutionRef": {
643
- "type": "string",
644
- "required": true
645
- },
646
- "newDocumentRef": {
647
- "type": "string",
648
- "required": true
649
- },
650
- "sections": {
651
- "type": "array",
652
- "required": true
653
- },
654
- "keyProvisions": {
655
- "type": "object"
656
- }
657
- }
658
- },
659
- "guards": [
660
- {
661
- "name": "boardApproved",
662
- "crossMachine": {
663
- "machine": "corporate-resolution",
664
- "instanceRef": "{{ event.boardResolutionRef }}",
665
- "requiredState": "EXECUTED"
666
- }
667
- }
668
- ],
669
- "effects": [
670
- {
671
- "type": "COMPUTE",
672
- "path": "currentVersion",
673
- "expression": "(Math.floor(parseFloat(context.currentVersion)) + 1).toString() + '.0.0'"
674
- },
675
- {
676
- "type": "SET_CONTEXT",
677
- "path": "lastAmendedDate",
678
- "value": "{{ event.restatedDate }}"
679
- },
680
- {
681
- "type": "SET_CONTEXT",
682
- "path": "documentRef",
683
- "value": "{{ event.newDocumentRef }}"
684
- },
685
- {
686
- "type": "SET_CONTEXT",
687
- "path": "sections",
688
- "value": "{{ event.sections }}"
689
- },
690
- {
691
- "type": "SET_CONTEXT",
692
- "path": "keyProvisions",
693
- "value": "{{ event.keyProvisions }}"
694
- },
695
- {
696
- "type": "APPEND_ARRAY",
697
- "path": "amendmentHistory",
698
- "value": {
699
- "amendmentId": "RESTATEMENT-{{ event.restatedDate }}",
700
- "version": "{{ context.currentVersion }}",
701
- "description": "Complete Restatement of Bylaws",
702
- "sectionsAffected": [
703
- "ALL"
704
- ],
705
- "effectiveDate": "{{ event.restatedDate }}",
706
- "approvedBy": "BOARD",
707
- "boardResolutionRef": "{{ event.boardResolutionRef }}",
708
- "documentRef": "{{ event.newDocumentRef }}"
709
- }
710
- },
711
- {
712
- "type": "EMIT_EVENT",
713
- "eventType": "BYLAWS_RESTATED",
714
- "payload": {
715
- "entityId": "{{ context.entityId }}",
716
- "bylawsId": "{{ context.bylawsId }}",
717
- "newVersion": "{{ context.currentVersion }}"
718
- }
719
- }
720
- ]
721
- }
722
- },
723
- "crossMachineRefs": {
724
- "entity": {
725
- "machine": "corporate-entity",
726
- "description": "Parent corporate entity",
727
- "foreignKey": "entityId"
728
- },
729
- "board": {
730
- "machine": "corporate-board",
731
- "description": "Board that can amend bylaws",
732
- "foreignKey": "entityId"
733
- },
734
- "shareholders": {
735
- "machine": "corporate-shareholders",
736
- "description": "Shareholders for bylaw amendments requiring shareholder approval",
737
- "foreignKey": "entityId"
738
- }
739
- },
740
- "metadata": {
741
- "author": "OttoChain",
742
- "license": "MIT",
743
- "tags": [
744
- "corporate",
745
- "governance",
746
- "bylaws",
747
- "amendments"
748
- ],
749
- "documentation": "https://ottochain.dev/docs/corporate/bylaws"
750
- }
751
- }