feat: Add smart contract deployment and method call functionality#1
Open
mergedao wants to merge 1 commit into
Open
feat: Add smart contract deployment and method call functionality#1mergedao wants to merge 1 commit into
mergedao wants to merge 1 commit into
Conversation
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces features to deploy and interact with smart contracts through the mcp-wallet.
Key changes include:
deployContractandcallContractMethodto theIWalletinterface andEvmMcpWalletimplementation. These methods handle the deployment of contract bytecode and the execution of contract functions using ethers.js.deployContractandcallContractMethod, covering various scenarios including argument handling and error conditions.examples/deploy-contract.tsandexamples/call-contract.tsto demonstrate how to use the new features, including deploying a sample "Storage" contract and calling its methods.README.md,README.zh-CN.md,docs/MCP-INTEGRATION.md, anddocs/MCP-INTEGRATION.zh-CN.mdto 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.