Skip to content

Commit 824a6ae

Browse files
committed
added mech marketplace support check
1 parent 66cd50c commit 824a6ae

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

mech_client/configs/mechs.json

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"arbitrum": {
2222
"agent_registry_contract": "0xa4799B083E0068732456EF45ff9fe5c683658327",
2323
"service_registry_contract": "0xE3607b00E75f6405248323A9417ff6b39B244b50",
24+
"mech_marketplace_contract": "0x0000000000000000000000000000000000000000",
2425
"rpc_url": "https://arbitrum.llamarpc.com",
2526
"wss_endpoint": "wss://arbitrum.gateway.tenderly.co",
2627
"ledger_config": {
@@ -39,6 +40,7 @@
3940
"polygon": {
4041
"agent_registry_contract": "0x984cf72FDe8B5aA910e9e508aC5e007ae5BDcC9C",
4142
"service_registry_contract": "0xE3607b00E75f6405248323A9417ff6b39B244b50",
43+
"mech_marketplace_contract": "0x0000000000000000000000000000000000000000",
4244
"rpc_url": "https://polygon-bor-rpc.publicnode.com",
4345
"wss_endpoint": "wss://polygon.gateway.tenderly.co",
4446
"ledger_config": {
@@ -57,6 +59,7 @@
5759
"base": {
5860
"agent_registry_contract": "0x88DE734655184a09B70700aE4F72364d1ad23728",
5961
"service_registry_contract": "0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE",
62+
"mech_marketplace_contract": "0x0000000000000000000000000000000000000000",
6063
"rpc_url": "https://base.llamarpc.com",
6164
"wss_endpoint": "wss://base.gateway.tenderly.co",
6265
"ledger_config": {
@@ -75,6 +78,7 @@
7578
"celo": {
7679
"agent_registry_contract": "0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA",
7780
"service_registry_contract": "0xE3607b00E75f6405248323A9417ff6b39B244b50",
81+
"mech_marketplace_contract": "0x0000000000000000000000000000000000000000",
7882
"rpc_url": "https://forno.celo.org",
7983
"wss_endpoint": "wss://forno.celo.org/ws",
8084
"ledger_config": {
@@ -93,6 +97,7 @@
9397
"optimism": {
9498
"agent_registry_contract": "0x75D529FAe220bC8db714F0202193726b46881B76",
9599
"service_registry_contract": "0x3d77596beb0f130a4415df3D2D8232B3d3D31e44",
100+
"mech_marketplace_contract": "0x0000000000000000000000000000000000000000",
96101
"rpc_url": "https://mainnet.optimism.io",
97102
"wss_endpoint": "wss://optimism.gateway.tenderly.co",
98103
"ledger_config": {

mech_client/interact.py

-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ def __post_init__(self) -> None:
139139
if service_registry_contract:
140140
self.service_registry_contract = service_registry_contract
141141

142-
mech_marketplace_contract = os.getenv("MECHX_MECH_MARKETPLACE_CONTRACT")
143-
if mech_marketplace_contract:
144-
self.mech_marketplace_contract = mech_marketplace_contract
145-
146142
rpc_url = os.getenv("MECHX_CHAIN_RPC")
147143
if rpc_url:
148144
self.rpc_url = rpc_url

mech_client/marketplace_interact.py

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from aea_ledger_ethereum import EthereumApi, EthereumCrypto
3636
from eth_utils import to_checksum_address
3737
from web3.contract import Contract as Web3Contract
38+
from web3.constants import ADDRESS_ZERO
3839

3940
from mech_client.fetch_ipfs_hash import fetch_ipfs_hash
4041
from mech_client.interact import (
@@ -657,6 +658,10 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
657658
mech_marketplace_contract = mech_config.mech_marketplace_contract
658659
chain_id = ledger_config.chain_id
659660

661+
if mech_marketplace_contract == ADDRESS_ZERO:
662+
print(f"Mech Marketplace not yet supported on {chain_config}")
663+
return None
664+
660665
config_values = CHAIN_TO_DEFAULT_MECH_MARKETPLACE_REQUEST_CONFIG[chain_id].copy()
661666
if priority_mech_address is not None:
662667
print("Custom Mech detected")

0 commit comments

Comments
 (0)