After deploying your contract to the Vector Smart Chain mainnet, the next step is to verify it on the official VSC Block Explorer. Verification allows anyone to view, read, and interact with your contract’s source code directly through the explorer interface, increasing transparency and trust.
Navigate to the Explorer
Locate Your Contract
Start Verification
default, unless you specified one.Submit Source Code
Paste or upload your contract’s Solidity code.
If using Hardhat or Foundry, you can generate flattened code for easier submission:
# Hardhat flatten
npx hardhat flatten > FlattenedContract.sol
# Foundry flatten
forge flatten src/MyContract.sol > FlattenedContract.sol
Confirm Verification
For larger projects, you can automate contract verification using Hardhat or Foundry plugins with the explorer’s API. This saves time when deploying multiple contracts.
Hardhat Plugin (example config):
require("@nomicfoundation/hardhat-verify");
module.exports = {
solidity: "0.8.20",
networks: {
vsc: {
url: "<https://rpc.vscblockchain.org>",
accounts: [process.env.PRIVATE_KEY],
chainId: 420042,
},
},
etherscan: {
apiKey: {
vsc: "YOUR_VSC_EXPLORER_API_KEY" // if supported
}
}
};
Foundry Verification Command (if supported):
forge verify-contract <DEPLOYED_ADDRESS> \
src/MyContract.sol:MyContract \
--chain-id 420042 \
--etherscan-api-key YOUR_VSC_EXPLORER_API_KEY
Once verified, your contract will be fully transparent, auditable, and interactable through the VSC Explorer — a best practice for any production deployment.