Skip to content

Commit

Permalink
updating doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontin committed Jun 26, 2024
1 parent b76d4a4 commit 6cfe663
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
- Two filters in `Output.hs`, `isScriptOutput` and `isPKOutput`
- A new helper function to get the full output value of a skeleton,
`txSkelOutputsValue`

- Proposal procedures can now be issued and described in transaction
skeletons. If they contain parameter changes or treasury withdrawals, a
witness script can be attached and will be run.
- `TxSkelRedeemer` is now used for all kind of scripts.
- Transaction generation has been rendered clearer.

### Removed
- Extraneous dependencies in package.yaml
- File `Cooked.TestUtils`, its content has been added to `Cooked.MockChain.Testing`
Expand All @@ -49,6 +54,7 @@
- Deprecated use of `*` instead of `Type`
- Many unused pragmas
- Orphan default instance for `Ledger.Slot`
- `MintsRedeemer` (replaced by `TxSkelRedeemer`)

### Changed
- Default era from Babbage to Conway
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ ready-to-use recipes book.
automated balancing mechanism and associated options (including options
revolving around fees and collaterals).

- The [CONWAY](doc/CONWAY.md) file describes the Conway features that are currently supported by `cooked-validators`.

- We also have a [repository](https://github.com/tweag/cooked-smart-contracts)
of example contracts with offchain code and tests written using
`cooked-validators`. Note that some examples are not maintained and thus written
Expand Down
38 changes: 38 additions & 0 deletions doc/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,44 @@ txSkelTemplate
}
```

### Attach a Proposal Procedure to a transaction

* Using the builtin constructor for proposals:
```haskell
txSkelTemplate
{ ...
txSkelProposals =
[ TxSkelProposal
{ txSkelProposalAddress = walletAddress (wallet 1),
txSkelProposalAction =
TxGovActionTreasuryWithdrawals $
Map.fromList
[ (toCredential $ wallet 1, Api.Lovelace 100),
(toCredential $ wallet 2, Api.Lovelace 10_000)
],
txSkelProposalWitness = (toScript myScript, myRedeemer),
txSkelProposalAnchor = Nothing
}
]
...
}
```

* Using smart constructors:
```haskell
txSkelTemplate
{ ...
txSkelProposals =
[ simpleTxSkelProposal
(wallet 1)
(TxGovActionParameterChange [FeePerByte 100, FeeFixed 1_000])
`withWitness` (myScript, myRedeemer)
`withAnchor` "https://www.tweag.io/"
]
...
}
```

### Have pre-existing non-Ada tokens that cannot be minted or burnt

* `distributionFromList [..., (... <> permanentValue "customToken" 1000), ...]`
Expand Down
34 changes: 34 additions & 0 deletions doc/CONWAY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Supported Conway features

With the arrival of the Conway era, the Cardano blockchain is being enriched
with a significant set of features revolving around governance. Governance can
be defined as the ability for ada holders to take part in various on-chain
decisions as described in
[CIP-1694](https://github.com/cardano-foundation/CIPs/tree/master/CIP-1694). These
new features have brought a substantial set of changes, such as new script
purposes, new centralized data like committee, and new transaction
features. This documents describes which of those features are currently being
supported by cooked-validators, and to which extent. Each of the following items
describes a feature that is currently supported. The reader can assume that
everything that is not directly mentioned here about Conway is not yet
supported.

## Proposal procedures

It is currently possible to describe proposal procedures and attach an arbitrary
number of those in transaction skeleton. The balancing mechanism will take into
account the required deposit for each of these procedures.

### Parameter changes

It is possible to issue proposal procedures with a request for changes in
parameters. If a script witness is attached to this proposal (typically the
constitution script), it will be ran against the proposal. All kinds of
parameter changes are supported, except for the cost models, which contain too
many values and are not even yet taken into account by the current constitution.

### Treasury withdrawals

It is possible to issue proposal procedures with a request for treasury
withdrawals. If a script witness is attached to this proposal (typically the
constitution script), it will be ran against the proposal.

0 comments on commit 6cfe663

Please sign in to comment.