From 07e80c9d7d1db4056a7775e26c737465513ec1ee Mon Sep 17 00:00:00 2001 From: Shayan Date: Sun, 18 Aug 2024 23:27:54 +0330 Subject: [PATCH] bugfix --- core/constraints/arbitrum.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/constraints/arbitrum.py b/core/constraints/arbitrum.py index e503515..7af08d9 100644 --- a/core/constraints/arbitrum.py +++ b/core/constraints/arbitrum.py @@ -126,12 +126,13 @@ def is_observed(self, *args, **kwargs) -> bool: try: address = token_client.to_checksum_address(user_address) delegated_address = token_client.get_delegates_address() - target_address = ( - self.param_values[ConstraintParam.ADDRESS.name].lower() - if ConstraintParam.ADDRESS.name in self.param_keys() - else Web3Utils.ZERO_ADDRESS - ) - if delegated_address.lower() != target_address: + if not self.param_keys(): + if delegated_address.lower() != Web3Utils.ZERO_ADDRESS: + return True + elif ( + delegated_address.lower() + != self.param_values[ConstraintParam.ADDRESS.name].lower() + ): continue balance = token_client.get_non_native_token_balance(address) delegated_power += balance