KRNL Platform Guidebook
KRNL Platformkrnl.xyz
  • Introduction
    • Introduction
    • How Does kOS Work?
  • Setup
    • Getting Started with KRNL
    • Quick Start (CLI)
    • Quick Start (Online IDE)
      • Quick Start (Remix IDE)
      • Quick Start (Atlas IDE)
    • create-krnl-app
    • Platform Registration
  • Kernel
    • What are Kernels?
    • Kernel Registration
      • Kernel Registration (on-chain)
      • Kernel Registration (off-chain)
    • Supported OpenAPI (Off-chain Kernel)
    • Staking
  • Smart Contract
    • Steps for Smart Contract Developers
    • Choosing Kernel(s)
    • Token Authority
      • What is a Token Authority?
      • How to Build a Token Authority?
      • Generic Token Authority
      • How to Deploy a Token Authority on Oasis?
    • Decoding Kernel Responses in Solidity
    • How to Integrate Your Smart Contract with kOS?
    • Smart Contract Registration
  • DApp
    • dApp Registration
    • KRNL SDK Installation
    • Usage
    • KRNL Node RPC
  • Miscellaneous
    • Overview
    • What is the KRNL Platform?
    • What are You Trying to BUIDL?
    • Smart Contract Fundamentals
      • Why Do I Have to Register a Smart Contract?
      • How to Deploy a Smart Contract?
    • Recommended Kernels List
  • Helpful Resources
    • New to Web3?
    • Dictionary
    • Testnet Faucets
    • How to Get Etherscan API Key?
  • Litepaper
    • Litepaper
      • Overview
      • Problem Statement
      • Current State Does Not Solve the Problem
      • Introducing Kernels
      • Ecosystem of Kernels
      • The KRNL Operating System (kOS)
      • Decentralization and Security Considerations
      • Use Cases for KRNL
  • Appendices
    • FAQ
    • Bounty Program
    • Social Medias
    • Thank You
  • Workshop
    • KRNL Workshop
    • Speed's Workshop
Powered by GitBook
On this page
  • I. Preparations
  • [Bonus] Walkthrough Video
  • II. Steps for Smart Contracts
  • III. Smart Contract Registration
  • IV. Steps for dApp registration and KRNL Sandbox
  • V. What Have You Just Achieved?
  • VI. Want to Know More?

Was this helpful?

  1. Setup
  2. Quick Start (Online IDE)

Quick Start (Remix IDE)

Goal: To complete the integration of kOS into your smart contract and to be able to call transactions within a dApp.

PreviousQuick Start (Online IDE)NextQuick Start (Atlas IDE)

Last updated 8 days ago

Was this helpful?

Read time - 10 minutes

This guide contains the instructions for deploying relevant smart contracts and using the KRNL SDK through KRNL Sandbox.

Choosing a kernel is predefined for simplicity and ease of understanding throughout this easy-to-follow guide.


I. Preparations

MetaMask - download MetaMask into your browser

Etherscan (for verifying smart contracts on Sepolia network) - Find the API key

Sepolia testnet - "Add a custom network" on your MetaMask wallet

Oasis Sapphire testnet - Again, visit "Add a custom network" in your MetaMask wallet. This time, add the network details below (TEST will be used for deploying smart contracts)

Network name:
    Oasis Sapphire Testnet
RPC:
    https://testnet.sapphire.oasis.io
Chain ID:
    23295
Currency symbol:
    TEST
Block explorer URL:
    https://explorer.oasis.io/testnet/sapphire/
  • Sepolia token ≈ 0.1 SepoliaETH

  • Oasis Sapphire testnet token ≈ 0.6 TEST

[Bonus] Walkthrough Video

Because we strive to provide the simplest possible guide for everyone, the content of this page may differ slightly from the video.


II. Steps for Smart Contracts

1. Set up Remix

2. Clone our provided example repository by selecting the burger icon in the top-left and clicking "Clone" (see image below)

3. Copy this URL

