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
LIGO
environment 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 install
to install dependencies - Run
make compile
to compile the contracts - Run
make deploy
to deploy the contracts. You have to renamedeploy/.env.dist
todeploy/.env
and 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)