hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Support programmatic Vyper verification

Open pcaversaccio opened this issue 1 year ago • 1 comments

Describe the feature

Vyper 0.4.0 has shipped besides the new modules system a novel archive format that should be leveraged for verification: https://github.com/vyperlang/vyper/pull/3891. You can do stuff like:

~$ vyper -f archive Foo.vy > Foo.vyz # The tentative canonical suffix for Vyper archive (the zipfile version)
is `.vyz`.
~$ vyper Foo.vyz # Directly compile the archive file.
~$ vyper -f solc_json Foo.vy # Outputs the build in solc json format.
~$ vyper -f archive --base64 Foo.vy # Outputs the base64 encoded archive file.
~$ vyper -f integrity Foo.vy # Output the integrity hash (uses `sha256sum` (https://github.com/vyperlang/vyper/blob/f92ef414a551de34b64ae09ba2985ee240244c4c/vyper/utils.py#L197)) of the source code.

If you want to test it:

# pragma version ~=0.4.0
"""
@custom:contract-name Foo
"""

IMMUTABLE_1: public(immutable(String[4]))

@deploy
def __init__():
    IMMUTABLE_1 = "Test"

Blockscout already supports the solc_json version of it. You can see a verified example contract on Blockscout which already supports it (using the -f solc_json flag): https://eth-sepolia.blockscout.com/address/0x97E68f1Dc2e86bc87e3c01e2Df1075859B5a4856:

image

I would love to see the integration of Vyper verification into the Hardhat verification plugin.

Search terms

vyper, verification

pcaversaccio avatar Jul 03 '24 09:07 pcaversaccio

Etherscan now allows for programmatic verification of Vyper contracts; see here.

pcaversaccio avatar Nov 14 '24 08:11 pcaversaccio