Developers
Tutorials

Verify a Contract on Caduceus

5min

Caduceus contracts may be verified through multiple methods.

To verify, you must first ensure that

  • Your contract compiles correctly in Remix, Truffle or Hardhat.
  • You have the version of the compiler specified in the smart contract's pragma directive, and you have chosen a license type.
  • And that you have the Solidity compiler version matching your Solidity Pragma directive:
Text


Verify on Caduceus Galaxy Scan

Navigate to your contract's unique URL on Caduceus Galaxy Scan Test Net. https://galaxy.scan.caduceus.foundation

Click on the Contract tab, and then click on Verify and Publish.



Caduceus Explorer
Caduceus Explorer




You need to flatten your files on the Caduceus IDE before you can attempt to verify them via Caduceus Galaxy.

A file flattener plugin converts all imports or dependencies into one large flat file that's well organized with relevant successive includes of interfaces and dependent contracts.



Example of flattener on Remix

Document image


Once your files are flattened, you need to paste your files into Caduceus Scan.

If your verification is successful a message will appear like so:

Document image


Manually flattening a file before verification

In case a you are unable to flatten your Solidity files through a plugin, you should be able to do it manually. This technique is especially useful if you are using the Caduceus IDE.

Start by simply opening the first dependency as signified by the import directive. Open the file separately, then copy it all into a new document.



Import Directives can be opened one by one
Import Directives can be opened one by one


Go to the next file in the dependency order, and copy it immediately below.

Make sure that you keep the files in order of dependency. This may be a bit tricky at first, but you can keep it simple if you keep in mind that anything that depends on a previous file should come below it.

In the end, you will result in a chain of dependent contracts, one after the other. You can then simply choose the contract name you wish to compile, and it will compile correctly.

How to Verify a flat file

When verifying, be sure to paste the entire code with all dependencies.

Verify on Remix

Caduceus will introduce Remix plugins for verification soon.

API based Verification

API based verification will be introduced in the near future.