first commit

This commit is contained in:
Jack Hodgkinson 2022-01-26 12:25:11 +00:00
parent 501a414bc0
commit b4a40a56ea
7 changed files with 279 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# `agora`
# Agora
Agora is a set of Plutus scripts that compose together to form a Governance system.
@ -20,4 +20,21 @@ Open a dev-shell with `nix develop`, and build with `cabal build`.
## Documentation
See documentation of the agora architecture in [docs](./docs).
See documentation of the Agora architecture in [docs](./docs).
## Road-map
### v1
- [ ] Governor
- [ ] Treasury
- [ ] Staking pool
- [ ] Proposals
- [ ] Effects
### v2
- [ ] Rewards distribution
### Beyond

37
docs/concepts/README.md Normal file
View file

@ -0,0 +1,37 @@
# Governance concepts
This document seeks to introduce to the reader the concept of governance systems on Cardano and acquaint them with the core components of a generic governance system.
## Simple questions, simple answers
### Q: What's a 'governance'?
A: A _governance system_ is a component of a Cardano system, that allows for its community to issue and vote on proposals.
### Q: What can be proposed?
A: That depends on the Cardano protocol in-question. An example for a proposal could suggest that funds be released from a community treasury. Another might propose an alteration to some parameter in the wider-system.
### Q: Who can vote?
A: The right to vote is conferred by the _staking_ of some designated _governance token_. If one owns the relevant token, they may 'stake' some of it to vote in favour of, or opposition to, some proposal. The 'weight' of their vote will be directly proportional to the amount they stake on it.
## Overview of components
More-detailed information on individual components will be included in their own, specific documentation. This section provides brief descriptions on the purpose of each component.
### Proposal
A proposal suggests for some specified changes to be made to a Cardano system. It is voted upon by the community and, if passed, its effects are applied to the system.
### Governor
The governor may be conceived of as the 'centre' of a given 'governance system'. Users submit proposals to the governor, which creates them on-chain and keeps track of them. Furthermore, it holds parameters which affect the behaviour of the governance system e.g. the duration of a proposal's voting phase. Finally, it issues 'governance authority tokens', which are used to permit changes to the system.
### Governance tokens
Governance tokens (GTs) are a currency, which confer the right to vote on proposals. The more GTs one stakes, the more their vote counts on proposals.
### Staking pool
A staking pool is required, so that the system knows how much

View file

@ -0,0 +1,12 @@
digraph {
Proposals -> Governor [label="submitted to"]
Users -> StakingPool [label="pay GT to"]
StakingPool -> Stakes [label="creates"]
Stakes -> Proposals [label="are locked by"]
Proposals -> Effects [label="have"]
Governor -> Effects [label="issues GATs to"]
Treasury -> Governor [label="releases GT to"]
"Vesting contract" -> Users [label="distributes GT amongst"]
Users -> Stakes [label="own"]
Governor -> "Vesting contract" [label="invokes"]
}

