James Bachini

Remixd Tutorial | How To Take The Solidity IDE To The Next Level

remixd tutorial

I’ve gone full circle from Remix > Hardhat > Foundry > Remix

I find that I enjoy coding most when I’m experimenting with ideas and proof of concepts within the Remix IDE at https://remix.ethereum.org

However for more serious projects I inevitably find myself moving out of creative mode and into testing mode in either Hardhat or Foundry and then using a text editor.

Remixd is a NodeJS application which runs on your PC and lets you connect Remix to a local filesystem. With its intuitive interface and powerful Solidity focused features, Remix provides a better developer experience than a text editor.

In this blog post, I’ll explore how to use Remixd to get the most out of your Solidity development environment.

  1. Remixd Video Demo
  2. How To Set Up Remixd
  3. Development Workflow
  4. Integrating Slither & Foundry
  5. Useful Plugins
  6. Conclusion

Remixd Video Demo


How To Set Up Remixd

To set up remixd we first need to install nodejs from: https://nodejs.org/

Then open up a console in a new directory by right clicking in the folder and selecting “Open in Terminal” from the menu. Let’s first setup a package.json file and a basic hardhat project.

npm init
npm install -s hardhat

From here I prefer to install remixd locally using:-

npm install -s remixd

We can then fire up the remix daemon using:-

npx remixd ./

“./” is the current directory that we want to share with the remix IDE. Now if we go to https://remix.ethereum.org

We can select localhost from the workspace menu which will connect to our local filesystem.

Remixd Tutorial Solidity Localhost

From here any saved changes will modify the data on your local device. You can use Remix to edit local files, compile and deploy them to EVM blockchains.


Development Workflow

I’ve laid out an overly simplified workflow of working in Remix from start to finish using different tools along the way to assists with testing and deployment.

  1. Use remix online to mess around with ideas
  2. Once it becomes more than “just an experiment” set up a git repository
  3. Set up local packages and get hardhat running
  4. Connect remixd and use that to refactor the code
  5. Write unit tests for functions using Hardhat & Remix
  6. Use Slither to do some automated security checks
  7. Write system tests and fuzzing using Foundry in Remix
  8. Write a deployment script in Hardhat
  9. Roll it out to a testnet or test in production
  10. Verify contracts on Etherscan with the Remix plugin

There we go, ten steps to deploying your own smart contracts. I’ve gone over a similar thing before with timeframes and budgets for web3 projects.


Integrating Slither & Foundry

Slither is a Solidity static analysis framework written in Python. It is designed to help developers find vulnerabilities, enhance their code comprehension and quickly prototype custom analyses.

Slither runs a suite of common vulnerability detectors, prints visual information about contract details, and provides an API to easily write custom analyses.

Foundry is a tool suite for Solidity developers to test, fuzz, deploy and do lots of other on-chain things. There’s a full Foundry tutorial here.

Remixd does have a built in installer but I prefer to use Windows Sub-system for Linux (WSL). If you don’t have this installed google “How To Install WSL”, on a Mac you are probably fine in terminal.

Once in linux navigate to the directory and install solc, slither and foundry:

cd /mnt/c/tmp/myrepo
sudo su
apt install python3-pip
add-apt-repository ppa:ethereum/ethereum
apt update
apt install solc
pip3 install slither-analyzer
curl -L https://foundry.paradigm.xyz | bash
source /root/.bashrc
foundryup

Then we can get the man page for these programs using:

slither
forge
foundry and remix

Useful Plugins

There are a number of useful plugins which we can use on Remix with files hosted by Remixd.

Debugger
A low level debugger where you can step through each stage of a failed transaction and check state variables to see where you messed up

Etherscan Contract Verifier
Add an etherscan API key and it will verify your contracts at the click of a button

One Click Dapp
Creates a really simple frontend for your contract with buttons for each function

GIT
Use the GIT plugin to manage changes to your code repository

Gas Profiler
Execute a transaction using remix and then analyse the broken down gas costs.

There is a bunch more to choose from on the plugin manager tab which can be activated by simply switching them on/off.


Conclusion

Remixd is a simple tool that brings the online IDE to your local work space. It can be used to enable remix as your default editor for Solidity code if you prefer working there to a text editor.

It’s a great innovation that makes a big difference to the capabilities of the tool. For developers remix offers a UI tailored around the needs of a blockchain developer with all the necessary tools and integrations needed in the workflow of creating smart contracts.



Get The Blockchain Sector Newsletter, binge the YouTube channel and connect with me on Twitter

The Blockchain Sector newsletter goes out a few times a month when there is breaking news or interesting developments to discuss. All the content I produce is free, if you’d like to help please share this content on social media.

Thank you.

James Bachini

Disclaimer: Not a financial advisor, not financial advice. The content I create is to document my journey and for educational and entertainment purposes only. It is not under any circumstances investment advice. I am not an investment or trading professional and am learning myself while still making plenty of mistakes along the way. Any code published is experimental and not production ready to be used for financial transactions. Do your own research and do not play with funds you do not want to lose.