An exemple of DAO contract in CameLIGO
ligo init contract --template dao-cameligo [PROJECT_NAME]
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.
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,
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.
make installto install dependencies
make compileto compile the contracts
make deployto deploy the contracts. You have to rename
deploy/.envand fill the required variables.
You can also override
make parameters by running :
make compile ligo_compiler=<LIGO_EXECUTABLE> protocol_opt="--protocol <PROTOCOL>"
- 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)