trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.03k stars 2.31k forks source link

No source fetcher for Subscan #5702

Open haltman-at opened 1 year ago

haltman-at commented 1 year ago

Issue

See also: #4779

So in addition to Etherscan, Sourcify, and Blockscout, Subscan also supports contract verification. At least, on some of its networks; not on most of them. But it supports it on a few of them, and even some ones that Etherscan and Sourcify currently don't.

(Note: One of these is Astar's Shibuya network, which uses chain ID 81, but which doesn't appear in any of the usual chain directories -- those list chain ID 81 as belonging to the Zenith testnet Vilnius...)

Now, I haven't yet tried this out, so I don't actually know yet whether its API will suffice for our purposes. But, I should try this out later and report back on whether it's good enough. And if it is, then there should be a Subscan source fetcher!

Environment

haltman-at commented 1 year ago

OK, I took a look at this because I didn't have time for much else tonight. Conclusions:

  1. Unlike the Blockscout API, the Subscan API does seem to be good enough to be usable. However...
  2. I wasn't able to determine how it handles linked libraries. It clearly does, there's a field for this, but the docs don't explain it; the example in the docs doesn't use linked libraries, so I don't know how it works when there are any present.
  3. I'd determine the answer by verifying a contract myself and trying it out, but, Subscan only supports verification on a few particular networks, and most of those aren't testnets, so they don't have faucets. The two that are testnets (Pangolin and Pangoro), I couldn't get the faucet to work.
  4. So my only way to get an answer to this question is to find a verified contract on Subscan that uses linked libraries. I couldn't find a single one.

Notionally we could exclude linked library handling -- they're a "specialization", after all -- but I'd really prefer not to.

I can file an issue with them asking for an explanation; hopefully we get a response?