diff --git a/ape_vyper/compiler.py b/ape_vyper/compiler.py index 3899bc19..4abcf821 100644 --- a/ape_vyper/compiler.py +++ b/ape_vyper/compiler.py @@ -100,7 +100,7 @@ def get_version_pragma_spec(source: Union[str, Path]) -> Optional[SpecifierSet]: return None -def get_optimization_pragma(source: Union[str, Path]) -> Optional[str | bool]: +def get_optimization_pragma(source: Union[str, Path]) -> str | bool | None: """ Extracts optimization pragma information from Vyper source code. diff --git a/tests/contracts/passing_contracts/optimize_codesize.vy b/tests/contracts/passing_contracts/optimize_codesize.vy new file mode 100644 index 00000000..754f0ff0 --- /dev/null +++ b/tests/contracts/passing_contracts/optimize_codesize.vy @@ -0,0 +1,8 @@ +#pragma version 0.3.10 +#pragma optimize codesize + +x: uint256 + +@external +def __init__(): + self.x = 0