Deploying to Basechain

First Steps with the Developer Dashboard

This page shows you how to deploy your first smart contract to Basechain. Note that you only need to do this once you go live, and it costs 1400 zeknd a year to deploy to Basechain.

First, head over to our Developer Dashboard. We offer several different ways in which you can connect and sign transactions:

Select Wallet

Say you choose to use Matamask. Once you've selected this option, you'll see a Metamask popup like this:

Map Accounts

Click "Sign" and, under the hood, the dashboard will map your accounts. Next, you will be redirected to your dashboard. It'll look similar to this:

#Deposit zeknd to Basechain

From the left pane, click on the "Deploy to Basechain". You will be redirected to a page similar to the one below:

Notice that, in order to deploy to Basechain, you need to pay 1400 zeknd. Click on the "Deposit more zeknd to Basechain" and follow the instructions.

#Adding the Public Keys

From here you have two options. You either create a new account, or you use an existing address:

Let's explore both a bit further.

#Option 1 - Creating a New Account

Say you clicked "Generate New Key". Next, a new window will pop showing the details of the new account:

We can't emphasize this more: store the mnemonic somewhere safe.

Next, copy the public address and paste it into the "Your zeknd Public Address" textbox:

Lastly, click "Add Key" and you're set.

#Option 2 - Use an Existing Address

Now, as an example, let's suppose you already have a zeknd address. If so, all you have to do is to paste it into the "Your zeknd Public Address".

Next, click "Add Key" and you're ready to deploy to Basechain.

#Deploying to Basechain

If in the previous step, you chose to use an existing address, save your private key to a file called mainnet_private_key. If you chose to generate a new address, paste your mnemonic into a file called mainnet_mnemonic.

Here's what you have to do next:

  • Fire up your favorite text editor and open truffle-config.js

  • Start by importing a few things:

  • If you're using an existing private key, you can instantiate a new zekndProvider as follows:

  • If you're using a newly generated mnemonic, the code would look a bit different:

Wrapping it up, your truffle-config.js file should look something like this:

Well done!👏🏻👏🏻👏🏻

You are now ready to deploy your first smart contract to Basechain!

In order to get a better feel for it, check out our truffle-dappchain-example.

Last updated