Skip to content

Commit

Permalink
Merge branch 'ApeWorX:main' into feat/scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Barabazs authored Jul 4, 2024
2 parents 9764893 + 56690c2 commit 4b13f9c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ networks:
- name: apechain
chain_id: 31337

geth:
node:
ethereum:
apechain:
uri: http://localhost:8545
Expand Down
19 changes: 8 additions & 11 deletions ape_etherscan/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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
Expand All @@ -328,8 +326,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
Expand Down Expand Up @@ -358,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.
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,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
Expand Down Expand Up @@ -81,7 +81,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
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 4b13f9c

Please sign in to comment.