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.
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 here
Etherscan (for verifying smart contracts on Sepolia network) - Find the API key here
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/
Funds - make sure you have a SepoliaETH and Oasis TEST token (Oasis Sapphire testnet) balance, by claiming them from faucets here.
Sepolia token ≈ 0.1 SepoliaETH
Oasis Sapphire testnet token ≈ 0.6 TEST
[Bonus] Walkthrough Video
II. Steps for Smart Contracts
For more detailed information on smart contract deployment, please go here.
1. Set up Remix
Go to the Remix website here.
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

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)

22. Verify your smart contract

Etherscan verification (no.6) from the image above will require the Etherscan API key.
If it is your first time verifying smart contract on Etherscan, visit this page to follow steps for getting API key.
23. Wait and see if the contract gets verified

24. Visit the KRNL Platform and continue to "smart contract registration"
Click here to move to the registration section.
III. Smart Contract Registration
Find the full KRNL guide to smart contract registration here.
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
Read the full KRNL guide to dApp registration here.
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.
You may refer to How Does kOS Work? step 4.

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.
Want to try making transaction while your wallet address is on Prohibited List kernel?
VI. Want to Know More?
Feel free to explore our detailed pages for kernel, smart contract, dApp below.
Last updated
Was this helpful?