eliza
eliza copied to clipboard
WIP: basic working plugin-evm functionality
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:
-
Added core ERC-20 functionality:
- Added ERC-20 ABI and contract interactions
- Implemented token balance checking
- Added support for token transfers
-
Implemented new actions:
getBalance: Check ETH/token balances across chainstransfer: Native token and ERC-20 transfers- Enhanced
bridge: Cross-chain token bridging via LiFi - Enhanced
swap: DEX token swaps - via LiFi aggregation
- 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?
-
Review the core changes in:
src/actions/bridge.tssrc/actions/swap.tssrc/actions/transfer.tssrc/actions/getbalance.ts
-
Check test implementation:
test/setup.ts- Test infrastructuretest/actions/bridge.test.ts- Bridge action teststest/providers/wallet.test.ts- Wallet provider tests
Detailed testing steps
- Test basic ETH operations:
// Check balance
await getbalanceAction.handler(runtime, message, state);
// Transfer ETH
await transferAction.handler(runtime, message, state);
- 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_KEYETHERSCAN_API_KEY(optional, for token verification)
- Dependencies on LiFi SDK and viem need to be properly versioned
Related to: #735
Connecting this one, seems here is done most progress > https://github.com/ai16z/eliza/pull/864
Would be cool to add crosschain zaps as well, interacting with main staking protocols to enable direct deposits from other chains
closing since old!