Publish Contract Source Code

Publish your contract details on Ontology Explorer

Once your contract is deployed, people can search for your contract in the Ontology Explorer and view related on-chain data on a dedicated page.

You can publish the source code along with more details about your contract on this page to unveil how things work under the hood. Contracts with extra details are listed on the "View Contracts" page to encourage community members to use and improve these contracts.

To publish more details, click on "Contracts" - "Submit Contract" in the Explorer and specify below details:

Virtual Machine

Select the virtual machine (EVM, NeoVM or WASM) that executes your contract.

You are supposed to provide all the following information if you submit an EVM contract, and less is required for the other two types.

Contract Address

Fill in your contract address.

Contract Description (optional)

Introduce your contract with one sentence.

Compiler Type & Compiler Version

Choose the compiler information from the menu. Currently Solidity (single file) and Solidity (multi-part files) supported.

Optimization

Select the option used when compiling the contract.

Constructor Arguments ABI-encoded (Hex String, Optional)

Fill in this field if your contract is created with constructor parameters. You need to provide constructor arguments in ABI hex encoded form so we can compare if what you provided is consistent with the existing bytecodes.

The constructor arguments are appended to the end of the contract source bytecode when the contract is compiled by Solidity. You can find them by comparing the compiled code and the input creation bytecode.

You can also figure out the constructor arguments by using this online tool.

Step 1: Fill in parameters and deploy your contract.

Step 2: Fill in the parameters in the online tool, you will get a hex string that represents the contractor arguments.

Contract Library Address (Optional, up to 10)

Enter names and contract addresses of the libraries used.

Runs (Optimizer)

Fill in this field if you choose "Yes" for "Optimization". The value represents how many times the code is likely to be run, and it will be optimized accordingly. Leave the value as "200" if you are unsure.

EVM Version

Select which version of EVM to compile your code for.

License Type Settings

Select a license type for your source code:

Contract Source Code

Select and upload Solidity (*.sol) files of the source code.

Submit Information

After filled and checked everything, click on the arrow button to submit the content. The Ontology team will review the content and publish it.

Last updated