- Voting (for, against, abstain)
- Advanced
- User can write a contract and it will be executed
- Simple
- Nothing will be enforced
- People just vote in favor of staircase repair
- Nothing will be enforced
- Voting templates
- Voting for grant payment
- Who to pay and how much (in native currency)
- Who to pay and how much in ERC20 token
- Additional Mint tokens
- Voting for grant payment
- Advanced
- Treasury
- A contract where tokens can be transferred to be paid out to someone by vote
- TokenDAO
- Used for voting only, but can be traded as well
Since contracts cannot be deployed in stages in Forward Factory, we had to make a contract that will deploy all contracts in one transaction, which turned out to be successful and tested when deploying the template on the marketplace
The basis for the DAO, the whole logic of voting and governance.
Contract to create a delay in the execution of the proposal.
Voting token contract, mint is only available for owner which is equal to TimeLock. That is, additional issue is available only after voting.
Contract for fundraising to the DAO, this can be used to disburse money from the fund to specific addresses. Disbursement functions are only available after voting.
Create a proposal to be voted on.
targets- array of addresses to be accessedvalues- send native tokenscalldatas- array of selectors of functions + parameters (calldatas)description- proposal description
The proposer himself creates the contract, which will then be enforced
The propose parameters are set to zeros, the result will be a vote, but nothing will be executed
const targets: string[] = ["0x0000000000000000000000000000000000000000"];
const values: number[] = [0];
const calldatas: string[] = ["0x00"];- Additional TokenDAO minting
const target = token.target;
const calldata = (await token.mint.populateTransaction(acc5, 10000)).data;
const description = "Mint 10000 tokens";
await miniDAO.propose([target], [0], [calldata], description);- Pay the grant to the address in native tokens
let ABI = ["function releaseNativeToken(address to, uint256 amount)"];
const iface = new hre.ethers.Interface(ABI);
const target = treasury.target;
const calldata = iface.encodeFunctionData("releaseNativeToken", [
acc6.address,
hre.ethers.parseEther("1.1"),
]);
const description = "Pay out a grant to the first team";
await miniDAO.propose([target], [0], [calldata], description);- Pay the grant to the address in ERC20 tokens
let ABI = [
"function releaseERC20Token(address to, uint256 amount, address token)",
];
const iface = new hre.ethers.Interface(ABI);
const calldata = iface.encodeFunctionData("releaseERC20Token", [
acc6.address,
200000,
erc20.target,
]);
const target = treasury.target;
const description = "Pay out a grant to the second team";
await miniDAO.propose([target], [0], [calldata], description);- Pay the grant to the address in ERC721 token
let ABI = [
"function releaseERC721Token(address to, uint256 id, address token)",
];
const iface = new hre.ethers.Interface(ABI);
const calldata = iface.encodeFunctionData("releaseERC721Token", [
acc6.address,
0,
erc721.target,
]);
// const calldata = (
// await treasury.releaseERC721Token.populateTransaction(acc6, 0, erc721)
// ).data;
const target = treasury.target;
const description = "Pay out a grant to the third team";
await miniDAO.propose([target], [0], [calldata], description);Vote for/against
proposalIdsupport- [ Against, For, Abstain ] = [0, 1, 2]
Get voting statistics for the proposal
- [ Against, For, Abstain ]