Create Smart Contract
There are multiple ways to create a smart contract via the Kriptonio platform.
Using the web interface
The simplest way to create a smart contract is to use our web interface.
Simply go to Smart Contract -> New Smart Contract and choose how you want to create your smart contract.
You can paste your Solidity source code, upload a file, or use one of our configurable smart contract templates.
After saving the smart contract, Kriptonio will automatically compile it, and prepare for you a web interface for deploying, interacting with, and monitoring your smart contract.
Using Hardhat / Truffle plugins
Using SDK
You can also use our SDK to create a smart contract. In order to do that, you will need to obtain and provide a Standard JSON Input object.
Here is an example of creating an empty smart contract using the SDK:
import { ChainId, KriptonioSdk } from '@kriptonio/sdk';
const sdk = new KriptonioSdk({
accessToken: 'your-access-token',
});
const smartContract = await sdk.smartContract.createFromStandardJson({
data: {
title: 'Title of my smart contract',
chainId: ChainId.Polygon,
contractFile: 'Test.sol',
contractName: 'Test',
contractStandardJson: JSON.stringify({
language: 'Solidity',
sources: {
'Test.sol': {
content: 'pragma solidity ^0.8.0; contract Test { }',
},
},
settings: {
optimizer: {
enabled: true,
runs: 200,
},
outputSelection: {
'*': {
'*': ['metadata', 'abi', 'evm.bytecode', 'evm.bytecode.sourceMap'],
},
},
},
}),
},
});