Closed d10r closed 1 year ago
Since Truffle is being sunset, I don't plan to add new features or take on big fixes like this one. I assume that Superfluid is also moving away from Truffle since it is being sunset. If it is important that this gets fixed regardless of this, please do reach out.
TL;DR: The way proxy verification is now handled makes the assumption that the user has matching bytecode for both the proxy and the implementation contract in the current project directory. While that works fine for verifying a fresh deployment, it easily breaks down in the update case. That's because the local bytecode of the proxy contracts tends to change over time, e.g. due to compiler updates, while the on-chain bytecode will always remain the one originally deployed.
More detail: I just had this issue when trying to verify Superfluid framework contracts v1 on gnosisscan.io (thx for quickly adding support!) with v0.5.28. The proxy contracts are based on 2021 versions, built with Solidity v0.7.6. I tried to manually patch a local directory by copying over the build and contracts dir from an old version. Also had to patch the node_modules folder with a matching (older) version of the openzeppelin module. Even then,
would fail:
It seems to me that this is failing because it's trying to be smart and verify the implementation contract. I can however not provide it with valid proxy and implementation artifacts in 1 run with reasonable effort.
Thus here I ended up writing the output of such a run with
--debug
flag set to a file, manually converting that to a valid std-json-input and manually uploading that via the explorer UI. That worked (see verified contract), but this process is pretty tedious.Previous versions of the plugin had the option to be more explicit about what should be done: verify a proxy or its implementation, or both.
After this experience it seems to me that this is still needed, the ability to specify a custom proxy implementation alone isn't enough to cover such "update use cases".
This should be possible: