A modular example DAO contract on Tezos written in Ligolang.
This example DAO allows FA2 token holders to vote on proposals, which trigger on-chain changes when accepted. It is using token based quorum voting, requiring a given threshold of participating tokens for a proposal to pass. The contract code uses Ligo modules, and the tezos-ligo-fa2 package.
The used FA2 token is expected to extend the TZIP-12 standard
with an on-chain view total_supply returning the total supply of tokens. This
number, of type nat is then used as base for the participation computation,
see example FA2 in the test directory.
The contract is written in cameligo flavour of LigoLANG,
to be able to compile the contract, you need either:
- a ligo binary,
in this case, to use the binary, you need to have set up a
LIGOenvironment variable, pointing to the binary (see Makefile) - or docker
For deploy scripts, you also need to have nodejs installed, up to version 14 and docker if you wish to deploy on a sandbox.
- Run
make installto install dependencies - Run
make compileto compile the contracts - Run
make deployto deploy the contracts. You have to renamedeploy/.env.disttodeploy/.envand fill the required variables.
You can also override make parameters by running :
make compile ligo_compiler=<LIGO_EXECUTABLE> protocol_opt="--protocol <PROTOCOL>"See Documentation
- Expand vote: add third "Pass" choice, add Score Voting
- Vote incentives with some staking mechanism
- Mutation tests
- Optimizations (inline...)
- Attack tests (see last one: https://twitter.com/ylv_io/status/1515773148465147926)