Skip to content

ERC20 Transfer Error, Checksum #514

@mikeghen

Description

@mikeghen

Language Affected

  • Python
  • TypeScript

🐛 Describe the bug

I found this issue trying to ERC20 transfer with Python action providers. It looks like someone patched this in one place in #460, however, this shows up on most erc20 actions.

contract = Web3().eth.contract(address=validated_args.contract_address, abi=ERC20_ABI)

This causes some errors from web3py such as:

Error transferring the asset: ('Address has an invalid EIP-55 checksum. After looking up the address from the original source, try again.', '0xB4FBF271143F4FBf7B91C5ded31805e1B2B0bC1D')
Error transferring the asset: ('web3.py only accepts checksum addresses. The software that gave you this non-checksum address should be considered unsafe, please file it as a bug on their platform. Try using an ENS name instead. Or, if you must accept lower safety, use Web3.to_checksum_address(lower_case_address).', '0xb4fbf271143f4fbf7b91c5ded31805e1b2b0bc1d')

Looks like the AI just keeps trying to fix it and fails. Previous to v0.1.0, I think this worked just fine because it was using asset ids (e.g., "eth", "usdc") not contract addresses.

Versions

Python 3.11.11
Poetry (version 1.8.4)
Name: coinbase-agentkit
Version: 0.1.4
...
Name: coinbase-agentkit-langchain
Version: 0.1.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions