ApeWorX / ape

The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
https://apeworx.io
Apache License 2.0
892 stars 131 forks source link

ape compiling paris but not picking up the appropriate evm-version inside ape console on mumbai testnet [APE-1189] #1541

Open victor-ego opened 1 year ago

victor-ego commented 1 year ago

Environment information

$ ape --version 0.6.13

$ ape plugins list
  polygon      0.6.4
  infura       0.6.2
  etherscan    0.6.7
  vyper        0.6.9
  arbitrum     0.6.1
  alchemy      0.6.2
name: snekmate
contracts_folder: src
default_ecosystem: ethereum
plugins:
  - name: vyper
vyper:
  evm_version: paris

What went wrong?

commands:

ape console --network polygon:mumbai:alchemy test = accounts.load("test") contract = project.ERC721.deploy("HET", "HET", "ipfs://QmaZm1rAkt6kHTKTFX8GwEhtPMVMeAGJYMBvoAcJWTddwb", "the real protol", "1.0", sender=test)

code failure: ERROR: (TransactionError) Gas estimation failed: 'invalid opcode: opcode 0x5f not defined'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.

for snekmate to compile with Mumbai it is necessary to do so with the following:

vyper --evm-version paris contracts/ERC721.vy

i believe the error resides on the ape-config.yaml where paris is set and not compiling correctly?

How can it be fixed?

mumbai does not support PUSH0 and it is necessary to pass --evm-version paris may be forcing it in some way?

fubuloubu commented 1 year ago

related #1544

antazoey commented 1 year ago

did you try re-compiling?

antazoey commented 1 year ago

related #1544

it is not super related, except that re-compiling may be the answer to both.

victor-ego commented 1 year ago

re-compiling

every time i run ape console --network ethereum:goerli:alchemy the entire project compiles, once inside the console I see that project.TOKEN.deploy(,,,) checks ape-config.yaml

I understand that both the entire project compiles with ape console and checks ape-config.yaml with project.TOKEN.deploy(,,,)

Also changed the ape-config.yaml as suggested via @fubuloubu with no luck

dependencies:
  - name: snekmate
    github: pcaversaccio/snekmate
    version: 0.0.2
    compiler_settings:
      vyper:
        evm_version: paris

as stated here: https://docs.apeworx.io/ape/stable/userguides/dependencies.html#config-override

antazoey commented 1 year ago

you need to force a recompile. It won't compile the dependencies again if they are already compiled. It seems as they got compiled in your environment before switching the evm version somehow. If you do ape pm compile --force first, it should fix it, or ape compile --force --include-dependencies

Otherwise, ape does not know it needs to recompile the dependency. I am not really able to reproduce any other issue.

victor-ego commented 1 year ago

@antazoey i'm sorry to inform re-compiling does not solve the issue. i can deploy the smart contract running ape console --network ethereum:goerli:alchemy but not with mumbai

is there any way i can share logs for you to try reproduce this issue?

antazoey commented 1 year ago

Oh, I forgot to use mumbai, let me try that.

Thanks for confirming you did try recompiling tho! I will hunt this down and ping again if necessary

rafael-abuawad commented 1 year ago

Using a lower version of vyper seems to solve this isse if you are using Vyper 0.3.10 try using 0.3.9 instead @victor-ego