Contract.base_contracts()
Returns Contracts object for the contracts from which contract was inherited directly or indirectly.
base_contracts() β
Contracts
It returns the Contracts object representing the base contracts of a Contract. The function is recursive. See the example.
Example query
Example output
If you add print(contract.source_code())
to the loop, you will see these contracts in the declaration: contract ERC721 is Context, ERC165, IERC721, IERC721Metadata
. Note that the function outputs IERC165
, though it is not directly inherited.
Last updated