Shardeum Documentation
Smart ContractsDeploy

Remix IDE

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

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

remix_1

  1. Copy and paste the code below to HelloWorld.sol file.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17; // Specifies the version of Solidity, using semantic versioning.
 
contract HelloWorld { // Defines a contract named `HelloWorld`
 
   string public message; // Declares a state variable `message` of type `string`.
 
   constructor(string memory initMessage) {    // Constructors are used to initialize the contract's data.
      message = initMessage;      // Accepts a string argument `initMessage`.
   }
 
   function update(string memory newMessage) public { // A public function that accepts a string argument.
      message = newMessage;
   }
 
}

Compiling

  1. Compile HelloWorld.sol.

remix_2

Deploying to Shardeum

  1. Select Injected Web3 for deploying to Shardeum.
Injected Web3

If Injected Web3 cannot detect the network, refresh the Remix IDE page, and then switch between networks in MetaMask.

remix_3

  1. Deploy the compiler contract.

remix_4

  1. Confirm the deploy transaction in MetaMask.

remix_5

  1. Find the deployed contract address in Remix.

remix_6

Interacting

  1. Update the contract by interacting with the contract.

remix_7

  1. Confirm the deploy transaction in MetaMask.

remix_8

  1. Check the contract has been updated.

remix_9

On this page