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

WIP: basic working plugin-evm functionality #952

Closed

Conversation

yourbuddyconner
Copy link

@yourbuddyconner yourbuddyconner commented Dec 10, 2024

Here's a PR description for the EVM plugin changes:

Background

What does this PR do?

This PR significantly enhances the EVM plugin functionality with several key improvements:

  1. Added core ERC-20 functionality:

    • Added ERC-20 ABI and contract interactions
    • Implemented token balance checking
    • Added support for token transfers
  2. Implemented new actions:

    • getBalance: Check ETH/token balances across chains
    • transfer: Native token and ERC-20 transfers
    • Enhanced bridge: Cross-chain token bridging via LiFi
    • Enhanced swap: DEX token swaps
    • via LiFi aggregation
Screenshot 2024-12-09 at 7 10 14 PM
  1. Fixed type safety issues and improved error handling

What kind of change is this?

  • Features (non-breaking change which adds functionality)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)

Risks

Medium:

  • Changes to core wallet functionality could impact transaction signing
  • Updates to bridge/swap logic could affect cross-chain operations
  • ERC-20 integration adds complexity to token handling

Testing

Where should a reviewer start?

  1. Review the core changes in:

    • src/actions/bridge.ts
    • src/actions/swap.ts
    • src/actions/transfer.ts
    • src/actions/getbalance.ts
  2. Check test implementation:

    • test/setup.ts - Test infrastructure
    • test/actions/bridge.test.ts - Bridge action tests
    • test/providers/wallet.test.ts - Wallet provider tests

Detailed testing steps

  1. Test basic ETH operations:
// Check balance
await getbalanceAction.handler(runtime, message, state);

// Transfer ETH
await transferAction.handler(runtime, message, state);
  1. Test ERC-20 operations:
// Check USDC balance
await getbalanceAction.handler(runtime, {
  chain: "ethereum",
  tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
});

// Bridge tokens
await bridgeAction.handler(runtime, {
  fromChain: "ethereum",
  toChain: "base",
  amount: "100",
  tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
});

Documentation changes needed?

Yes, documentation updates needed for:

  • New ERC-20 functionality
  • Updated action parameters
  • Testing setup and mocking

Deploy Notes

  • Requires environment variables:
    • EVM_PRIVATE_KEY
    • ETHERSCAN_API_KEY (optional, for token verification)
  • Dependencies on LiFi SDK and viem need to be properly versioned

Related to: #735

@yourbuddyconner yourbuddyconner changed the title WIP: basic working evm-plugin functionality WIP: basic working plugin-evm functionality Dec 10, 2024
@0xCardinalError
Copy link
Contributor

0xCardinalError commented Dec 11, 2024

Connecting this one, seems here is done most progress > #864

@Slava-g1
Copy link

Would be cool to add crosschain zaps as well, interacting with main staking protocols to enable direct deposits from other chains

@wtfsayo
Copy link
Member

wtfsayo commented Jan 15, 2025

closing since old!

@wtfsayo wtfsayo closed this Jan 15, 2025
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.

4 participants