cast-etherscan-source - Get the source code of a contract from Etherscan.
cast etherscan-source
[options] address
Get the source code of a contract from Etherscan.
The destination (to) can be an ENS name or an address.
-d
directory
The output directory to expand the source tree into.
If not provided, the source will be outputted to stdout.
{{#include ../common/etherscan-options.md}}
{{#include common-options.md}}
-
Get the source code of the WETH contract:
cast etherscan-source 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-
Expand the source code of the WETH contract into a directory named
weth
cast etherscan-source -d weth 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2