prediction-market-agent-tooling 0.69.15.dev1135__py3-none-any.whl → 0.69.15.dev1136__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of prediction-market-agent-tooling might be problematic. Click here for more details.

@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "constant": true,
4
+ "inputs": [],
5
+ "name": "processor",
6
+ "outputs": [
7
+ {
8
+ "name": "impl",
9
+ "type": "address"
10
+ }
11
+ ],
12
+ "payable": false,
13
+ "stateMutability": "view",
14
+ "type": "function"
15
+ }
16
+ ]
@@ -196,6 +196,22 @@ class ContractProxyBaseClass(ContractBaseClass):
196
196
  return Web3.to_checksum_address(address)
197
197
 
198
198
 
199
+ class ContractProcessorBaseClass(ContractBaseClass):
200
+ """
201
+ Contract base class for processor contracts.
202
+ """
203
+
204
+ abi: ABI = abi_field_validator(
205
+ os.path.join(
206
+ os.path.dirname(os.path.realpath(__file__)), "../abis/processor.abi.json"
207
+ )
208
+ )
209
+
210
+ def processor(self, web3: Web3 | None = None) -> ChecksumAddress:
211
+ address = self.call("processor", web3=web3)
212
+ return Web3.to_checksum_address(address)
213
+
214
+
199
215
  class ContractERC20BaseClass(ContractBaseClass):
