diff --git a/ape_tokens/managers.py b/ape_tokens/managers.py index e1f5d50..811ccbf 100644 --- a/ape_tokens/managers.py +++ b/ape_tokens/managers.py @@ -123,9 +123,8 @@ def __getitem__(self, symbol: str) -> ContractInstance: except ValueError as err: raise KeyError(f"Symbol '{symbol}' is not a known token symbol") from err - try: - return self.chain_manager.contracts.instance_at(to_checksum_address(token_info.address)) + checksummed_address = to_checksum_address(token_info.address) + try: + return self.chain_manager.contracts.instance_at(address) except ContractNotFoundError: - return self.chain_manager.contracts.instance_at( - to_checksum_address(token_info.address), contract_type=ERC20 - ) + return self.chain_manager.contracts.instance_at(address, contract_type=ERC20)