View file

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (0)
-->
<!-- Pages: 1 -->
<svg width="451pt" height="479pt"
viewBox="0.00 0.00 451.00 479.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 475)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-475 447,-475 447,4 -4,4"/>
<!-- Proposals -->
<g id="node1" class="node">
<title>Proposals</title>
<ellipse fill="none" stroke="black" cx="285" cy="-453" rx="55.79" ry="18"/>
<text text-anchor="middle" x="285" y="-449.3" font-family="Times,serif" font-size="14.00">Proposals</text>
</g>
<!-- Governor -->
<g id="node2" class="node">
<title>Governor</title>
<ellipse fill="none" stroke="black" cx="127" cy="-366" rx="53.89" ry="18"/>
<text text-anchor="middle" x="127" y="-362.3" font-family="Times,serif" font-size="14.00">Governor</text>
</g>
<!-- Proposals&#45;&gt;Governor -->
<g id="edge1" class="edge">
<title>Proposals&#45;&gt;Governor</title>
<path fill="none" stroke="black" d="M240.28,-442.02C220.6,-436.45 197.75,-428.3 179,-417 167.6,-410.13 156.7,-400.35 147.86,-391.26"/>
<polygon fill="black" stroke="black" points="150.33,-388.78 140.94,-383.86 145.22,-393.56 150.33,-388.78"/>
<text text-anchor="middle" x="225" y="-405.8" font-family="Times,serif" font-size="14.00">submitted to</text>
</g>
<!-- Effects -->
<g id="node6" class="node">
<title>Effects</title>
<ellipse fill="none" stroke="black" cx="266" cy="-279" rx="42.79" ry="18"/>
<text text-anchor="middle" x="266" y="-275.3" font-family="Times,serif" font-size="14.00">Effects</text>
</g>
<!-- Proposals&#45;&gt;Effects -->
<g id="edge5" class="edge">
<title>Proposals&#45;&gt;Effects</title>
<path fill="none" stroke="black" d="M283.45,-434.67C281.08,-408.65 276.26,-357.95 271,-315 270.68,-312.44 270.34,-309.78 269.98,-307.12"/>
<polygon fill="black" stroke="black" points="273.43,-306.49 268.57,-297.07 266.49,-307.46 273.43,-306.49"/>
<text text-anchor="middle" x="295" y="-362.3" font-family="Times,serif" font-size="14.00">have</text>
</g>
<!-- Governor&#45;&gt;Effects -->
<g id="edge6" class="edge">
<title>Governor&#45;&gt;Effects</title>
<path fill="none" stroke="black" d="M137,-348.11C144.15,-337.32 154.67,-323.76 167,-315 182.27,-304.14 201.25,-296.36 218.49,-290.93"/>
<polygon fill="black" stroke="black" points="219.8,-294.2 228.4,-288.01 217.81,-287.48 219.8,-294.2"/>
<text text-anchor="middle" x="219" y="-318.8" font-family="Times,serif" font-size="14.00">issues GATs to</text>
</g>
<!-- Vesting contract -->
<g id="node8" class="node">
<title>Vesting contract</title>
<ellipse fill="none" stroke="black" cx="98" cy="-279" rx="87.18" ry="18"/>
<text text-anchor="middle" x="98" y="-275.3" font-family="Times,serif" font-size="14.00">Vesting contract</text>
</g>
<!-- Governor&#45;&gt;Vesting contract -->
<g id="edge10" class="edge">
<title>Governor&#45;&gt;Vesting contract</title>
<path fill="none" stroke="black" d="M104.27,-349.62C98.15,-344.2 92.31,-337.56 89,-330 85.88,-322.89 85.97,-314.76 87.43,-307.15"/>
<polygon fill="black" stroke="black" points="90.88,-307.81 90.1,-297.25 84.12,-305.99 90.88,-307.81"/>
<text text-anchor="middle" x="116.5" y="-318.8" font-family="Times,serif" font-size="14.00">invokes</text>
</g>
<!-- Users -->
<g id="node3" class="node">
<title>Users</title>
<ellipse fill="none" stroke="black" cx="136" cy="-192" rx="38.19" ry="18"/>
<text text-anchor="middle" x="136" y="-188.3" font-family="Times,serif" font-size="14.00">Users</text>
</g>
<!-- StakingPool -->
<g id="node4" class="node">
<title>StakingPool</title>
<ellipse fill="none" stroke="black" cx="250" cy="-105" rx="65.79" ry="18"/>
<text text-anchor="middle" x="250" y="-101.3" font-family="Times,serif" font-size="14.00">StakingPool</text>
</g>
<!-- Users&#45;&gt;StakingPool -->
<g id="edge2" class="edge">
<title>Users&#45;&gt;StakingPool</title>
<path fill="none" stroke="black" d="M155.59,-176.39C173.39,-163.12 199.88,-143.36 220.28,-128.16"/>
<polygon fill="black" stroke="black" points="222.4,-130.94 228.33,-122.16 218.22,-125.33 222.4,-130.94"/>
<text text-anchor="middle" x="235" y="-144.8" font-family="Times,serif" font-size="14.00">pay GT to</text>
</g>
<!-- Stakes -->
<g id="node5" class="node">
<title>Stakes</title>
<ellipse fill="none" stroke="black" cx="250" cy="-18" rx="42.49" ry="18"/>
<text text-anchor="middle" x="250" y="-14.3" font-family="Times,serif" font-size="14.00">Stakes</text>
</g>
<!-- Users&#45;&gt;Stakes -->
<g id="edge9" class="edge">
<title>Users&#45;&gt;Stakes</title>
<path fill="none" stroke="black" d="M133.13,-173.77C130.41,-151.92 128.84,-113.87 145,-87 159.55,-62.79 186.42,-45.62 209.34,-34.6"/>
<polygon fill="black" stroke="black" points="210.9,-37.73 218.54,-30.39 207.99,-31.36 210.9,-37.73"/>
<text text-anchor="middle" x="160" y="-101.3" font-family="Times,serif" font-size="14.00">own</text>
</g>
<!-- StakingPool&#45;&gt;Stakes -->
<g id="edge3" class="edge">
<title>StakingPool&#45;&gt;Stakes</title>
<path fill="none" stroke="black" d="M250,-86.8C250,-75.16 250,-59.55 250,-46.24"/>
<polygon fill="black" stroke="black" points="253.5,-46.18 250,-36.18 246.5,-46.18 253.5,-46.18"/>
<text text-anchor="middle" x="276.5" y="-57.8" font-family="Times,serif" font-size="14.00">creates</text>
</g>
<!-- Stakes&#45;&gt;Proposals -->
<g id="edge4" class="edge">
<title>Stakes&#45;&gt;Proposals</title>
<path fill="none" stroke="black" d="M280.42,-30.66C308.87,-43.78 347,-68.06 347,-104 347,-367 347,-367 347,-367 347,-391.49 329.99,-413.64 313.79,-429.18"/>
<polygon fill="black" stroke="black" points="311.04,-426.96 305.99,-436.27 315.74,-432.14 311.04,-426.96"/>
<text text-anchor="middle" x="395" y="-231.8" font-family="Times,serif" font-size="14.00">are locked by</text>
</g>
<!-- Treasury -->
<g id="node7" class="node">
<title>Treasury</title>
<ellipse fill="none" stroke="black" cx="52" cy="-453" rx="51.99" ry="18"/>
<text text-anchor="middle" x="52" y="-449.3" font-family="Times,serif" font-size="14.00">Treasury</text>
</g>
<!-- Treasury&#45;&gt;Governor -->
<g id="edge7" class="edge">
<title>Treasury&#45;&gt;Governor</title>
<path fill="none" stroke="black" d="M48.09,-434.94C46.7,-424.61 46.77,-411.62 53,-402 58.56,-393.41 66.84,-386.88 75.88,-381.94"/>
<polygon fill="black" stroke="black" points="77.6,-384.99 85.1,-377.5 74.57,-378.69 77.6,-384.99"/>
<text text-anchor="middle" x="104.5" y="-405.8" font-family="Times,serif" font-size="14.00">releases GT to</text>
</g>
<!-- Vesting contract&#45;&gt;Users -->
<g id="edge8" class="edge">
<title>Vesting contract&#45;&gt;Users</title>
<path fill="none" stroke="black" d="M105.69,-260.8C111.03,-248.85 118.24,-232.72 124.29,-219.18"/>
<polygon fill="black" stroke="black" points="127.56,-220.44 128.45,-209.89 121.17,-217.59 127.56,-220.44"/>
<text text-anchor="middle" x="204.5" y="-231.8" font-family="Times,serif" font-size="14.00">distributes GT amongst</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.9 KiB

View file

@ -0,0 +1,6 @@
digraph {
rankdir="LR"
{User} -> StakingPool [label="pays LQ to"]
StakingPool -> Stake [label="creates"]
Stake -> Proposal [label="is locked by"]
}

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.48.0 (0)
-->
<!-- Pages: 1 -->
<svg width="705pt" height="44pt"
viewBox="0.00 0.00 705.37 44.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 40)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-40 701.37,-40 701.37,4 -4,4"/>
<!-- User -->
<g id="node1" class="node">
<title>User</title>
<ellipse fill="none" stroke="black" cx="33.15" cy="-18" rx="33.29" ry="18"/>
<text text-anchor="middle" x="33.15" y="-14.3" font-family="Times,serif" font-size="14.00">User</text>
</g>
<!-- StakingPool -->
<g id="node2" class="node">
<title>StakingPool</title>
<ellipse fill="none" stroke="black" cx="244.94" cy="-18" rx="65.79" ry="18"/>
<text text-anchor="middle" x="244.94" y="-14.3" font-family="Times,serif" font-size="14.00">StakingPool</text>
</g>
<!-- User&#45;&gt;StakingPool -->
<g id="edge1" class="edge">
<title>User&#45;&gt;StakingPool</title>
<path fill="none" stroke="black" d="M66.47,-18C93.67,-18 133.63,-18 168.76,-18"/>
<polygon fill="black" stroke="black" points="169,-21.5 179,-18 169,-14.5 169,-21.5"/>
<text text-anchor="middle" x="122.79" y="-21.8" font-family="Times,serif" font-size="14.00">pays LQ to</text>
</g>
<!-- Stake -->
<g id="node3" class="node">
<title>Stake</title>
<ellipse fill="none" stroke="black" cx="436.63" cy="-18" rx="37.09" ry="18"/>
<text text-anchor="middle" x="436.63" y="-14.3" font-family="Times,serif" font-size="14.00">Stake</text>
</g>
<!-- StakingPool&#45;&gt;Stake -->
<g id="edge2" class="edge">
<title>StakingPool&#45;&gt;Stake</title>
<path fill="none" stroke="black" d="M310.69,-18C336.49,-18 365.61,-18 389.24,-18"/>
<polygon fill="black" stroke="black" points="389.35,-21.5 399.35,-18 389.35,-14.5 389.35,-21.5"/>
<text text-anchor="middle" x="355.08" y="-21.8" font-family="Times,serif" font-size="14.00">creates</text>
</g>
<!-- Proposal -->
<g id="node4" class="node">
<title>Proposal</title>
<ellipse fill="none" stroke="black" cx="646.02" cy="-18" rx="51.19" ry="18"/>
<text text-anchor="middle" x="646.02" y="-14.3" font-family="Times,serif" font-size="14.00">Proposal</text>
</g>
<!-- Stake&#45;&gt;Proposal -->
<g id="edge3" class="edge">
<title>Stake&#45;&gt;Proposal</title>
<path fill="none" stroke="black" d="M473.75,-18C504.17,-18 548.34,-18 584.2,-18"/>
<polygon fill="black" stroke="black" points="584.55,-21.5 594.55,-18 584.55,-14.5 584.55,-21.5"/>
<text text-anchor="middle" x="534.18" y="-21.8" font-family="Times,serif" font-size="14.00">is locked by</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

18
docs/style-guide.md Normal file
View file

@ -0,0 +1,18 @@
# Agora docs style guide
This document includes a couple of notes on how Agora documentation should be written and formatted.
## Capitalised words
The following words should always be render capitalised:
- Agora
- Plutus
- Plutarch
- Liqwid
- LiqwidX
## Lower-case words
The following words should always be rendered lower-case:
- governance