https://github.com/KRNL-Labs/krnl-toolkit.git

4. Paste the copied URL into this text field

5. Set up the compiler config

smart-contracts/remix-ide/compiler_config.json

6. Select the Token Authority Solidity file

7. Compile Token Authority

8. Set up MetaMask as your environment in "Deploy & run transactions"

9. Select "Oasis Sapphire Testnet" on MetaMask

10. Deploy Token Authority

11. A successful result will be shown in the terminal

Note down the "contract address" that is shown in the terminal. This is your "Token Authority smart contract address".

12. Install plugin from Remix

13. Verify Token Authority

14. Wait to see if the contract gets verified

15. After verification, visit ABI Playground

https://abi-playground.oasis.io/?network=23295&contractAddress=<CONTRACT_ADDRESS>

16. Copy and save the Token Authority public key

17. Select Sample.sol Solidity file

18. Compile Sample.sol

19. Change network on MetaMask to Sepolia

20. Deploy Sample.sol

21. A successful result will be shown in the terminal (as below)

Note the "contract address" that is shown in the terminal. This is your primary "smart contract address".

22. Verify your smart contract

Etherscan verification (no.6) from the image above will require the Etherscan API key.

23. Wait and see if the contract gets verified

24. Visit the KRNL Platform and continue to "smart contract registration"


III. Smart Contract Registration

1. Visit the smart contract registration page

2. Click "Register"

3. Fill the required values and click "Activate"

4. Wait until the transaction has finished

5. Visit your registered smart contract page and save your registered "Smart Contract ID"


IV. Steps for dApp registration and KRNL Sandbox

1. Visit the dApp registration page

2. Click "Register"

3. Fill in the Smart Contract ID

4. Wait until the transaction has finished

5. Go to your registered dApp page and copy both "Entry ID" and "Access Token"

6. Go to the KRNL Sandbox on the KRNL Flow tab

7. Connect your wallet and select the template "10-Minute Tutorial"

8. Fill in the required values from "smart contract deployment" and the KRNL platform

9. Click "Execute Kernels"

10. Fill the required parameter in "Step 3: Submit Your Transaction"

The parameter(s) has to be the same as in "Step 2: Fill Your Parameters".

If you are trying to fill different values on "Step 3: Submit Your Transaction", it means that you are trying to tamper with the transaction after already obtaining the response(s) from kernel(s).

11. Click "Submit Transaction" and wait for it to complete. You can also check your wallet

(optional) You can also check on Etherscan to see if the transaction has been successful


V. What Have You Just Achieved?

Congratulations!

You have successfully deployed your smart contract, which inherits KRNL, to Sepolia testnet.

You have deployed Token Authority, which protects your contract.

You have also made a transaction to your smart contract.

The choice of predefined kernel is Prohibited List kernel (kernel ID: 337).

It acts as another layer of protection to your smart contract by filtering prohibited wallet addresses.

This kernel will give the response based on your wallet address.

If your wallet address is on this Prohibited List kernel, your smart contract will not allow the transaction.


VI. Want to Know More?

Feel free to explore our detailed pages for kernel, smart contract, dApp below.

Funds - make sure you have a SepoliaETH and Oasis TEST token (Oasis Sapphire testnet) balance, by claiming them from .

For more detailed information on smart contract deployment, please go .

Go to the Remix website .

If it is your first time verifying smart contract on Etherscan, visit to follow steps for getting API key.

Find the full KRNL guide to smart contract registration .

Read the full KRNL guide to dApp registration .

You may refer to step 4.

faucets here
here
here
this page
here
here
How Does kOS Work?
Want to try making transaction while your wallet address is on Prohibited List kernel?
Click here to move to the registration section.
here
here
LogoKRNL Sandbox
Cover

Register Your Smart Contract

Cover

Register Your dApp

Cover

Kernel

Cover

Smart Contract

Cover

dApp

Cover

Not sure?

Click here to go to

What are You Trying to BUIDL? page