Skip to content

Dao&nft tools #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 85 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,95 @@
## Description
# Feature/DAO NFT Tools for Base MCP

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
## Overview
This PR adds two comprehensive toolsets to the Base MCP: DAO Governance tools and NFT Operations tools. These enhancements enable AI assistants to help users interact with DAOs and analyze/mint NFTs on the Base chain, expanding the platform's capabilities for decentralized governance and digital asset management.

Fixes # (issue)
## New Features

## Type of change
### 1. DAO Governance Tools
- **Tool Name**: `create_dao`
- **Purpose**: Create a new DAO with customizable parameters
- **Input Parameters**: `name`, `description`, `tokenAddress`, `votingPeriod`, `quorumPercentage`
- **Output**: Returns DAO creation transaction details and contract address
- **Example Use Case**: Setting up a new decentralized organization for community governance

Please delete options that are not relevant.
- **Tool Name**: `create_dao_proposal`
- **Purpose**: Submit a new proposal to an existing DAO
- **Input Parameters**: `daoAddress`, `title`, `description`, `actions`
- **Output**: Returns proposal details including ID and submission confirmation
- **Example Use Case**: Proposing a treasury allocation or protocol change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- **Tool Name**: `list_dao_proposals`
- **Purpose**: Retrieve all proposals for a specific DAO
- **Input Parameters**: `daoAddress`, `status` (optional filtering)
- **Output**: Returns a list of proposals with their statuses and details
- **Example Use Case**: Browsing active governance proposals

## How Has This Been Tested?
- **Tool Name**: `get_dao_proposal_details`
- **Purpose**: Get comprehensive details about a specific proposal
- **Input Parameters**: `daoAddress`, `proposalId`
- **Output**: Returns detailed information about the proposal including voting stats
- **Example Use Case**: Reviewing a specific proposal before voting

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
- **Tool Name**: `cast_dao_vote`
- **Purpose**: Vote on an active DAO proposal
- **Input Parameters**: `daoAddress`, `proposalId`, `optionIndex`, `reason`
- **Output**: Returns voting confirmation and transaction details
- **Example Use Case**: Participating in governance decisions

## Checklist:
### 2. NFT Operations Tools
- **Tool Name**: `analyze_nft_collection`
- **Purpose**: Analyze an NFT collection for key metrics
- **Input Parameters**: `contractAddress`, `chainId` (optional)
- **Output**: Returns collection metrics including floor price, volume, and rarity data
- **Example Use Case**: Evaluating collection performance before buying or selling

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- **Tool Name**: `mint_nft`
- **Purpose**: Mint a new NFT with specified metadata
- **Input Parameters**: `name`, `description`, `imageUrl`, `attributes`, `recipientAddress`
- **Output**: Returns minting transaction details and NFT metadata
- **Example Use Case**: Creating a new digital asset with custom properties

## Screenshots (if appropriate):
## Technical Implementation

### DAO Integration
- Uses standardized governor contract ABIs
- Implements proper validation for proposal creation and voting
- Supports various governance models and voting mechanisms

### NFT Implementation
- Supports ERC721 standard for NFT operations
- Implements metadata handling for NFT analysis and creation
- Provides robust collection metrics retrieval

### Security Features
- Address format verification for all blockchain interactions
- Transaction simulation before execution
- Comprehensive error handling for invalid inputs
- Data validation using Zod schemas

## Testing
- All features tested through:
- TypeScript compilation verification with no errors
- Manual testing with example inputs
- Integration testing with the Base MCP framework
- Error handling validation for edge cases
- Documentation examples verification

## Usage Examples
Comprehensive examples are included in the updated documentation, demonstrating how to:
- Create and manage DAOs
- Submit and track proposals
- Vote on governance decisions
- Analyze NFT collections
- Mint new NFTs with custom properties

## Type of Change
- [x] New feature (non-breaking change which adds functionality)
- [x] Documentation update

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
95 changes: 95 additions & 0 deletions PR-DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Feature/DAO NFT Tools for Base MCP

## Overview
This PR adds two comprehensive toolsets to the Base MCP: DAO Governance tools and NFT Operations tools. These enhancements enable AI assistants to help users interact with DAOs and analyze/mint NFTs on the Base chain, expanding the platform's capabilities for decentralized governance and digital asset management.

## New Features

### 1. DAO Governance Tools
- **Tool Name**: `create_dao`
- **Purpose**: Create a new DAO with customizable parameters
- **Input Parameters**: `name`, `description`, `tokenAddress`, `votingPeriod`, `quorumPercentage`
- **Output**: Returns DAO creation transaction details and contract address
- **Example Use Case**: Setting up a new decentralized organization for community governance

- **Tool Name**: `create_dao_proposal`
- **Purpose**: Submit a new proposal to an existing DAO
- **Input Parameters**: `daoAddress`, `title`, `description`, `actions`
- **Output**: Returns proposal details including ID and submission confirmation
- **Example Use Case**: Proposing a treasury allocation or protocol change

- **Tool Name**: `list_dao_proposals`
- **Purpose**: Retrieve all proposals for a specific DAO
- **Input Parameters**: `daoAddress`, `status` (optional filtering)
- **Output**: Returns a list of proposals with their statuses and details
- **Example Use Case**: Browsing active governance proposals

- **Tool Name**: `get_dao_proposal_details`
- **Purpose**: Get comprehensive details about a specific proposal
- **Input Parameters**: `daoAddress`, `proposalId`
- **Output**: Returns detailed information about the proposal including voting stats
- **Example Use Case**: Reviewing a specific proposal before voting

- **Tool Name**: `cast_dao_vote`
- **Purpose**: Vote on an active DAO proposal
- **Input Parameters**: `daoAddress`, `proposalId`, `optionIndex`, `reason`
- **Output**: Returns voting confirmation and transaction details
- **Example Use Case**: Participating in governance decisions

### 2. NFT Operations Tools
- **Tool Name**: `analyze_nft_collection`
- **Purpose**: Analyze an NFT collection for key metrics
- **Input Parameters**: `contractAddress`, `chainId` (optional)
- **Output**: Returns collection metrics including floor price, volume, and rarity data
- **Example Use Case**: Evaluating collection performance before buying or selling

- **Tool Name**: `mint_nft`
- **Purpose**: Mint a new NFT with specified metadata
- **Input Parameters**: `name`, `description`, `imageUrl`, `attributes`, `recipientAddress`
- **Output**: Returns minting transaction details and NFT metadata
- **Example Use Case**: Creating a new digital asset with custom properties

## Technical Implementation

### DAO Integration
- Uses standardized governor contract ABIs
- Implements proper validation for proposal creation and voting
- Supports various governance models and voting mechanisms

### NFT Implementation
- Supports ERC721 standard for NFT operations
- Implements metadata handling for NFT analysis and creation
- Provides robust collection metrics retrieval

### Security Features
- Address format verification for all blockchain interactions
- Transaction simulation before execution
- Comprehensive error handling for invalid inputs
- Data validation using Zod schemas

## Testing
- All features tested through:
- TypeScript compilation verification with no errors
- Manual testing with example inputs
- Integration testing with the Base MCP framework
- Error handling validation for edge cases
- Documentation examples verification

## Usage Examples
Comprehensive examples are included in the updated documentation, demonstrating how to:
- Create and manage DAOs
- Submit and track proposals
- Vote on governance decisions
- Analyze NFT collections
- Mint new NFTs with custom properties

## Type of Change
- [x] New feature (non-breaking change which adds functionality)
- [x] Documentation update

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
110 changes: 110 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,116 @@ Example query to Claude:

> "Buy $20 worth of OpenRouter credits."

### analyze_nft_collection

Analyze an NFT collection for floor price, volume, rarity, and other metrics.

Parameters:

- `contractAddress`: The contract address of the NFT collection to analyze
- `chainId`: (Optional) The chain ID (defaults to Base Mainnet)

Example query to Claude:

> "Analyze the NFT collection at 0x1234567890abcdef1234567890abcdef12345678."

### mint_nft

Mint a new NFT with specified metadata and image.

Parameters:

- `name`: The name of the NFT
- `description`: The description of the NFT
- `imageUrl`: URL to the image (IPFS, Arweave, or HTTP)
- `recipientAddress`: (Optional) The recipient address (defaults to the connected wallet)
- `attributes`: (Optional) Attributes/traits for the NFT metadata, array of objects with trait_type and value

Example query to Claude:

> "Mint a new NFT called 'Cosmic Explorer' with the description 'A journey through the stars' using the image at https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/1."

### create_dao

Create a new DAO with specified governance settings.

Parameters:

- `name`: Name of the DAO
- `tokenAddress`: (Optional) Governance token address (for token-based governance)
- `members`: (Optional) Initial members for multisig/membership DAO, array of objects with address and votingPower
- `votingPeriod`: (Optional) Default voting period in seconds
- `votingDelay`: (Optional) Default delay before voting starts in seconds
- `quorumPercentage`: (Optional) Default minimum quorum percentage
- `executionDelay`: (Optional) Delay before execution in seconds

Example query to Claude:

> "Create a new DAO called 'Community Treasury' with a 3-day voting period and 4% quorum requirement."

### create_dao_proposal

Create a new proposal for DAO voting.

Parameters:

- `title`: The title of the proposal
- `description`: Detailed description of the proposal
- `options`: Voting options (at least 2)
- `endTime`: Unix timestamp when voting ends
- `daoAddress`: DAO contract address
- `snapshotBlock`: (Optional) Block number for the voting power snapshot
- `startTime`: (Optional) Unix timestamp when voting starts (default: immediately)
- `quorum`: (Optional) Minimum percentage of total voting power required
- `executionActions`: (Optional) Actions to execute if proposal passes

Example query to Claude:

> "Create a proposal in our DAO at 0x1234... titled 'Increase Developer Fund' with the description 'We should allocate more funds to support developers' with options 'For' and 'Against', ending in 5 days."

### list_dao_proposals

List all proposals for a DAO, with optional filtering by status.

Parameters:

- `daoAddress`: DAO contract address
- `status`: (Optional) Filter by proposal status: "active", "pending", "closed", or "all"
- `limit`: (Optional) Maximum number of proposals to return (default: 10)
- `skip`: (Optional) Number of proposals to skip (default: 0)

Example query to Claude:

> "Show me all active proposals in our DAO at 0x1234..."

### get_dao_proposal_details

Get detailed information about a specific DAO proposal, including votes and actions.

Parameters:

- `proposalId`: ID of the proposal to fetch
- `daoAddress`: DAO contract address

Example query to Claude:

> "Show me the details of proposal 0x1234 in our DAO at 0x5678..."

### cast_dao_vote

Cast a vote on a DAO proposal.

Parameters:

- `proposalId`: ID of the proposal to vote on
- `optionIndex`: Index of the option to vote for
- `daoAddress`: DAO contract address
- `reason`: (Optional) Reason for the vote

Example query to Claude:

> "Vote 'For' on proposal 0x1234 in our DAO with the reason 'This will help grow our community'."

## Security Considerations

- The configuration file contains sensitive information (API keys and seed phrases). Ensure it's properly secured and not shared.
Expand Down
Loading