Skip to main content

TextDAO Contracts Development Guide

This guide provides essential information for developers working on the TextDAO smart contracts. It covers development practices, tools, and resources to ensure consistent and high-quality contract development.

Table of Contents

  1. Development Environment Setup
  2. Coding Standards
  3. MC DevKit Usage
  4. Testing Strategy
  5. Debugging and Troubleshooting
  6. Deployment Process
  7. Contribution Workflow

Development Environment Setup

To set up your development environment for TextDAO contract development:

  1. Install Foundry
  2. Clone the TextDAO monorepo:
    git clone https://github.com/ecdysisxyz/textdao-monorepo.git
  3. Navigate to the contracts package:
    cd textdao-monorepo/packages/contracts
  4. Install dependencies:
    forge install

Coding Standards

Adhering to consistent coding standards is crucial for maintainability and readability. Please refer to our Coding Standards document for detailed guidelines on:

  • Code formatting and style
  • Naming conventions
  • Documentation requirements
  • Best practices for Solidity development

MC DevKit Usage

The MC DevKit is a crucial tool for developing and testing TextDAO contracts. It provides utilities for working with the Meta Contract architecture and implements features like State Fuzzing.

For detailed information on how to use the MC DevKit effectively, please see the MC DevKit Usage Guide.

Testing Strategy

Comprehensive testing is essential for ensuring the reliability and security of TextDAO contracts. Our testing strategy includes:

  • Unit tests for individual functions
  • Integration tests for contract interactions
  • Fuzzing tests for edge cases
  • Gas optimization tests

For more information on our testing approach and best practices, refer to the Test Strategy document.

Debugging and Troubleshooting

When encountering issues during development:

  1. Use Foundry's console.log (or console2.log) for debugging Solidity code.
  2. Leverage the MC DevKit's state inspection capabilities for detailed state analysis.
  3. Review transaction traces and event logs for unexpected behaviors.
  4. Consult the TextDAO developer community for assistance with complex issues.

Deployment Process

The deployment process for TextDAO contracts involves:

  1. Compiling contracts: forge build
  2. Running pre-deployment tests: forge test
  3. Configuring deployment parameters
  4. Executing deployment scripts
  5. Verifying contracts on block explorers

For more information on our deployment instructions, refer to the Deployment Guide document.

Contribution Workflow

To contribute to the TextDAO contracts:

  1. Fork the TextDAO monorepo.
  2. Create a new branch for your feature or bug fix.
  3. Implement your changes, adhering to the coding standards and testing requirements.
  4. Submit a pull request with a clear description of your changes.
  5. Respond to any feedback from the code review process.

For more details on contributing, please refer to our Contributing Guidelines.

Additional Resources

By following these guidelines and leveraging the provided resources, you'll be well-equipped to contribute effectively to the TextDAO contract development process. If you have any questions or need further clarification, don't hesitate to reach out to the development team.