200
216
  """
201
217
  Contract base class extended by ERC-20 standard methods.
@@ -948,6 +964,7 @@ def uni_implementation_address(
948
964
  # TODO: Fix the above, and afterwards assert that only 1 imp address is returned from this function. Or prove that this could indeed happen (although we are very pretty sure it shouldn't).
949
965
  addresses = [
950
966
  implementation_proxy_address(contract_address, web3),
967
+ processor_proxy_address(contract_address, web3),
951
968
  minimal_proxy_address(contract_address, web3),
952
969
  seer_minimal_proxy_address(contract_address, web3),
953
970
  eip_1967_proxy_address(contract_address, web3),
@@ -979,6 +996,29 @@ def implementation_proxy_address(
979
996
  return None
980
997
 
981
998
 
999
+ def processor_proxy_address(
1000
+ contract_address: ChecksumAddress, web3: Web3
1001
+ ) -> ChecksumAddress | None:
1002
+ if not contract_implements_function(
1003
+ contract_address, "processor", web3, look_for_proxy_contract=False
1004
+ ):
1005
+ return None
1006
+ try:
1007
+ return ContractProcessorBaseClass(address=contract_address).processor(web3)
1008
+ except (ContractCustomError, ContractLogicError, tenacity.RetryError) as e:
1009
+ if isinstance(e, tenacity.RetryError) and not isinstance(
1010
+ e.last_attempt.exception(), (ContractCustomError, ContractLogicError)
1011
+ ):
1012
+ raise
1013
+
1014
+ # For example https://gnosisscan.io/address/0x3221a28ed2b2e955da64d1d299956f277562c95c#code,
1015
+ # it has the processor method, but it's only for admins.
1016
+ logger.warning(
1017
+ f"Failed to get processor for {contract_address=} even though it has the method: {e}"
1018
+ )
1019
+ return None
1020
+
1021
+
982
1022
  def minimal_proxy_address(
983
1023
  contract_address: ChecksumAddress, web3: Web3
984
1024
  ) -> ChecksumAddress | None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.69.15.dev1135
3
+ Version: 0.69.15.dev1136
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  License-File: LICENSE
6
6
  Author: Gnosis
@@ -16,6 +16,7 @@ prediction_market_agent_tooling/abis/omen_realitio.abi.json,sha256=7HmFkBF_rq83U
16
16
  prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json,sha256=u1-3B8FB3Ys9KVJCH-lw9ArkicdxbNMf34dV-VEGMMU,930
17
17
  prediction_market_agent_tooling/abis/ownable.abi.json,sha256=DeTy_7VmsMhFl7jwI8MIlmjy2jORauYxrGm7wC_Alxw,1528
18
18
  prediction_market_agent_tooling/abis/ownable_erc721.abi.json,sha256=9sxm588MAQmqCV_S0D3eYC7l9grbeALsd0Da_AHxdEI,8506
19
+ prediction_market_agent_tooling/abis/processor.abi.json,sha256=VGMyBblTPO3I6AoKQFMgTylgJLl6-6FquUbejICDEAw,242
19
20
  prediction_market_agent_tooling/abis/proxy.abi.json,sha256=h24GXZ6Q0bSZlwh7zOv0EiDvbqUz_PHtWfKHTyPJ1w4,644
20
21
  prediction_market_agent_tooling/abis/seer_gnosis_router.abi.json,sha256=DyADzOXhy9MDS31ReVrG7ibpWbw1jVy19nExZ80xfRY,6839
21
22
  prediction_market_agent_tooling/abis/seer_market_factory.abi.json,sha256=g7RVxZVUWlTXIgTV2W6kO4twQM909Qv58zAr7Dk4XIc,13553
@@ -92,7 +93,7 @@ prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=MpS3FOM
92
93
  prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=V6o6UdesjkKzSJMhqkUtD76cJGPaNhuwA4OL2chIYSI,13801
93
94
  prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjqeAebu5T7ftRnlkxiL02IC-MxCfDB80x7w,1506
94
95
  prediction_market_agent_tooling/tools/caches/serializers.py,sha256=fwyIHUsL7u9NY7ZihTcUdqsvl2psatcbTfgWHTSez3U,2427
95
- prediction_market_agent_tooling/tools/contract.py,sha256=ZPQT3Kk9-q-ns7DO3MjQ_OLPUgeDjUTFwKP7L0vKKqc,36035
96
+ prediction_market_agent_tooling/tools/contract.py,sha256=NTV_ZEM4zS6KhEecU9scT7ac0QCwyh5zBRvU_043g5g,37467
96
97
  prediction_market_agent_tooling/tools/contract_utils.py,sha256=9X9raICUZkPDShilt02aYzS_ILZ62u0vG5081uWLdqk,2152
97
98
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
98
99
  prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=DN_8cPrr4jWVpXdS4D0j1QB19nB8fxDoSheo2BFMc8M,14523
@@ -137,8 +138,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=DPO-4HBTy1-TZHKL_9CnH
137
138
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
138
139
  prediction_market_agent_tooling/tools/utils.py,sha256=ruq6P5TFs8CBHxeBLj1Plpx7kuNFPpDgMsJGQgDiRNs,8785
139
140
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=CDbaidlLeQ4VHzSg150L7QNfHfGveljSePGuDVFEYqc,13963
140
- prediction_market_agent_tooling-0.69.15.dev1135.dist-info/METADATA,sha256=1H0d5JE8lKB6PgIB_tlN93PQHxM1fcPdnTtINOj2_Rg,8899
141
- prediction_market_agent_tooling-0.69.15.dev1135.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
142
- prediction_market_agent_tooling-0.69.15.dev1135.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
143
- prediction_market_agent_tooling-0.69.15.dev1135.dist-info/licenses/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
144
- prediction_market_agent_tooling-0.69.15.dev1135.dist-info/RECORD,,
141
+ prediction_market_agent_tooling-0.69.15.dev1136.dist-info/METADATA,sha256=gCI6QB1m9e8ILp2N_pQ-IaHeWCzt5sFcCbn5kqBGb5c,8899
142
+ prediction_market_agent_tooling-0.69.15.dev1136.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
143
+ prediction_market_agent_tooling-0.69.15.dev1136.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
144
+ prediction_market_agent_tooling-0.69.15.dev1136.dist-info/licenses/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
145
+ prediction_market_agent_tooling-0.69.15.dev1136.dist-info/RECORD,,