Skip to content

feat: Add smart contract deployment and method call functionality#1

Open
mergedao wants to merge 1 commit into
dushaobindoudou:mainfrom
mergedao:feat/contract-interaction
Open

feat: Add smart contract deployment and method call functionality#1
mergedao wants to merge 1 commit into
dushaobindoudou:mainfrom
mergedao:feat/contract-interaction

Conversation

@mergedao

Copy link
Copy Markdown

This commit introduces features to deploy and interact with smart contracts through the mcp-wallet.

Key changes include:

  • New Wallet Methods: Added deployContract and callContractMethod to the IWallet interface and EvmMcpWallet implementation. These methods handle the deployment of contract bytecode and the execution of contract functions using ethers.js.
  • MCP Server Integration: Exposed the new functionalities in the MCP server, allowing me to perform these operations. This includes input/output schemas and integration with the existing confirmation flow.
  • Unit Tests: Implemented comprehensive unit tests for deployContract and callContractMethod, covering various scenarios including argument handling and error conditions.
  • Examples: Created examples/deploy-contract.ts and examples/call-contract.ts to demonstrate how to use the new features, including deploying a sample "Storage" contract and calling its methods.
  • Documentation: Updated README.md, README.zh-CN.md, docs/MCP-INTEGRATION.md, and docs/MCP-INTEGRATION.zh-CN.md to reflect the new capabilities, their usage via MCP, and how they fit into a typical development workflow with tools like Hardhat.

These changes enable you (or me via MCP) to manage the lifecycle of smart contracts, from deployment to interaction, using the mcp-wallet.

This commit introduces features to deploy and interact with smart contracts through the mcp-wallet.

Key changes include:

-   **New Wallet Methods**: Added `deployContract` and `callContractMethod` to the `IWallet` interface and `EvmMcpWallet` implementation. These methods handle the deployment of contract bytecode and the execution of contract functions using ethers.js.
-   **MCP Server Integration**: Exposed the new functionalities in the MCP server, allowing me to perform these operations. This includes input/output schemas and integration with the existing confirmation flow.
-   **Unit Tests**: Implemented comprehensive unit tests for `deployContract` and `callContractMethod`, covering various scenarios including argument handling and error conditions.
-   **Examples**: Created `examples/deploy-contract.ts` and `examples/call-contract.ts` to demonstrate how to use the new features, including deploying a sample "Storage" contract and calling its methods.
-   **Documentation**: Updated `README.md`, `README.zh-CN.md`, `docs/MCP-INTEGRATION.md`, and `docs/MCP-INTEGRATION.zh-CN.md` to reflect the new capabilities, their usage via MCP, and how they fit into a typical development workflow with tools like Hardhat.

These changes enable you (or me via MCP) to manage the lifecycle of smart contracts, from deployment to interaction, using the mcp-wallet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant