Skip to content
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

feat: add coinbase ERC20, ERC721, and ERC1155 tokenContract deployment / invokement plugin #803

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

monilpat
Copy link
Collaborator

@monilpat monilpat commented Dec 3, 2024

Pull Request Description

Relates to:

N/A - New feature implementation

Risks

Low - This PR adds new functionality without modifying existing features. The token contract plugin is only enabled when proper Coinbase credentials are present.

Background

What does this PR do?

This PR adds a new Coinbase token contract plugin that enables:

  1. Deployment of ERC20, ERC721, and ERC1155 token contracts
  2. Interaction with deployed smart contracts through method invocation
  3. Automatic logging of contract deployments and interactions to CSV files
  4. Integration with existing Coinbase wallet management system

What kind of change is this?

Features (non-breaking change which adds functionality)

  • Adds new token contract deployment capabilities
  • Adds contract interaction functionality
  • Extends existing Coinbase plugin suite

Documentation changes needed?

My changes require a change to the project documentation.

  • Added comprehensive documentation for the token contract plugin in docs/docs/packages/plugins.md
  • Updated plugin documentation with new features and usage examples
  • Added configuration instructions and best practices

Testing

Where should a reviewer start?

  1. Review the token contract plugin implementation:

    • packages/plugin-coinbase/src/plugins/tokenContract.ts
    • packages/plugin-coinbase/src/types.ts (new token contract types)
    • packages/plugin-coinbase/src/templates.ts (new templates)
  2. Review the integration:

    • agent/src/index.ts (plugin initialization)
    • packages/plugin-coinbase/src/index.ts (plugin exports)

Detailed testing steps

  1. Configure Coinbase credentials:

    export COINBASE_API_KEY=your_api_key
    export COINBASE_PRIVATE_KEY=your_private_key
  2. Test ERC20 token deployment:

    await runtime.triggerAction("DEPLOY_TOKEN_CONTRACT", {
      contractType: "ERC20",
      name: "TestToken",
      symbol: "TST",
      network: "base",
      totalSupply: 1000000
    });
  3. Test ERC721 (NFT) deployment:

    await runtime.triggerAction("DEPLOY_TOKEN_CONTRACT", {
      contractType: "ERC721",
      name: "TestNFT",
      symbol: "TNFT",
      network: "eth",
      baseURI: "https://api.test.com/metadata/"
    });
  4. Test contract interaction:

    await runtime.triggerAction("INVOKE_CONTRACT", {
      contractAddress: "0x123...",
      method: "transfer",
      abi: [...],
      args: {
        to: "0x456...",
        amount: "1000000000000000000"
      },
      network: "base"
    });
  5. Verify CSV logging:

    • Check contracts.csv for deployment records
    • Verify transaction details are properly logged

https://drive.google.com/file/d/1q5ezLF6KOgJdQ6x04m_lStiO2Y-jzCEq/view?usp=sharing

https://drive.google.com/file/d/1cFK9RbxTw7GaD3J0sfxva0t4UIuZrmpQ/view?usp=sharing

Files changed:

  1. packages/plugin-coinbase/src/plugins/tokenContract.ts (new)
  2. packages/plugin-coinbase/src/types.ts (updated)
  3. packages/plugin-coinbase/src/templates.ts (updated)
  4. packages/plugin-coinbase/src/index.ts (updated)
  5. agent/src/index.ts (updated)
  6. docs/docs/packages/plugins.md (updated)

Deploy Notes

No special deployment steps required. The plugin is automatically enabled when Coinbase credentials are present.

Discord username

N/A

@monilpat monilpat marked this pull request as draft December 3, 2024 00:41
@monilpat monilpat changed the title feat: add coinbase ERC20, ERC721, and ERC1155 tokenContract deployment / invokement plugins feat: add coinbase ERC20, ERC721, and ERC1155 tokenContract deployment / invokement plugin Dec 3, 2024
@monilpat monilpat marked this pull request as ready for review December 3, 2024 05:54
Copy link
Contributor

@pgoos pgoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @monilpat ! Left a few minor comments. Other than that, LGTM 🚀

@jkbrooks jkbrooks merged commit f2f567d into elizaOS:main Dec 4, 2024
3 checks passed
dsldsl pushed a commit to dsldsl/eliza that referenced this pull request Dec 7, 2024
…actPlugin

feat: add coinbase  ERC20, ERC721, and ERC1155 tokenContract deployment / invokement plugin
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.

3 participants