Deploy a Contract
Loki.code offers an effortless experience for compiling and deploying your contracts through its user interface. The primary advantage of deploying with Loki.code is the ability to meticulously track your deployment history and access Loki.code's Playground, which provides an interface to interact with your contracts post-deployment.
Prerequisites
Video Demonstration
Step 1: Compile a contract
From the Dashboard, click on "Projects" in the left sidebar, and then select the project that contains the contract you wish to deploy.
You will observe three tabs within the left sidebar; ensure that you are in the "Files" tab. On your screen, you should now see the contents of your linked GitHub repository. If you click on a Solidity file within the file tree, the contents of that file will be displayed on the right. Additionally, you should see a "Compile" button in the top right corner.
![](https://docs.lokicode.app/~gitbook/image?url=https%3A%2F%2F2889406774-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZN3brWXT06yu65o1wdvO%252Fuploads%252FNVaklFWLUZ5GIS2AJKiZ%252FScreenshot%25202024-06-02%2520at%252011.49.51%25E2%2580%25AFPM.png%3Falt%3Dmedia%26token%3D1366a42a-e992-45dd-b56a-fab8d44f4b41&width=768&dpr=4&quality=100&sign=14314b95&sv=1)
Click on the "Compile" button, and a dialog will appear, allowing you to confirm the compilation of the Solidity file. Click "Compile."
![](https://docs.lokicode.app/~gitbook/image?url=https%3A%2F%2F2889406774-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZN3brWXT06yu65o1wdvO%252Fuploads%252FB9lXFQVN1HNQoKFR58ef%252FScreenshot%25202024-06-02%2520at%252011.52.20%25E2%2580%25AFPM.png%3Falt%3Dmedia%26token%3D619d659e-37c4-42cf-8c2b-aee3447708bf&width=768&dpr=4&quality=100&sign=d718470&sv=1)
Now that your Solidity file has been successfully compiled, let us proceed to deploy it. Click on the "Deploy" tab in the left sidebar, and you will see a user interface similar to the example below.
![](https://docs.lokicode.app/~gitbook/image?url=https%3A%2F%2F2889406774-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZN3brWXT06yu65o1wdvO%252Fuploads%252F897T85b5j34k8d7gBICO%252FScreenshot%25202024-06-03%2520at%25207.23.55%25E2%2580%25AFAM.png%3Falt%3Dmedia%26token%3Db0f92879-ab39-405b-ad9e-4af4806270bd&width=768&dpr=4&quality=100&sign=ad1352e&sv=1)
A brief explanation on each tab:
Recent Events: A summary of the instances found in all other tabs.
Workflow Runs: Your GitHub workflow executions.
Compilations: The compilations you have made on Loki.code, from which you can initiate deployments.
Deployments: Your deployment history and details.
Deploy Requests: Incoming requests to deploy contracts, sent by yourself or team members via API call.
Step 2: Deploy the contract
If you have not yet linked your Ethereum wallet to Loki.code, kindly sign into it via the "Connect Wallet" button located at the top right. This step is essential for deploying your contract.
![](https://docs.lokicode.app/~gitbook/image?url=https%3A%2F%2F2889406774-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZN3brWXT06yu65o1wdvO%252Fuploads%252FW48wMtcbb55fHjLE46LL%252FScreenshot%25202024-06-03%2520at%25207.27.57%25E2%2580%25AFAM.png%3Falt%3Dmedia%26token%3D88a2a0ce-3c82-4a86-8291-b2d2a3dd869a&width=768&dpr=4&quality=100&sign=d8a5e06f&sv=1)
To deploy your compiled contract, locate its card within the "Recent Events" tab or the "Compilations" tab.
Select the network to which you wish to deploy, input constructor arguments if applicable, and, if all appears satisfactory, click "Deploy" to proceed with deploying your contract.
Your wallet provider should then present a confirmation dialog to finalize the deployment. Below, you will find an example using Metamask.
![](https://docs.lokicode.app/~gitbook/image?url=https%3A%2F%2F2889406774-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZN3brWXT06yu65o1wdvO%252Fuploads%252FVWYyLlw3wOeYe6HVU7TA%252FScreenshot%25202024-06-03%2520at%25206.50.36%25E2%2580%25AFAM.png%3Falt%3Dmedia%26token%3D8cc0d800-8ddb-49a0-8926-e6522e77e907&width=768&dpr=4&quality=100&sign=1780357f&sv=1)
To view the details of that deployment, click on the "Deployments" tab. Here, you will find a history of all your successful contract deployments. Each instance also features a "Playground" button at the bottom-right, which navigates you to that contract's Playground—a user interface where you can interact with the deployed contract.
![](https://docs.lokicode.app/~gitbook/image?url=https%3A%2F%2F2889406774-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZN3brWXT06yu65o1wdvO%252Fuploads%252FA28AQTF7IAK2DX7pSDnJ%252FScreenshot%25202024-06-03%2520at%25206.54.32%25E2%2580%25AFAM.png%3Falt%3Dmedia%26token%3D14c0a687-92bc-4eb1-a361-eb061bfb142d&width=768&dpr=4&quality=100&sign=14cb41e6&sv=1)
Congratulations on successfully deploying your first contract through Loki.code!
Last updated