# Problem on contract verification

**URL:** <https://talk.harmony.one/t/problem-on-contract-verification/7621>\
**Category:** Wallet\
**Created:** [December 11, 2021, 11:07pm UTC](https://talk.harmony.one/t/problem-on-contract-verification/7621 "2021-12-11T23:07:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Henrique\_Buful](https://yyz1.discourse-cdn.com/flex035/user_avatar/talk.harmony.one/pedro_henrique_buful/32/3712_2.png) [@Pedro\_Henrique\_Buful](https://talk.harmony.one/u/Pedro_Henrique_Buful)\
**Post date:** [December 11, 2021, 11:07pm UTC](https://talk.harmony.one/t/problem-on-contract-verification/7621/1 "2021-12-11T23:07:15Z")

</div>

When trying to verify my contract, I encounter this problem:  
ENOENT: no such file or directory, open ‘/app/dist/services/codeverification/0x598228643d6faa1b5569c3d996cb8cf8ca1fdb92/build/contracts/equals9.json’

There is nothing in the docs about it. Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![MaxMustermann2](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@MaxMustermann2](https://talk.harmony.one/u/MaxMustermann2)\
**Post date:** [December 14, 2021, 11:56pm UTC](https://talk.harmony.one/t/problem-on-contract-verification/7621/2 "2021-12-14T23:56:56Z")

</div>

(1) Make sure the Contract Name is exactly the contract name. Remove any comments in the code, and if you used an optimizer, change it to yes. Mostly the default is Yes and 200.  
(2) Flatten the code (this will replace the library used by the bytecode of the library). For VS code you can use this: [Solidity Contract Flattener - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-solidity-flattener)  
(3) Remove comments and blank lines using [https://solidity-comment-cleaner.netlify.app/](https://solidity-comment-cleaner.netlify.app/)

---

<div class="post-metadata">

**Author:** ![Pedro\_Henrique\_Buful](https://yyz1.discourse-cdn.com/flex035/user_avatar/talk.harmony.one/pedro_henrique_buful/32/3712_2.png) [@Pedro\_Henrique\_Buful](https://talk.harmony.one/u/Pedro_Henrique_Buful)\
**Post date:** [June 11, 2022, 6:48pm UTC](https://talk.harmony.one/t/problem-on-contract-verification/7621/3 "2022-06-11T18:48:21Z")

</div>

That did the trick, thanks. Recently, I’ve had to verify contracts again. If anyone is wondering, the steps that did work for me were:  
1- Flatten the contract with `npx hardhat flatten`.

2- Remove Solidity comments with: [https://solidity-comment-cleaner.netlify.app/](https://solidity-comment-cleaner.netlify.app/)

3- Remove all `pragma solidity <version>` from the contract except the one on top.

4- Use the exact same compiler version used to build the contract.
