Use IOCTL to Deploy A Smart Contract

Raullen Chai
2 min readMay 27, 2020

Prerequisites

  1. install the latest ioctl
➜ ioctl update -t unstable
Downloading the latest unstable version …
ioctl is up-to-date now.

2. Download solidity from https://github.com/ethereum/solidity/releases/tag/v0.5.16, unzip it and install using “./scripts/install_deps.sh” and “./scripts/build.sh”.

3. Make sure you have an account with few IOTX as a gas fee

➜ioctl account balance io1cqlfvzqvlp60avs5e9s9d7ghgsg9j66dzeyep8
io1cqlfvzqvlp60avs5e9s9d7ghgsg9j66dzeyep8: 10 IOTX

4. You are ready to go!

➜ ioctl contract prepare
Solidity compiler is ready now.

Cool Stuff Started

  1. Make a HelloWorld.sol to start with
pragma solidity ^0.5.0;contract HelloWorld {string defaultName;
mapping (address => string) public accounts;
constructor() public{
defaultName = ‘World’;
}
function getMessage() public view returns(string memory){
string memory name = bytes(accounts[msg.sender]).length > 0 ? accounts[msg.sender] : defaultName;
return concat(“Hello “ , name);
}
function setName(string memory

--

--