Skip to content

Fix critical bugs, add message signing capabilities and multicall tool - #24

Merged
wayzeek merged 2 commits into
mcpdotdirect:mainfrom
aaurelions:fix/critical-bugs-and-add-message-signing
Nov 26, 2025
Merged

wayzeek merged 2 commits into
mcpdotdirect:mainfrom
aaurelions:fix/critical-bugs-and-add-message-signing

Conversation

@aaurelions

Copy link
Copy Markdown
Contributor

Critical Bug Fixes

  • Fix parameter order mismatch in approve_token_spending tool
    • Corrected approveERC20 function call arguments
    • This bug prevented token approvals from working
  • Fix Buffer compatibility issue in wallet.ts for Bun runtime
    • Replaced Node.js Buffer with platform-agnostic Array conversion
    • Ensures compatibility across Bun and Node.js environments

New Features

  • Add message signing service functions (wallet.ts)
    • signMessage(): Sign arbitrary messages for authentication
    • signTypedData(): Sign EIP-712 structured data
  • Add sign_message MCP tool
    • Enables SIWE authentication flows
    • Supports off-chain signature verification
  • Add sign_typed_data MCP tool
    • Enables gasless transactions via meta-transactions
    • Supports EIP-2612 permit signatures
    • Enables relay service integration

Documentation

  • Update README with message signing capabilities section
  • Add new tools to API reference (24 tools total, up from 22)
  • Document SIWE, permit, and meta-transaction support

These changes enable AI agents to:

  • Authenticate using Sign-In With Ethereum (SIWE)
  • Create meta-transactions for gasless transfers
  • Generate permit signatures for off-chain approvals
  • Sign any EIP-712 structured data for dApp integrations

## Critical Bug Fixes

- Fix parameter order mismatch in approve_token_spending tool
  - Corrected approveERC20 function call arguments
  - This bug prevented token approvals from working
- Fix Buffer compatibility issue in wallet.ts for Bun runtime
  - Replaced Node.js Buffer with platform-agnostic Array conversion
  - Ensures compatibility across Bun and Node.js environments

## New Features

- Add message signing service functions (wallet.ts)
  - signMessage(): Sign arbitrary messages for authentication
  - signTypedData(): Sign EIP-712 structured data
- Add sign_message MCP tool
  - Enables SIWE authentication flows
  - Supports off-chain signature verification
- Add sign_typed_data MCP tool
  - Enables gasless transactions via meta-transactions
  - Supports EIP-2612 permit signatures
  - Enables relay service integration

## Documentation

- Update README with message signing capabilities section
- Add new tools to API reference (24 tools total, up from 22)
- Document SIWE, permit, and meta-transaction support

These changes enable AI agents to:

- Authenticate using Sign-In With Ethereum (SIWE)
- Create meta-transactions for gasless transfers
- Generate permit signatures for off-chain approvals
- Sign any EIP-712 structured data for dApp integrations
  Add multicall tool to batch multiple contract read calls into a single RPC request using the
  Multicall3 contract. This significantly reduces latency and RPC usage when querying multiple contract
   functions.

  Features:
  - Automatic ABI fetching from block explorers for verified contracts
  - Fallback to common function signatures (ERC20 standards)
  - Partial failure support - returns successful results even if some calls fail
  - ENS name support for contract addresses
  - Works across all 60+ supported networks

  New tool:
  - multicall: Batch multiple contract reads in a single call

  Use cases:
  - Portfolio analysis: Get multiple token balances at once
  - Price aggregation: Query multiple DEX prices simultaneously
  - Token metadata: Fetch name, symbol, decimals, totalSupply in one call
  - Protocol state: Check multiple contract parameters efficiently

  Service functions:
  - Added multicall() to src/core/services/contracts.ts

  Documentation:
  - Updated tool count from 24 to 25
  - Added multicall usage example with USDC contract
  - Added multicall to API reference table
@aaurelions

Copy link
Copy Markdown
Contributor Author

Add multicall tool to batch multiple contract read calls into a single RPC request using the Multicall3 contract.

This significantly reduces latency and RPC usage when querying multiple contract functions.

Features:

  • Automatic ABI fetching from block explorers for verified contracts
  • Fallback to common function signatures (ERC20 standards)
  • Partial failure support - returns successful results even if some calls fail
  • ENS name support for contract addresses
  • Works across all 60+ supported networks

New tool:

  • multicall: Batch multiple contract reads in a single call

Use cases:

  • Portfolio analysis: Get multiple token balances at once
  • Price aggregation: Query multiple DEX prices simultaneously
  • Token metadata: Fetch name, symbol, decimals, totalSupply in one call
  • Protocol state: Check multiple contract parameters efficiently

Service functions:

  • Added multicall() to src/core/services/contracts.ts

Documentation:

  • Updated tool count from 24 to 25
  • Added multicall usage example with USDC contract
  • Added multicall to API reference table

@aaurelions aaurelions mentioned this pull request Nov 24, 2025
@aaurelions aaurelions changed the title Fix critical bugs and add message signing capabilities Fix critical bugs, add message signing capabilities and multicall tool Nov 24, 2025
@wayzeek

wayzeek commented Nov 26, 2025

Copy link
Copy Markdown
Member

@claude please review this PR

@wayzeek wayzeek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that looks great so far, thank you ! @aaurelions

@wayzeek

wayzeek commented Nov 26, 2025

Copy link
Copy Markdown
Member

Excellent, let's get it to merge !
Thank you for your contribution @aaurelions

@wayzeek
wayzeek merged commit 5d5a8ee into mcpdotdirect:main Nov 26, 2025
@aaurelions
aaurelions deleted the fix/critical-bugs-and-add-message-signing branch November 26, 2025 20:23
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.

2 participants