Cosmostation Launches EVM Smart Contract Verification Function On Kavascan

In this article we dive into smart contract source code verification: What it is, what it isn’t, why it’s important, and how to verify smart contracts on Kavascan

Matthew Ambrose
Cosmostation
5 min readMay 9, 2024

--

Smart contracts… the trustless digital contracts stored on a blockchain that are automatically executed when predetermined terms and conditions are met.

While they are the basis upon which many blockchain projects have been founded and run… not all smart contracts are created equal and some have even been made with malicious intent.

This, of course, poses a risk to unaware users and has the potential to lead to sizable losses.

Enter smart contract source code verification…

This feature enhances (but does not guarantee) safety, as it enables users to verify that the source code of the smart contract matches the smart contract deployed onchain before making any interactions that exchange value.

What does this mean?

Imagine you are a smart contract developer…
When you verify your smart contract, it means that you are giving users and other developers the ability to review and evaluate your code.

This means that they can see if the source code from the verification service matches the code deployed on the blockchain.

Note: This is not the same as a Smart Contract audit.

A smart contract’s verification status has no effect on whether it is good, bad, safe, or malicious. It only means that the smart contract’s source code is available for anyone to inspect at any time.

So why is this function important?

One of the main tenets of smart contracts is trustlessness.
In a nutshell this means that the smart contract users shouldn’t have to trust third parties (e.g., developers and companies) that the smart contract deployed on a blockchain is indeed safe before they interact with it.

In order for trustlessness to be established a smart contract’s code should be available for independent verification.

Still, it can be complicated for both developers and users to understand as the open source smart contract code is normally deployed in compiled bytecode (low-level compact numeric codes). This is done because the EVM cannot interpret high-level instructions and uses the bytecode to execute actions.

So in order to address the issue… projects will sometimes publish the normally written source code of their contracts.

Compiled Bytcode
Contract Source Code

Despite this open publication, it’s still difficult to confirm that the compiled bytcode and source code match, which strips away the trustless component of the smart contract as we need to trust that developers have not inserted a malicious component into the bytecode.

And here is where smart contract source code verification comes in to play. It provides tools that guarantees that a smart contract’s source code files match the compiled bytecode, resulting in a trustless ecosystem as interested parties can see if what they are able to read in the normal source code is indeed what is written in the bytecode.

Such verification can also have a positive impact on user safety. Without it, bad actors (developers) could build in backdoors that give access to control mechanisms or allows for the exploitation of vulnerabilities, much of which could go undetected.

By publishing a smart contract’s source code… interested parties can assess the smart contract for potential attack vectors, and the more people look into this the stronger the guarantee of user safety is.

It should be noted, however, that smart contract source code verification does not mean that the smart contract is not without risk.

How to verify a smart contract on Kavascan

Step 1:

Go to Kavascan and find the smart contract you want to verify.
In this instance we will look at Wrapped Kava (WKAVA)

Step 2:

Looking at the page… you can see the source code contract still needs to be verified against its compiled bytecode.

To do this you can import the source code from a contract, via GitHub, or by uploading a JSON file.

Step 3:

Here we will use a JSON file.

Step 4:

We then upload and publish…

Step 5:

And that’s it. If the contract codes match up you will see a verification notice on the page.

Note: Developers can also use Cosmostation’s contract verification API to verify contracts.

What is Cøsmostation?

Cøsmostation is a proud genesis validator for Kava and a key player in the Cøsmos ecosystem and a validator for Ethereum. We pride ourselves in providing invaluable infrastructure legos essential for scaling and onboarding users onto blockchain networks.

Mintscan

In addition to building EVM blockchain explorers, Cøsmostation also offers Mintscan, one of the most widely used explorers that comes complete with an interactive interface and integrated wallet function. These capabilities provide insightful interactions with chain data across various networks and also feature user-centric designs, with transparency placed at the core.

--

--