Via explorer
You could directly use U2U Chain blockchain explorer to verify your contract's source code at u2uscan.xyz.
Last updated
You could directly use U2U Chain blockchain explorer to verify your contract's source code at u2uscan.xyz.
Last updated
At the contract details page, select Contract tab. If the contract has not verified, you will see the Verify & publish button as in below example:
Click on Verify & publish button to start verifying your contract source code. There are multiple methods for verification using the blockchain explorer UI - all are cataloged below:
Contract Address: The 0x
address supplied on contract creation.
Contract Name: Name of the class whose constructor was called in the .sol file. For example, in contract MyContract {..
MyContract is the contract name.
Include Nightly Builds: Yes if you want to show nightly builds.
Compiler: derived from the first line in the contract pragma solidity X.X.X
. Use the corresponding compiler version rather than the nightly build.
EVM Version: See evm-version-information.
Optimization enabled: If you enabled optimization during compilation, check yes. 200 is the Solidity Compiler default value. Only change if you changed this value while compiling.
Enter the Solidity Contract Code: You may need to flatten your solidity code if it utilizes a library or inherits dependencies from another contract. We recommend the or the .
Try to fetch constructor arguments automatically: If similar contracts exist these may be available.
ABI-encoded Constructor Arguments: .
Add Contract Libraries: Enter the name and 0x address for any required libraries called in the called in the .sol file.
Click the Verify & publish button.
If all goes well, you will see a checkmark (✅) next to Contract in the code tab, and an additional tab called Read Contract. The contract name will now appear in explorer with any transactions related to your contract.
Contract Name. There are several options:
Leave blank.
Enter contract name: MyContract
.
Enter path to the contract and it's name: path/to/file.sol:MyContract
(path should match what is written in your JSON file).
Include nightly builds. You can select depending on your compiler.
Compiler. Choose the compiler version used to compile your smart contract.
Standard Input JSON. Attach your Standard Input JSON file. File should follows solidity and all the sources must be in Liternal Content format, not an URL.
After filling the form click the Verify & publish button and wait for the response.
Include nightly builds: Yes if you want to show nightly builds.
Compiler: derived from the first line in the contract pragma solidity X.X.X
. Use the corresponding compiler version rather than the nightly build.
EVM Version: See evm-version-information.
Optimization enabled: If you enabled optimization during compilation, check yes. 200 is the Solidity Compiler default value. Only change if you changed this value while compiling.
Sources *.sol or *.yul files: Select your contract files.
Add contract libraries: Enter the name and 0x address for any required libraries called in the called in the .sol file.
If you receive the dreaded There was an error compiling your contract
message this means the bytecode doesn't match the supplied sourcecode. Unfortunately, there are many reasons this may be the case. Here are a few things to try:
1. Double check the compiler version is correct.
Check all version digits - for example 0.5.1 is different from 0.5.10
2) Check that an extra space has not been added to the end of the contract. When pasting in, an extra space may be added. Delete this and attempt to recompile.
3) Copy, paste and verify your source code in Remix. You may find some exceptions here.