π₯Forge
Inspect
forge inspect <CONTRACT_NAME> methods
forge inspect <CONTRACT_NAME> storageLayout
forge snapshot
Contract Verification
If automatic contract verification fails during deployment it can be performed manually using forge.
forge verify-contract <CONTRACT_ADDRESS> ./src/<CONTRACT>.sol:<CONTRACT_NAME> --chain-id <CHAIN_ID> --watch --etherscan-api-key <ETHERSCAN_API_KEY>
--watch
leaves the terminal waiting for a status confirmation reply.If constructor arguments are required they can be encoded using
cast
e.g for a constructor requiring a single address:
cast abi-encode "constructor(address)" <ADDRESS_TO_PASS_INTO_CONSTRUCTOR>
Then use that
cast
output to add--constructor-args
to the end of theforge verify-contract
command.
Last updated