From 1de11f6e8014fb2482a397b21840aafdf9712f68 Mon Sep 17 00:00:00 2001 From: Dalena Date: Wed, 3 Jul 2024 09:40:04 -0500 Subject: [PATCH 1/3] docs: change geth to node in README (#135) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d60119f..ca75dfa 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ networks: - name: apechain chain_id: 31337 -geth: +node: ethereum: apechain: uri: http://localhost:8545 From 6752356242b8fe7f2213180cc0db0faa2664c895 Mon Sep 17 00:00:00 2001 From: antazoey Date: Wed, 3 Jul 2024 12:12:56 -0500 Subject: [PATCH 2/3] fix: source id mismatch error (#140) --- .pre-commit-config.yaml | 4 ++-- ape_etherscan/verify.py | 3 +-- setup.py | 6 +++--- tests/conftest.py | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d7770d4..cb2a9c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,12 +16,12 @@ repos: name: black - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy additional_dependencies: [types-PyYAML, types-requests, types-setuptools, pydantic] diff --git a/ape_etherscan/verify.py b/ape_etherscan/verify.py index db8daa8..18dd830 100644 --- a/ape_etherscan/verify.py +++ b/ape_etherscan/verify.py @@ -328,8 +328,7 @@ def attempt_verification(self): # NOTE: Etherscan does not allow directory prefixes on the source ID. if self.provider.network.ecosystem.name in ECOSYSTEMS_VERIFY_USING_JSON: - request_source_id = Path(source_id).name - contract_name = f"{request_source_id}:{self.contract_type.name or ''}" + contract_name = f"{source_id}:{self.contract_type.name or ''}" else: # When we have a flattened contract, we don't need to specify the file name # only the contract name diff --git a/setup.py b/setup.py index 7da62b9..8944c30 100644 --- a/setup.py +++ b/setup.py @@ -22,11 +22,11 @@ ], "lint": [ "black>=24.4.2,<25", # auto-formatter and linter - "mypy>=1.10.0,<2", # Static type analyzer + "mypy>=1.10.1,<2", # Static type analyzer "types-requests>=2.28.7", # Needed due to mypy typeshed "types-setuptools", # Needed due to mypy typeshed "types-PyYAML", # Needed due to mypy typeshed - "flake8>=7.0.0,<8", # Style linter + "flake8>=7.1.0,<8", # Style linter "flake8-breakpoint>=1.1.0,<2", # Detect breakpoints left in code "flake8-print>=5.0.0,<6", # Detect print statements left in code "isort>=5.13.2,<6", # Import sorting linter @@ -80,7 +80,7 @@ url="https://github.com/ApeWorX/ape-etherscan", include_package_data=True, install_requires=[ - "eth-ape>=0.8.2,<0.9", + "eth-ape>=0.8.8,<0.9", "ethpm_types", # Use same version as eth-ape "requests", # Use same version as eth-ape "yarl", # Use same version as eth-ape diff --git a/tests/conftest.py b/tests/conftest.py index 6480166..78eeb66 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -489,7 +489,7 @@ def verification_params(address_to_verify, standard_input_json): "codeformat": "solidity-standard-json-input", "constructorArguements": ctor_args, "contractaddress": address_to_verify, - "contractname": "foo.sol:foo", + "contractname": "tests/contracts/subcontracts/foo.sol:foo", "evmversion": None, "licenseType": LicenseType.AGLP_3.value, "module": "contract", @@ -517,7 +517,7 @@ def verification_params_with_ctor_args( "codeformat": "solidity-standard-json-input", "constructorArguements": constructor_arguments, "contractaddress": address_to_verify_with_ctor_args, - "contractname": "foo.sol:fooWithConstructor", + "contractname": "tests/contracts/subcontracts/foo.sol:fooWithConstructor", "evmversion": None, "licenseType": LicenseType.AGLP_3.value, "module": "contract", From 56690c217b5b8185b32b378569bc8acf3c63d981 Mon Sep 17 00:00:00 2001 From: antazoey Date: Wed, 3 Jul 2024 15:53:26 -0500 Subject: [PATCH 3/3] fix: verification pointlessly regenerates settings issue (#142) --- ape_etherscan/verify.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ape_etherscan/verify.py b/ape_etherscan/verify.py index 18dd830..d6927e6 100644 --- a/ape_etherscan/verify.py +++ b/ape_etherscan/verify.py @@ -39,7 +39,7 @@ } _SPDX_ID_KEY = "SPDX-License-Identifier: " -ECOSYSTEMS_VERIFY_USING_JSON = ("ethereum",) +ECOSYSTEMS_VERIFY_USING_JSON = ("arbitrum", "base", "blast", "ethereum") class LicenseType(Enum): @@ -289,8 +289,6 @@ def attempt_verification(self): version = str(self.compiler.version) - # TODO: Fix compiler output in ape-solidity - # and/or add more validation to ethpm_types.Compiler compiler = self.compiler valid = True settings = {} @@ -299,12 +297,12 @@ def attempt_verification(self): output_contracts = settings.get("outputSelection", {}) for contract_id in self.compiler.contractTypes or []: parts = contract_id.split(":") - if len(parts) != 2: - # Bad compiler. - valid = False - continue + if len(parts) == 2: + _, cname = parts + + else: + cname = parts[0] - _, cname = parts if cname not in output_contracts: valid = False break @@ -357,7 +355,7 @@ def attempt_verification(self): def _get_new_settings(self, version: str) -> dict: logger.warning( - "Settings missing from cached manifest. " "Attempting to re-calculate find settings." + "Settings missing from cached manifest. Attempting to re-calculate to find settings." ) # Attempt to re-calculate settings.