diff --git a/pyproject.toml b/pyproject.toml index 71b10b8..4a05801 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ packages = [ {include = "thirdweb"}, ] readme = "README.md" -version = "3.1.0" +version = "3.1.1" [tool.poetry.dependencies] python = ">=3.7.1" diff --git a/thirdweb/contracts/custom.py b/thirdweb/contracts/custom.py index eb0511f..d68e807 100644 --- a/thirdweb/contracts/custom.py +++ b/thirdweb/contracts/custom.py @@ -1,5 +1,6 @@ from typing import Any, Final, Optional, cast from eth_typing import Address +from thirdweb.core.classes.contract_events import ContractEvents from web3 import Web3 from web3.contract import ContractFunctions, ContractFunction @@ -74,6 +75,7 @@ class CustomContract(BaseContract[Any]): contract_type: Final[ContractType] = ContractType.CUSTOM functions: ContractFunctions + events: ContractEvents def __init__( self, @@ -105,6 +107,8 @@ def __init__( self.erc721 = self._detect_erc_721() self.erc1155 = self._detect_erc_1155() + self.events = ContractEvents(contract_wrapper) + def call(self, fn: str, *args) -> Any: func = cast(ContractFunction, getattr(self.functions, fn, None)) if func is None: