LogoLogo
  • Welcome
  • XRPL Basics
    • Getting Started
    • Payments
    • Reading and subscribing to Transactions
    • Writing and reading memos
    • Non Fungible Tokens
    • PathFinding
    • Escrow
    • Price Oracles
    • Tickets
    • Multi-Signature
  • Token Issuance and Liquidity
    • Creating Accounts
    • Issuing Tokens
    • Creating an AMM Pool
  • Cyphered Chat on XRPL
    • Set up
    • Set up Keys
    • Cypher the message
    • Set up the memo & send the tx
    • Get the message and decypher it
  • EVM Sidechain
    • Connecting Metamask
    • Bridging Assets
    • Remix
    • Banking App
    • Banking Contract Key Concepts
  • Tools
    • Xaman Setup
    • Metamask Setup
Powered by GitBook
On this page
  • Deploying your first smart contract
  • Creating other contracts
Export as PDF
  1. EVM Sidechain

Remix

How to compile, deploy and interact with a solidity smart contract on chain

PreviousBridging AssetsNextBanking App

Last updated 8 months ago

Remix is an open-source, web-based integrated development environment (IDE) for writing, compiling, deploying, and debugging Solidity smart contracts on the Ethereum blockchain. It provides a user-friendly interface with tools for testing, debugging, and interacting with smart contracts directly from the browser.

Open Remix at

Deploying your first smart contract

By default you can find the HelloWorld.sol contract in the file explorer under contracts.

Compile it using the third tab.

You can deploy it using the fourth tab. You will need to select the injected provider environment and make sure your metamask is connected to the right network and account.

Deploy the contract, it should open a window for signature (notice the fees in XRP).

Once deployed successfully you can interact with it by scrolling down tab 4.

Creating other contracts

Create the following contract in remix, give it the name counter.sol

counter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Counter {
    uint256 private counter;

    constructor() {
        counter = 0;  // Initialize counter to 0
    }

    function incrementAndGet() public returns (uint256) {
        counter += 1;  // Increment the counter
        return counter;  // Return the updated counter value
    }

    function getCounter() public view returns (uint256) {
        return counter;  // Return the current counter value
    }
}

Compile the new contract using the third tab.

Deploy the contract using the fourth tab.

You can now interact with the counter smart contract:

  • send a transaction to increment it, this will trigger a transaction to sign in Metamask

  • read the current value (notice how this is free)

To go further you can explore the behind the simple banking contract we deploy in the banking app.

https://remix.etherium.org
key concepts