def read_only_call_function(self, function_name: str, *args: Optional[Any]) -> Optional[Any]
# 调用只读函数
balance = contract.read_only_call_function(
"balanceOf", # 函数名
"0x..." # 账户地址
)
if balance is not None:
print(f"Balance: {balance}")
# 调用多参数的只读函数
result = contract.read_only_call_function(
"allowance", # 函数名
"0x...", # owner 地址
"0x..." # spender 地址
)