ApeWorX / ape-vyper

Vyper compiler plugin for the Ape Framework, using VVM
https://www.apeworx.io/
Apache License 2.0
26 stars 9 forks source link

support vyper 0.3.10 [APE-1462] #96

Closed bout3fiddy closed 11 months ago

bout3fiddy commented 11 months ago

Environment information

$ ape --version
# 0.6.22

$ ape plugins list
# Installed Plugins
  alchemy      0.6.5
  arbitrum     0.6.4
  etherscan    0.6.10
  hardhat      0.6.13
  ledger       0.6.2
  optimism     0.6.4
  polygon      0.6.6
  vyper        0.6.11

Third-party Plugins
  gnosis       0.2.0

What went wrong?

ERROR: (VyperCompileError) CurveStableSwapMetaNG.vy
StructureException:compiler options indicate optimization mode OptimizationLevel.GAS, but source pragma indicates OptimizationLevel.CODESIZE.

The preamble:

# @version 0.3.10
#pragma optimize codesize

To reproduce: run ape compile with anything as long as the contract says optimise codesize.

How can it be fixed?

It seems there is a collision in the input_json.

here is the problem: https://github.com/ApeWorX/ape-vyper/blob/798874a33b1f494e99ce634edcd62a893c7a1077/ape_vyper/compiler.py#L443