Write Your First Smart Contract
First step of being a blockchain developer
Remix is a powerful, open source tool that helps you write Solidity contracts straight from the browser. Remix also supports testing, debugging and deploying of smart contracts and much more. It is recommended to use Remix to create and deploy smart contracts quickly.
In Remix, create a new file with name Quote.sol
by clicking ➕ icon in browser section under FILE EXPLORERS section and start writing the code as mentioned below.
Mention Compiler Version
Make sure the solidity version declared in the contract matches your compiler version
Declare Contract Statement
Add Public Variables
quote
is used to store the current quote in our smart contract
owner
is used to store the owner of the current quote
Setter Function
Updates the current quote and the current owner of the quote. Here msg.sender
is used to extract the user address who signed the transaction.
Getter Function
Returns the current quote and the current owner of the quote.
Complete Code Snippet
This tutorial is deployed on Kovan TestNet at address 0xa67767B5ed6Fa6Fc19baBD4F18ffe72EAbC85FdA
Last updated