Along with contract verification through a flattened source file (the default option in Blockscout), we provide a verification option through the Sourcify API. The Verification with Sourcify premium feature is enabled in the xDai instance of Blockscout.
Verify your contract using Sourcify:
1. Open the address page for the contract you want to verify, switch to Code tab, and click Verify & Publish button.
2. Choose Sources and metadata JSON file option and click the Next button.
On the next screen, you will see a drop field where you will add files.
3. Drag and drop (or click the button to add files from your computer) all .sol files used by the target contract you want to verify and the .json file containing the contract's metadata. For example, this .json is created by Truffle in ./build/contracts folder after
truffle compile. If your contract has linked libraries you should also drag & drop .json files for those libraries. Once all files are added, start verification by clicking the Verify & Publish button.
After several seconds your contract should be verified through Sourcify's API (If verification fails, you will see the reason in the dropzone). Verification metadata will be saved in the Blockscout DB and you will see the verified contract page with the link to the same metadata in the Sourcify contract repository (chain ID is 100 for the xDai chain).
The same contract in the Sourcify contract repository.