Commit graph

370 commits

Author SHA1 Message Date
fanghr
ec0c53db99 allow multiple outputs to the proposal validator
... upon creation of the proposal. Don't know if this is intended or
not.
2022-05-06 17:09:32 +08:00
fanghr
14b8d30d57 naming 2022-05-06 17:09:31 +08:00
fanghr
13c72a6180 ensure that the token name of GST is empty 2022-05-06 17:09:31 +08:00
fanghr
7294c01ebb simplify code
Co-authored-by: Emily Martins <emi@haskell.fyi>
2022-05-06 17:09:30 +08:00
fanghr
4dc311d370 apply naming suggestions by @emiflake 2022-05-06 17:09:30 +08:00
fanghr
0874571d89 fix some typos :) 2022-05-06 17:09:29 +08:00
fanghr
01d3be029d clean up; apply hlint suggestions; format 2022-05-06 17:09:28 +08:00
fanghr
15414aeda4 properly check state datum when creat a proposal 2022-05-06 17:09:28 +08:00
fanghr
a4d55f221a support more than two effect groups/vote outcomes 2022-05-06 17:09:27 +08:00
fanghr
1cd5a8eb3c doc string for util functions 2022-05-06 17:09:27 +08:00
fanghr
9e85a7a004 rewrite the doc for governor components
... also explain what GST is
2022-05-06 17:09:26 +08:00
fanghr
c6cdb3ac31 expose util function gatSymbol 2022-05-06 17:09:25 +08:00
fanghr
54b58ad937 fix compilation erros; format && lint
Co-authored-by: Emily Martins <emi@haskell.fyi>
2022-05-06 17:09:25 +08:00
fanghr
a5c461700e consistent naming 2022-05-06 17:09:24 +08:00
fanghr
b84ed61356 fix missing documentation for governorValidator 2022-05-06 17:09:24 +08:00
fanghr
4a645af531 yeet containsSingleCurrencySymbol; clean things up 2022-05-06 17:09:23 +08:00
fanghr
1b8d322cf4 update doc string for the 'governorValidator' 2022-05-06 17:09:23 +08:00
fanghr
d3c05c1dc2 check proposal state is draft while creating a proposal 2022-05-06 17:09:22 +08:00
fanghr
74b5e714da remove all unnecessary mint only one kind of token checks 2022-05-06 17:09:21 +08:00
fanghr
12a0e3046e allow GST has a custom name 2022-05-06 17:09:21 +08:00
fanghr
8ec958646c ensure the proposal is in executable state while minting GATs 2022-05-06 17:09:20 +08:00
fanghr
0f2be417a7 add executable state for the proposal 2022-05-06 17:09:19 +08:00
fanghr
9e724fb75a some error message improvement 2022-05-06 17:09:19 +08:00
fanghr
044937c38c ensure that the proposal state token is sent back 2022-05-06 17:09:18 +08:00
Hongrui Fang
7d6cd33730 check input/output proposal status while minting GATs 2022-05-06 17:09:18 +08:00
fanghr
6a5ce88972 correct validation logic for proposals
* simplify using newly added util functions
* check vote thresholds
* Anything else to check here?
2022-05-06 17:09:17 +08:00
fanghr
034fc397df add mustBePJust and mustBePDJust util functions 2022-05-06 17:09:16 +08:00
fanghr
2e1514f366 allow other components to know the assetclass of GST 2022-05-06 17:09:16 +08:00
fanghr
c7ae47d487 add validation logic for GAT minting; add doc string for MintGATs 2022-05-06 17:09:15 +08:00
fanghr
793f038182 remove redundant imports 2022-05-06 17:09:14 +08:00
fanghr
3065cd9e11 getting start with GAT minting validation 2022-05-06 17:09:14 +08:00
fanghr
b67361e7b4 calculate GAT's symbol based on gov parameters 2022-05-06 17:09:13 +08:00
fanghr
b43171010e make authorityTokenPolicy a ClosedTerm PMintingPolicy 2022-05-06 17:09:13 +08:00
Hongrui Fang
ce4922beb3 plet proposal symbol; clean up stuff a little bit 2022-05-06 17:09:12 +08:00
Hongrui Fang
ff227bcbf5 handle proposal creation 2022-05-06 17:09:11 +08:00
fanghr
a970c0586f add doc string for governorValidator and pnextProposalId 2022-05-06 17:09:11 +08:00
fanghr
04bba9ebaf convert all "datum NFT" to "state token" in the messages
in order to avoid confusion
2022-05-06 17:09:10 +08:00
fanghr
18bfa25fcb implement governor state token minting policy
* parameterize the policy and the validator with a utxo
2022-05-06 17:09:09 +08:00
fanghr
afc48aa9f8 apply hlint suggestions; fix the ci 2022-05-06 17:09:08 +08:00
fanghr
dd99543449 apply naming suggestions from Emily and Seungheon
* `pid` -> `id`
*  `MutateParams` -> `MutateGovernor`
2022-05-06 17:09:08 +08:00
fanghr
be16b80459 get next proposal id from pnextProposalId 2022-05-06 17:09:07 +08:00
fanghr
731e714fc3 handle effects that mutate params of the governor 2022-05-06 17:09:07 +08:00
fanghr
de517fc144 add pisDJust util function
the counterpart of `pisJust`, for type `PMaybeData`
2022-05-06 17:09:06 +08:00
fanghr
f30ca26ea5 rename redeemer MutateDatum to MutateParams 2022-05-06 17:09:05 +08:00
fanghr
1e9ff7d8f4 handle proposal creation
* check proposal id
2022-05-06 17:09:05 +08:00
fanghr
99365a32ae check that the datum nft always stays at the governor address 2022-05-06 17:09:04 +08:00
fanghr
b546fc9701 export PGovernorRedeemer 2022-05-06 17:09:03 +08:00
fanghr
c432a06d5e add corresponding plutarch-level redeemer and datum
* lift them as well
2022-05-06 17:09:03 +08:00
fanghr
5ace88290d modify GovernorRedeemer and Governor
* add `MutateDatum` redeemer
* add `datumNFT` to `Governor` so that we can identify the datum
* Lift `GovernorDatum` and `GovernorRedeemer`
2022-05-06 17:09:02 +08:00
Jack Hodgkinson
1ce89d3ac6 Merge pull request #72 from Liqwid-Labs/connor/validatorHashTokenName
`ValidatorHashToTokenName`
2022-05-06 09:15:17 +01:00