This document contains all commands to run transactions and scripts for the ToucanDAO.
-
Start the Flow emulator (if testing locally):
flow emulator --scheduled-transactions
-
Deploy contracts (if not already deployed):
flow deploy
flow transactions send cadence/transactions/SetupAccount.cdc --signer aliceflow transactions send cadence/transactions/InitToucanDAOTransactionHandler.cdc --signer aliceflow transactions send cadence/transactions/InitSchedulerManager.cdc --signer alice# Basic COA setup (no funding, no deployment)
flow transactions send cadence/transactions/SetupCOA.cdc 0.0 nil nil nil --signer alice
# COA setup with funding
flow transactions send cadence/transactions/SetupCOA.cdc 1.0 nil nil nil --signer alice
# COA setup with FlowTreasury contract deployment (requires bytecode)
flow transactions send cadence/transactions/SetupCOA.cdc \
0.0 \
<bytecode_hex_string> \
nil \
5000000 \
--signer alice# Send FLOW tokens to an existing COA
flow transactions send cadence/transactions/FundCOA.cdc 10.0 --signer aliceParameters:
amount: UFix64- Amount of FLOW tokens to send to the COA
Note:
- The COA must already exist (created via SetupCOA.cdc)
- The signer must have a FlowToken vault set up
- The signer must have sufficient FLOW balance
flow transactions send cadence/transactions/MintTokens.cdc 1000.0 --signer emulator-account --network emulatorNote:
- The
emulator-accountis the admin account in the emulator. It should have theToucanToken.Minterresource stored at/storage/ToucanTokenAdmin. - The amount must be a
UFix64value (include decimal point, e.g.,100.0not100).
flow transactions send cadence/transactions/CreateWithdrawTreasuryProposal.cdc \
"Withdraw Treasury Proposal" \
"Proposal to withdraw 100 FlowTokens from treasury" \
100.0 \
0x01 \
--signer aliceParameters:
title: String- Proposal titledescription: String- Proposal descriptionamount: UFix64- Amount to withdrawrecipientAddress: Address- Recipient address (e.g.,0x01)
Note:
vaultTypeis hardcoded toType<@FlowToken.Vault>()in the transactionrecipientVaultPathis hardcoded to/public/flowTokenReceiverin the transaction- This transaction is specifically for withdrawing FlowTokens. For other token types, you'll need different transactions or modify this one.
flow transactions send cadence/transactions/CreateAddMemberProposal.cdc \
"Add New Member" \
"Proposal to add a new member to the DAO" \
0x02 \
--signer aliceParameters:
title: String- Proposal titledescription: String- Proposal descriptionmemberAddress: Address- Address of member to add
flow transactions send cadence/transactions/CreateRemoveMemberProposal.cdc \
"Remove Member" \
"Proposal to remove a member from the DAO" \
0x02 \
--signer aliceParameters:
title: String- Proposal titledescription: String- Proposal descriptionmemberAddress: Address- Address of member to remove
flow transactions send cadence/transactions/CreateUpdateConfigProposal.cdc \
"Update Configuration" \
"Proposal to update DAO configuration" \
2 \
5.0 \
20.0 \
86400.0 \
43200.0 \
--signer aliceParameters (all optional, use nil to skip):
title: String- Proposal titledescription: String- Proposal descriptionminVoteThreshold: UInt64?- New minimum vote threshold (ornil)minimumQuorumNumber: UFix64?- New minimum quorum number (ornil)minimumProposalStake: UFix64?- New minimum proposal stake (ornil)defaultVotingPeriod: UFix64?- New default voting period in seconds (ornil)defaultCooldownPeriod: UFix64?- New default cooldown period in seconds (ornil)
Example with nil values:
flow transactions send cadence/transactions/CreateUpdateConfigProposal.cdc \
"Update Configuration" \
"Update only minimum stake" \
nil \
nil \
25.0 \
nil \
nil \
--signer aliceflow transactions send cadence/transactions/DepositProposal.cdc \
0 \
50.0 \
--signer aliceParameters:
proposalId: UInt64- ID of the proposal to activatedepositAmount: UFix64- Amount of ToucanTokens to deposit (must be >= minimumProposalStake)
flow transactions send cadence/transactions/VoteOnProposal.cdc \
0 \
true \
--signer aliceParameters:
proposalId: UInt64- ID of the proposal to vote onvote: Bool-truefor yes,falsefor no
flow transactions send cadence/transactions/CancelProposal.cdc \
0 \
--signer aliceParameters:
proposalId: UInt64- ID of the proposal to cancel- Note: Only the proposal creator can cancel, and only if no votes have been cast
flow scripts execute cadence/scripts/GetDAOConfiguration.cdcReturns complete configuration including:
- Config values (minVoteThreshold, minimumQuorumNumber, etc.)
- State info (treasuryBalance, stakedFundsBalance, memberCount, nextProposalId)
flow scripts execute cadence/scripts/GetMemberCount.cdcflow scripts execute cadence/scripts/IsMember.cdc 0x01Parameters:
address: Address- Address to check
flow scripts execute cadence/scripts/HasToucanTokenBalance.cdc 0x01Parameters:
address: Address- Address to check
flow scripts execute cadence/scripts/GetTreasuryBalance.cdcNote: This script is hardcoded to return FlowToken balance. The vaultType parameter is static in the script.
flow scripts execute cadence/scripts/GetStakedFundsBalance.cdcflow scripts execute cadence/scripts/GetProposal.cdc 0Parameters:
proposalId: UInt64- ID of the proposal
flow scripts execute cadence/scripts/GetProposalStatus.cdc 0Parameters:
proposalId: UInt64- ID of the proposal
Returns: Status enum (0=Pending, 1=Active, 2=Passed, 3=Rejected, 4=Executed, 5=Cancelled, 6=Expired)
flow scripts execute cadence/scripts/GetProposalDetails.cdc 0Parameters:
proposalId: UInt64- ID of the proposal
Returns struct with: id, creator, title, description, proposalType, status, votes, timestamps, etc.
# Without checking specific voter
flow scripts execute cadence/scripts/GetProposalVotes.cdc 0 nil
# Checking if specific voter has voted
flow scripts execute cadence/scripts/GetProposalVotes.cdc 0 0x01Parameters:
proposalId: UInt64- ID of the proposalvoterAddress: Address?- Optional voter address to check (usenilto skip)
Returns: Struct with yesVotes, noVotes, totalVotes, hasVoted
flow scripts execute cadence/scripts/GetAllProposals.cdcflow scripts execute cadence/scripts/GetActiveProposals.cdcReturns only proposals currently in voting period (Active status)
# Get Pending proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 0
# Get Active proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 1
# Get Passed proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 2
# Get Rejected proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 3
# Get Executed proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 4
# Get Cancelled proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 5
# Get Expired proposals
flow scripts execute cadence/scripts/GetProposalsByStatus.cdc 6Status Values:
0= Pending1= Active2= Passed3= Rejected4= Executed5= Cancelled6= Expired
# Get WithdrawTreasury proposals
flow scripts execute cadence/scripts/GetProposalsByType.cdc 0
# Get AdminBasedOperation proposals
flow scripts execute cadence/scripts/GetProposalsByType.cdc 1Type Values:
0= WithdrawTreasury1= AdminBasedOperation
flow scripts execute cadence/scripts/GetProposalsByCreator.cdc 0x01Parameters:
creatorAddress: Address- Address of the proposal creator
# 1. Setup accounts
flow transactions send cadence/transactions/SetupAccount.cdc --signer alice
flow transactions send cadence/transactions/InitToucanDAOTransactionHandler.cdc --signer alice
# 2. Create a proposal
flow transactions send cadence/transactions/CreateWithdrawTreasuryProposal.cdc \
"Withdraw 100 FLOW" \
"Need funds for development" \
100.0 \
0x01 \
--signer alice
# 3. Check proposal status (should be Pending)
flow scripts execute cadence/scripts/GetProposalStatus.cdc 0
# 4. Activate proposal by depositing stake
flow transactions send cadence/transactions/DepositProposal.cdc 0 50.0 --signer alice
# 5. Check proposal status (should be Active)
flow scripts execute cadence/scripts/GetProposalStatus.cdc 0
# 6. Vote on proposal
flow transactions send cadence/transactions/VoteOnProposal.cdc 0 true --signer bob
flow transactions send cadence/transactions/VoteOnProposal.cdc 0 true --signer charlie
# 7. Check votes
flow scripts execute cadence/scripts/GetProposalVotes.cdc 0 nil
# 8. Check proposal details
flow scripts execute cadence/scripts/GetProposalDetails.cdc 0
# 9. Wait for voting period to end, then check status again
# (Execution happens automatically via scheduler)
flow scripts execute cadence/scripts/GetProposalStatus.cdc 0flow transactions send cadence/transactions/SetupAccount.cdc --signer alice --network testnet
flow scripts execute cadence/scripts/GetDAOConfiguration.cdc --network testnetflow transactions send cadence/transactions/SetupAccount.cdc --signer alice --network mainnet
flow scripts execute cadence/scripts/GetDAOConfiguration.cdc --network mainnet- Replace
--signer alicewith your actual signer account alias - Addresses can be specified as
0x01,0x02, etc., or full addresses CreateWithdrawTreasuryProposaltransaction has static parameters:vaultType(FlowToken) andrecipientVaultPath(/public/flowTokenReceiver)- Use
nilfor optional parameters you want to skip - Make sure accounts have ToucanTokens before depositing proposals
- Make sure accounts are members before creating admin-only proposals
- Proposals execute automatically after cooldown period via Transaction Scheduler