From 6920be95e790e28a8aecda96c457807d26ac31ed Mon Sep 17 00:00:00 2001 From: Eugene M Date: Fri, 12 Apr 2024 14:37:56 +0300 Subject: [PATCH] cfg: add wstETH on Manta sepolia --- .../testnet/manta_testnet_config_L1.json | 20 ++++++++++++++++++ .../testnet/manta_testnet_config_L2.json | 21 +++++++++++++++++++ .../testnet/manta_testnet_config_L2_gov.json | 19 +++++++++++++++++ utils/explorer.py | 18 ++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 config_samples/manta/testnet/manta_testnet_config_L1.json create mode 100644 config_samples/manta/testnet/manta_testnet_config_L2.json create mode 100644 config_samples/manta/testnet/manta_testnet_config_L2_gov.json diff --git a/config_samples/manta/testnet/manta_testnet_config_L1.json b/config_samples/manta/testnet/manta_testnet_config_L1.json new file mode 100644 index 0000000..39d037d --- /dev/null +++ b/config_samples/manta/testnet/manta_testnet_config_L1.json @@ -0,0 +1,20 @@ +{ + "contracts": { + "0xCB4619437C5Bb35d26346DeA9FeB9bD73c4f2633": "OssifiableProxy", + "0x82ce64B6Daa2FB7474F845FDdE67DC413cbcf6b6": "L1ERC20TokenBridge" + }, + "explorer_hostname": "api-sepolia.etherscan.io", + "explorer_token_env_var": "ETHERSCAN_EXPLORER_TOKEN", + "github_repo": { + "url": "https://github.com/lidofinance/lido-l2", + "commit": "384be204288d04ea8557242cee57d4dc8e521aa4", + "relative_root": "" + }, + "dependencies": { + "@openzeppelin/contracts": { + "url": "https://github.com/OpenZeppelin/openzeppelin-contracts", + "commit": "d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322", + "relative_root": "contracts" + } + } +} diff --git a/config_samples/manta/testnet/manta_testnet_config_L2.json b/config_samples/manta/testnet/manta_testnet_config_L2.json new file mode 100644 index 0000000..77478fb --- /dev/null +++ b/config_samples/manta/testnet/manta_testnet_config_L2.json @@ -0,0 +1,21 @@ +{ + "contracts": { + "0x1a8722848c0EF04b7534A20EDeDC579542f7c99A": "OssifiableProxy", + "0x23E1087Cd4B4bFbc6Ce318DdA2261Fd7d9749e0D": "L2ERC20TokenBridge", + "0x9b72b0D75e2eb87579694E842741738d3a9C311E": "OssifiableProxy", + "0xA1A49E457Fe100Be6D98C4C7C845Ed31583e9EE4": "ERC20Bridged" + }, + "explorer_hostname": "manta-sepolia.explorer.caldera.xyz", + "github_repo": { + "url": "https://github.com/lidofinance/lido-l2", + "commit": "384be204288d04ea8557242cee57d4dc8e521aa4", + "relative_root": "" + }, + "dependencies": { + "@openzeppelin/contracts": { + "url": "https://github.com/OpenZeppelin/openzeppelin-contracts", + "commit": "d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322", + "relative_root": "contracts" + } + } +} diff --git a/config_samples/manta/testnet/manta_testnet_config_L2_gov.json b/config_samples/manta/testnet/manta_testnet_config_L2_gov.json new file mode 100644 index 0000000..3b5ccfe --- /dev/null +++ b/config_samples/manta/testnet/manta_testnet_config_L2_gov.json @@ -0,0 +1,19 @@ +{ + "contracts": { + "0xA74Eb604b0995409F7203BDc3Ae2c7a001873eEb": "OptimismBridgeExecutor" + }, + "explorer_hostname": "manta-sepolia.explorer.caldera.xyz", + "github_repo": { + "url": "https://github.com/lidofinance/governance-crosschain-bridges", + "commit": "8fa25b0080dd3dcc2390313631aea6796a12c9d8", + "relative_root": "" + }, + "dependencies": { + "@openzeppelin/contracts": { + "url": "https://github.com/OpenZeppelin/openzeppelin-contracts", + "commit": "d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322", + "relative_root": "contracts", + "//": "OZ 4.6.0" + } + } +} diff --git a/utils/explorer.py b/utils/explorer.py index ab3be06..112f445 100644 --- a/utils/explorer.py +++ b/utils/explorer.py @@ -77,6 +77,22 @@ def _get_contract_from_mantle(mantle_explorer_hostname, contract): return (data["ContractName"], source_files) +def _get_contract_from_manta_caldera(manta_caldera_explorer_hostname, contract): + manta_caldera_link = ( + f"https://{manta_caldera_explorer_hostname}/api/v2/smart-contracts/{contract}" + ) + response = fetch(manta_caldera_link) + + if "name" not in response: + _errorNoSourceCodeAndExit(contract) + + source_files = [(response["file_path"], {"content": response["source_code"]})] + for entry in response.get("additional_sources", []): + source_files.append((entry["file_path"], {"content": entry["source_code"]})) + + return (response["name"], source_files) + + def get_contract_from_explorer(token, explorer_hostname, contract): if explorer_hostname.startswith("zksync"): return _get_contract_from_zksync(explorer_hostname, contract) @@ -84,4 +100,6 @@ def get_contract_from_explorer(token, explorer_hostname, contract): return _get_contract_from_mantle(explorer_hostname, contract) if explorer_hostname.endswith("lineascan.build"): return _get_contract_from_etherscan(None, explorer_hostname, contract) + if explorer_hostname.startswith("manta"): + return _get_contract_from_manta_caldera(explorer_hostname, contract) return _get_contract_from_etherscan(token, explorer_hostname, contract)