Blog

How to create and deploy Smart Contract on Callisto Network

How to create and deploy Smart Contract on Callisto Network

This time I will write about smart contract deployment in Callisto Network. Callisto Network has similarities with ETH and ETC in terms of deploying smart contract. Callisto Network EVM is Compatible with ETH and ETH EVM, so theoretically we can use ETH Compiler to compile smart contract.

In this article, we will Deploy simple smart contract that will display the message: “Welcome to Callisto Network”.

Now what we need to make a smart contract? Here the list:

  1. Browser (chrome, firefox, Brave, it’s Up to you)
  2. Compiler (we will use remix.ethereumcommonwealth.io or remix.ethereum.org as IDE)
  3. ClassicEtherWallet to Deploy our smart contract
  4. A tiny bit of CLO, because we deploy in Mainnet.

Compiling Solidity with Remix

Now open the browser and go to remix.ethereumcommonwealth.io or remix.ethereum.org.

First view of remix.ethereumcoomonwealth.io
First view of remix.ethereumcoomonwealth.io

Copy all  this code :

 

pragma solidity ^0.4.22;
contract welcome {
 function renderWelcome () public pure returns (string) {
   return 'Welcome to Callisto Network';
 }
} 

 

Then Replace code in the browser/ballot.txt to the code above.

 

Replaced code
Replaced code

Go to the right pane, Click Select new compiler version and Use the appropriate compiler. My choose is 0.4.22+commit.4cb486ee

Choose  0.4.22+commit.4cb486ee
Choose  0.4.22+commit.4cb486ee

Click Start to Compile. Done, Congratulations, you have finally Compile your first smart contract.

 

Deploying smart contract with ClassicEtherWallet

Next is deploying smart contract into Callisto Network Blockchain.

Open new tab and point to ClassicEtherWallet  in browser. Change the network in top right pane to Callisto Network.

Then Click Contracts Tab and Deploy Contract. Below, login to your wallet that have CLO. I use keystore File (UTC/ JSON) for this Tutorial.

Deploy Contract main Window
Deploy Contract main Window

Back to remix.ethereumcommonwealth.io or remix.ethereum.org and click Bytecode.

Click bytecode to copy
Click bytecode to copy

The bytecode Result is like the code below.

{
 "linkReferences": {},
 "object": "608060405234801561001057600080fd5b5061012a806100206000396000f300608060
405260043610603e5763ffffffff7c0100000000000000000000000000000000000000000000000000
000000600035041663d542cc0b81146043575b600080fd5b348015604e57600080fd5b50605560c756
5b6040805160208082528351818301528351919283929083019185019080838360005b83811015608d
5781810151838201526020016077565b50505050905090810190601f16801560b95780820380516001
836020036101000a031916815260200191505b509250505060405180910390f35b6040805180820190
9152601b81527f57656c636f6d6520746f2043616c6c6973746f204e6574776f726b00000000006020
820152905600a165627a7a723058204d795cacf11c34cb4762c23fa00844d0d762013326c1a200c471
473e610761e70029",
 "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI 
PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x12A DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY 
PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH1 
0x3E JUMPI PUSH4 0xFFFFFFFF PUSH29 0x1000000000000000000000000000000000000000000000
00000000000 PUSH1 0x0 CALLDATALOAD DIV AND PUSH4 0xD542CC0B DUP2 EQ PUSH1 0x43 JUMPI 
JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH1 0x4E JUMPI PUSH1 
0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x55 PUSH1 0xC7 JUMP JUMPDEST PUSH1 0x40 DUP1 
MLOAD PUSH1 0x20 DUP1 DUP3 MSTORE DUP4 MLOAD DUP2 DUP4 ADD MSTORE DUP4 MLOAD SWAP2 
SWAP3 DUP4 SWAP3 SWAP1 DUP4 ADD SWAP2 DUP6 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST 
DUP4 DUP2 LT ISZERO PUSH1 0x8D JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 
0x20 ADD PUSH1 0x77 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 
PUSH1 0x1F AND DUP1 ISZERO PUSH1 0xB9 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 
DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 
POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN 
JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x1B DUP2 MSTORE 
PUSH32 0x57656C636F6D6520746F2043616C6C6973746F204E6574776F726B0000000000 
PUSH1 0x20 DUP3 ADD MSTORE SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 
KECCAK256 0x4d PUSH26 0x5CACF11C34CB4762C23FA00844D0D762013326C1A200C471473E 
PUSH2 0x761 0xe7 STOP 0x29 ",                                        
 "sourceMap": "25:122:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:122:0;;;;;;;"
}

The code needed to deploy our smart contract in ClassicEtherWallet just binary in an object. Copy this and Paste in Bytecode in ClassicEtherWallet and Click Estimate gasLimit to calculate Gas Limit.

Pasted bytecode Hex and Calculated gas limit.
Posted bytecode Hex and Calculated gas limit.

The next step is Sign Transaction and Deploy Contract. Then pop up below will appear. If you sure nothing wrong : Just Click Yes, I am Sure! Make Transaction.

If the transaction goes as planned, pop up will appear in the bottom. There we have a smart contract address. 0xb832d17be8fe1676c8df4581f14d80930821ae97

Interact with Smart Contract

Access ClassicEtherWallet and go to tab Contract. Fill contract address with new smart contract address that created earlier and fill ABI /JSON Interface with ABI from remix.ethereumcommonwealth.io or remix.ethereum.org. Click Access.

Then choose RenderWelcome.

Welcome Message from smart contract
Welcome Message from smart contract

 

Congratulations, you have successfully Compile and Deploy simple smart contract on Callisto Network Chain.

Whats Next? You can deploy various smart contract like Voting, ICO, dApps and many others. Cheers.

Topics:Learning