Congratulations! This is the first step in your journey towards learning how to build a DAO on the Flow network. This document's objective is to provide the basic tools and help you understand how to use them. You can read the full guide here
All of the code that interacts with Flow is written with Cadence; a new high-level programming language intended for smart contract development.
The tools used for testing the smart contracts, scripts and transactions are written in Go and are part of the Overflow library.
To get a local copy up and running, please follow these simple steps.
NodeJS v16.x
or above. See: Node installation instructionsflow-cli
Flow CLI installation instructions
git clone --depth=1 https://github.com/Blockversity-xyz/Sample-DAO.git
Here is what you need to be able to run the project.
- Node.js
- NPM (recommended)
- Flow CLI
- Go
The smart contracts are written in Cadence and are located in the contracts
folder. The contracts are deployed to the testnet using the Flow CLI.
flow project deploy --network testnet
With Flow CLI you can also update the contracts on the testnet.
flow accounts update-contract ./contracts/ExampleDAO/ExampleDAO.cdc --network testnet --signer testnet-account
The transactions are written in Cadence and are located in the transactions
folder. The transactions are deployed to the testnet using the Flow CLI.
flow transactions send ./transactions/Action.cdc --network testnet
The scripts are written in Cadence and are located in the scripts
folder. The scripts are executed on the testnet using the Flow CLI.
flow scripts execute ./scripts/GetAccount.cdc --network testnet
The testing framework for the Flow Cadence contract uses Overflow
To test the contracts go to the Cadence folder cd Cadence
and run the below command
go run ./tasks/main.go
To deploy the contracts to the testnet, you need to have a testnet account. You can create one using the Flow CLI.
flow project deploy --network testnet
flow accounts create \
--key YOUR_PRIVATE_KEY \
--host access.devnet.nodes.onflow.org:9000 \
--signer YOUR_ACCOUNT_ADDRESS
flow project deploy --network testnet
flow transactions send ./transactions/SetupAccount.cdc --network testnet
flow accounts create --key YOUR_PRIVATE_KEY --host access.devnet.nodes.onflow.org:9000 --signer YOUR_ACCOUNT_ADDRESS