ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.95k stars 1.69k forks source link

Human-Readable ABI error #3328

Closed shuyabin closed 5 months ago

shuyabin commented 5 months ago

What happened?

interface_abi = [
            "function mint(uint256,uint256,uint256,uint256,bytes)",
        ]
        contract = self.w3.eth.contract(abi=interface_abi)

Code that produced the error

raise ValueError(new_error_message) from exc
ValueError: Could not format invalid value ['function mint(uint256,uint256,uint256,uint256,bytes)'] as field 'abi'


### Full error output

_No response_

### Fill this section in if you know how this could or should be fixed

_No response_

### web3 Version

6.16

### Python Version

3.12.1

### Operating System

osx

### Output from `pip freeze`

_No response_
kclowes commented 5 months ago

The ABI needs to be valid JSON. See the contract docs for the proper format. Closing since this isn't an issue with the library.