Updated treasury docs to reflect current implementation
This commit is contained in:
parent
1bfa0f5b6d
commit
5216987dac
2 changed files with 60 additions and 22 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
| Specification | Implementation | Last revision |
|
||||
|:-----------:|:--------------:|:-------------:|
|
||||
| Draft | WIP | v0.1 2022-03-01 |
|
||||
| Draft | WIP | v0.1 2022-03-04 |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
**Current Status**:
|
||||
|
||||
- Conceptual draft agreed upon.
|
||||
- Requires technical details and review from [Emily Martins].
|
||||
- Conceptual draft agreed upon.
|
||||
- Implementation incomplete; documentation subject to change.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -48,19 +48,36 @@ The treasury will further be the initial holder of all a governance system's GT.
|
|||
|
||||
are all, naturally, protocol-specific. A simple method for creating such a bespoke reward structure is **not** considered in-scope for Agora v1. Agora v1 will offer a simple, prescribed reward structure, that allows the treasury to determine the reward eligibility of a user and allow them to redeem said amount.
|
||||
|
||||
## Script
|
||||
## Script
|
||||
|
||||
The script for an Agora treasury is described in this section.
|
||||
The script for an Agora treasury is described in this section. For clarity, all data types and functions are written in _traditional Haskell_, rather than at the Plutarch level.
|
||||
|
||||
### Datum
|
||||
### Datum
|
||||
|
||||
```hs
|
||||
data TreasuryD = TreasuryD
|
||||
{ reserves :: Value
|
||||
, stateThread :: CurrencySymbol
|
||||
```hs
|
||||
newtype TreasuryDtum = TreasuryDatum
|
||||
{ -- | Currency symbol of the treasury state thread.
|
||||
stateThread :: CurrencySymbol
|
||||
}
|
||||
```
|
||||
|
||||
### Redeemers
|
||||
### Redeemers
|
||||
|
||||
```hs
|
||||
newtype TreasuryRedeemer = AlterTrParams
|
||||
```
|
||||
|
||||
At the current stage, it is sufficient to allow users to simply grant funds to the treasury, without an explicit redeemer. The only redeemer that is required is `AlterTrParams`, for when the treasury's parameters are subject to change by a proposal effect.
|
||||
|
||||
### Validators
|
||||
|
||||
```hs
|
||||
treasuryV ::
|
||||
CurrencySymbol ->
|
||||
TreasuryDatum ->
|
||||
TreasuryRedeemer ->
|
||||
ScriptContext ->
|
||||
()
|
||||
```
|
||||
|
||||
The only redeemer the validator handles at present is `AlterTrParams`. The validator ensures that a valid governance authority token is burned, when a proposal effect is attempting to alter the parameters of the treasury.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue