ApeWorX / ape-etherscan

Etherscan explorer plugin using EVM-based networks for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
25 stars 25 forks source link

publish on deploy not working: Invalid constructor arguments provided. Please verify that they are in ABI-encoded format #111

Open martinkrung opened 10 months ago

martinkrung commented 10 months ago

Environment information

$ ape --version
0.7.0
Installed Plugins
  alchemy      0.7.0
  arbitrum     0.7.0
  ens          0.7.0
  etherscan    0.7.0
  foundry      0.7.0
  hardhat      0.7.0
  infura       0.7.0
  solidity     0.7.0
  template     0.7.0
  tokens       0.7.0
  vyper        0.7.0
  - name: solidity
  - name: vyper
  - name: foundry
  - name: infura
  - name: tokens
  - name: etherscan
  - name: arbitrum

# require OpenZepplin Contracts
dependencies:
  - name: openzeppelin
    github: OpenZeppelin/openzeppelin-contracts
    version: 4.8.1
  - name: openzeppelin-upgradeable
    github: OpenZeppelin/openzeppelin-contracts-upgradeable
    version: 4.8.1
  - name: vault
    github: yearn/yearn-vaults
    version: 0.4.5

solidity:
  import_remapping:
    - "@openzeppelin/contracts=openzeppelin/v4.8.1"
    - "@openzeppelin/contracts-upgradeable=openzeppelin-upgradeable/v4.8.1"

default_ecosystem: ethereum

ethereum:
  default_network: mainnet-fork
  mainnet:
    default_provider: infura
  mainnet_fork:
    default_provider: foundry

arbitrum:
  default_network: mainnet-fork
  mainnet:
    default_provider: infura
  mainnet_fork:
    default_provider: foundry

compile:
  exclude:
   - "*.json"

What went wrong?

Command

    # deploy vlToken    
    vl_token = project.VoteLockToken.deploy(ARBITRUM_BASE_TOKEN_ADDRESS, ARBITRUM_TREASURY_ADDRESS, ARBITRUM_COLLECTOR_ADDRESS, sender=account, publish=True)
INFO: Submitted https://sepolia.etherscan.io/tx/0x61b295b69a376a07da2ffb9e347a6a73b9543f35cc6af701821c9083ccb78364
Confirmations (2/2): 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:28<00:00, 14.30s/it]
INFO: Confirmed 0x61b295b69a376a07da2ffb9e347a6a73b9543f35cc6af701821c9083ccb78364 (total fees paid = 108361164676040472)
SUCCESS: Contract 'VoteLockToken' deployed to: 0xF0B636adD8eaFB85860E383E48c20668A6Ea133F
INFO: Publishing and verifying contract using 'etherscan'.

  File "/home/m/dev/points/vlToken/scripts/deploy.py", line 31, in deploy_vl_token
    vl_token = project.VoteLockToken.deploy(ARBITRUM_BASE_TOKEN_ADDRESS, ARBITRUM_TREASURY_ADDRESS, ARBITRUM_COLLECTOR_ADDRESS, sender=account, publish=True)

ERROR: (EtherscanResponseError) Response indicated failure: Invalid constructor arguments provided. Please verify that they are in ABI-encoded format

How can it be fixed?

No idea

linear[bot] commented 10 months ago

APE-1626 publish on deploy not working: Invalid constructor arguments provided. Please verify that they are in ABI-encoded format

martinkrung commented 10 months ago

Na, maybe the source of this problem is this

    return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/home/m/dev/points/vlToken/contracts/vyper/interfaces/ERC20.json'

I generated a that with vyper -f abi from an ERC20.vy and put it at that place, so maybe this is a little reckless and not how this should be done.

antazoey commented 9 months ago

I don't think Vyper is supported yet for programmatic Etherscan verification. For example, look at the part of the API docs: https://docs.etherscan.io/contract-verification/verifying-contracts-programmatically#id-4.-configuring-source-code-parameters

It says the supported values for the compilerversion field is on this list: https://etherscan.io/solcversions And all of those are Solidity.

I would like to get Vyper verification working, maybe there is a way!