![]() |
VOOZH | about |
Smart contracts are self-executing contracts. The term was coined by Nick in 1994. Smart contracts are very different from traditional software programs. They are immutable once deployed on the blockchain. It was because of Ethereum the term smart contract became so popular and used in the Ethereum blockchain. Solidity is the main programming language for writing smart contracts for the Ethereum blockchain. It is a contract-oriented language, which means that smart contracts are responsible for storing all of the programming logic that transacts with the blockchain. The term smart in smart contracts is as the contract gets executed depending upon some logical condition and all nodes in blockchain have the same copy of that smart contract. What is Remix-IDE? The Remix is an Integrated Development Environment(IDE) for developing smart contracts in Solidity programming language. The IDE can be used to write, compile, and debug the Solidity code. It was written in JavaScript and supports testing, debugging and deploying smart contracts, and much more. Remix-IDE can be accessed in many different ways:
This article is all about writing your first smart contract in solidity using remix-ide which is a browser-based IDE. So let's get started with our first simple "Hello World" program.
// My First Smart Contract
pragma solidity >=0.5.0 <0.7.0;
contract HelloWorld {
function get()public pure returns (string memory){
return 'Hello Contracts';
}
}In this approach we will see how we can use get() and set() methods to get the string from the user and print it.
To run it, follow the steps till step 11 of last approach. Then follow the below steps.
2. Now beside the set method we can see a blank box appears which asks for a string value. Here we will type whatever we will like to print / show. Then click on set. In the terminal user can see another transaction happened. Then click on get, and the string we passed will be visible below.