Setup and Build Your First Web 3.0 Smart Contract With Nahmii, Remix, Solidity, and Metamask
To enhance your expertise in Web 3.0, the best way is to utilize it by developing coding projects. However, crafting them alone and integrating various libraries may pose a challenge. Hence, we will be constructing a fundamental blockchain utilizing Nahmii, Remix, Solidity, and Metamask in this post, which can serve as a template for future undertakings.
Setting up Remix
Remix is an open-source integrated development environment (IDE) that is primarily used for developing and testing smart contracts on the Ethereum blockchain. It offers a web-based code editor, compiler, debugger, and other tools that make it easier for both beginners and experts to write and deploy smart contracts. Remix also offers a user-friendly interface that streamlines the development process and supports a wide range of plugins.
WTF Nahmii (NII)?
Nahmii is a Layer-2 scaling solution for Ethereum that aims to provide fast and cheap transactions while maintaining the security and decentralization of the Ethereum network. It is built on top of the Ethereum blockchain and uses state channels to enable off-chain transactions between users.
How To Add NII network to Metamask Nahmii
First of all, you’ll need to open the MetaMask extension:
Click on the networks dropdown menu
Scroll down all the networks
And click on “add network”:
Scroll down and click Add a network manually
In the form input, insert the following settings:
Network Name: Nahmii Testnet
New RPC URL: https://ngeth.testnet.n3.nahmii.io/
ChainID: 4062
Symbol: ETH
Block Explorer URL: https://explorer.testnet.n3.nahmii.io/
Let's save it...
Smart contracts
We will be writing our smart contract on Remix using the Solidity language (WorkDiary.sol)
You can try it
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
contract WorkDiary {
string work;
// create a function that writes a work to the smart contract
function setWork(string memory _work) public {
work = _work;
}
// create a function that reads the work from the smart contract
function getWork() public view returns (string memory) {
return work;
}
}
You will deploy smart contract to Nahmii Testnet Network so we will change environment from Remix VM to Injected Provider (Metamask)
Verify that Remix is connected to the Nahmii Testnet.
In order to perform smart contract upload on the Nahmii Testnet network, you must have the cost of uploading nodes on the network.
Get some from Nahmii Network here
Congratulations, you made it 🥳
You can start interacting with your smart contract
And that is it. You can write your contracts like we just did.
Conclusion
That is it for this article. I hope you found this article useful, if you need any help please let me know in the comment section.
Let's connect on Twitter and LinkedIn.
👋 Thanks for reading, See you next time