Skip to main content

Using Remix

Remix IDE is an open source web and desktop application. It fosters a fast development cycle and has a rich set of plugins with intuitive GUIs. Remix is used for the entire journey of contract development as well as act as a playground for learning and teaching Ethereum.

1, Visit https://remix.ethereum.org/

Writing your smart contract

2, Create a "New File" under contracts with name HelloWorld.sol.

remix_1

3, Copy and paste the code below to HelloWorld.sol file.

// Specifies the version of Solidity, using semantic versioning.

pragma solidity ^0.7.0;

// Defines a contract named `HelloWorld`

contract HelloWorld {

// Declares a state variable `message` of type `string`.

string public message;

// Constructors are used to initialize the contract's data.

constructor(string memory initMessage) {

// Accepts a string argument `initMessage`.

message = initMessage;
}

// A public function that accepts a string argument.

function update(string memory newMessage) public {
message = newMessage;
}
}

Compiling

4, Compile HelloWorld.sol.

remix_2

Deploying

If you want to deploy the contract to a live network like Shardeum Alphanet, configure your MetaMask using this doc.

5, Deploy the compiler contract. Select Injected Web3 for deploying to live network.

remix_3

6, Confirm the deploy transaction in MetaMask.

remix_4

7, Find the deployed contract address in Remix.

remix_5

Interacting

8, Update the contract by interacting with the contract.

remix_6

9, Confirm the deploy transaction in MetaMask.

remix_7

10, Check the contract has been updated.

remix_8