trusset-dao-sdk
v1.0.0
Published
Complete DAO SDK with smart contracts and React frontend templates
Readme
Trusset DAO SDK
Complete toolkit for creating and managing decentralized autonomous organizations (DAOs) on Ethereum and compatible networks.
Features
- 🏛️ Complete DAO Infrastructure - Smart contracts for governance, voting, and staking
- ⚡ One-Command Setup - Deploy your DAO with just a few CLI commands
- 🎨 Beautiful Frontend Templates - Pre-built React components with Trusset and Retro themes
- 🔐 Secure Smart Contracts - Audited contracts with access control and safety features
- 🗳️ Advanced Voting System - Proposal creation, voting, and execution
- 💰 Token Staking - Stake tokens for voting power and governance participation
- 🌍 Multi-Network Support - Ethereum, Polygon, Arbitrum, and more
- 📱 Responsive Design - Mobile-first UI components
- 🔌 Easy Integration - Simple hooks and components for custom development
Quick Start
Installation
npm install -g @trusset/dao-sdkCreate Your DAO
# Initialize a new DAO project
trusset-dao init my-awesome-dao
# Navigate to your project
cd my-awesome-dao
# Configure your DAO (edit trusset.json)
nano trusset.json
# Deploy smart contracts
trusset-dao deploy
# Start development server
trusset-dao devThat's it! Your DAO is now running locally with a beautiful frontend interface.
Configuration
trusset.json - DAO Configuration
{
"name": "My DAO",
"description": "A decentralized autonomous organization",
"chain": "sepolia",
"token": "0x...",
"admin": "0x...",
"minStake": "100000000000000000000",
"proposalFee": "10000000000000000000",
"minVotes": "1000000000000000000000",
"privateKey": "your-private-key",
"rpcUrl": "https://sepolia.infura.io/v3/your-key"
}trussetStyles.json - UI Configuration
{
"style": "trusset",
"theme": "dark",
"reownProjectId": "your-project-id",
"navigation": {
"logo": "/logo.svg",
"search": true,
"language": true,
"theme": true
},
"sidebar": {
"expandOnHover": true,
"links": [
{
"label": "Home",
"icon": "Home",
"path": "/",
"component": "HomePage"
}
]
}
}Commands
| Command | Description |
|---------|-------------|
| trusset-dao init [name] | Initialize a new DAO project |
| trusset-dao deploy | Deploy DAO smart contracts |
| trusset-dao dev | Start development server |
| trusset-dao build | Build for production |
Smart Contracts
TrussetDAO (Main Contract)
- Manages multiple DAO instances
- Handles proposal creation and voting
- Executes passed proposals
- Access control and permissions
DAOInstance (Your DAO)
- Token staking and unstaking
- Member management
- Configuration management
- Local governance functions
Frontend Components
Core Components
<Navigation />- Top navigation bar<Sidebar />- Collapsible sidebar navigation<ProposalCard />- Individual proposal display<ProposalsList />- List of proposals<VotingModal />- Vote casting interface<StakingCard />- Staking interface<TreasuryCard />- Treasury overview
Pages
<HomePage />- Dashboard overview<ProposalsPage />- Proposal management<TreasuryPage />- Financial overview<StakingPage />- Token staking
Hooks
Core Hooks
import { useDAO, useProposals, useStaking } from '@trusset/dao-sdk';
function MyComponent() {
const { createProposal, vote, isConnected } = useDAO();
const { proposals, activeProposals } = useProposals();
const { stake, unstake, userStake } = useStaking();
// Your component logic
}Available Hooks
useDAO()- Main DAO operationsuseProposals()- Proposal managementuseStaking()- Staking operationsuseTheme()- Theme managementuseLanguage()- InternationalizationuseStyles()- Style configuration
Themes
Trusset Theme
Modern, clean design inspired by Vercel's Geist design system.
Retro Theme
Nostalgic design with vibrant colors and classic elements.
Multi-Language Support
Currently supports:
- 🇺🇸 English
- 🇩🇪 German
Easy to extend with additional languages.
Network Support
| Network | Chain ID | Status | |---------|----------|---------| | Ethereum Mainnet | 1 | ✅ Supported | | Sepolia Testnet | 11155111 | ✅ Supported | | Polygon | 137 | ✅ Supported | | Arbitrum One | 42161 | ✅ Supported |
Environment Variables
# Required for wallet connection
VITE_REOWN_PROJECT_ID=your-reown-project-id
# Contract addresses (auto-generated after deployment)
VITE_DAO_ADDRESS=0x...
VITE_MAIN_DAO_ADDRESS=0x...
# Network configuration
VITE_CHAIN_ID=11155111
VITE_RPC_URL=https://sepolia.infura.io/v3/your-key
# For deployment
PRIVATE_KEY=your-private-key
ETHERSCAN_API_KEY=your-etherscan-keyDevelopment
Prerequisites
- Node.js 16+
- npm 7+
- Git
Local Development
# Clone the repository
git clone https://github.com/trusset/dao-sdk
cd dao-sdk
# Install dependencies
npm install
# Build the SDK
npm run build
# Run tests
npm test
# Start development mode
npm run devContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Security
- Smart contracts are based on OpenZeppelin standards
- All user inputs are validated and sanitized
- Time locks prevent immediate execution of critical changes
- Multi-signature support for administrative functions
Examples
Creating a Proposal
import { useDAO } from '@trusset/dao-sdk';
function CreateProposal() {
const { createProposal } = useDAO();
const handleCreate = async () => {
await createProposal(
"Increase Treasury Allocation",
"Proposal to allocate more funds to development"
);
};
return <button onClick={handleCreate}>Create Proposal</button>;
}Voting on Proposals
import { useDAO, useProposals } from '@trusset/dao-sdk';
function VotingInterface() {
const { vote } = useDAO();
const { proposals } = useProposals();
const handleVote = async (proposalId: number, support: boolean) => {
await vote(proposalId, support);
};
return (
<div>
{proposals.map(proposal => (
<div key={proposal.id}>
<h3>{proposal.title}</h3>
<button onClick={() => handleVote(proposal.id, true)}>
Vote For
</button>
<button onClick={() => handleVote(proposal.id, false)}>
Vote Against
</button>
</div>
))}
</div>
);
}License
MIT License - see LICENSE file for details.
Support
Roadmap
- [ ] Multi-signature proposal execution
- [ ] Advanced treasury management
- [ ] Plugin system for custom functionality
- [ ] Mobile app
- [ ] Layer 2 optimizations
- [ ] Cross-chain governance
Built with ❤️ by the Trusset team.
