Skip to main content

5ire EVM Chain

5ire IDE

Note: In order to start using the 5ire IDE, users must set up and configure their wallet. Head to this section to start setting up your 5ire wallet.

Step 1: Head to the 5ire IDE Platform.

Step 2: Go to Workspace from the left-panel menu and choose the Create New File icon.

5ire IDE Workspace

Step 3: Create a new file under contracts folder with the name “5ire.sol”

5ire IDE Contract

  • A new file will be generated, and the main panel will appear blank.

Note: .sol is the extension of Solidity files.

Step 4: Writing the code

  • You can either paste your existing code in the main panel of the 5ire.sol file or upload your contract file in the Workspace.

  • You could also use the below sample ERC-20 code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;


// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.0/contracts/token/ERC20/IERC20.sol
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);


function allowance(address owner, address spender) external view returns (uint);


function approve(address spender, uint amount) external returns (bool);


function transferFrom(
address sender,
address recipient,
uint amount
) external returns (bool);


event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}


contract ERC20 is IERC20 {
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
string public name = "Solidity by Example";
string public symbol = "SOLBYEX";
uint8 public decimals = 18;




function transfer(address recipient, uint amount) external returns (bool) {
balanceOf[msg.sender] -= amount;
balanceOf[recipient] += amount;
emit Transfer(msg.sender, recipient, amount);
return true;
}




function approve(address spender, uint amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}




function transferFrom(
address sender,
address recipient,
uint amount
) external returns (bool) {
allowance[sender][msg.sender] -= amount;
balanceOf[sender] -= amount;
balanceOf[recipient] += amount;
emit Transfer(sender, recipient, amount);
return true;
}




function mint(uint amount) external {
balanceOf[msg.sender] += amount;
totalSupply += amount;
emit Transfer(address(0), msg.sender, amount);
}




function burn(uint amount) external {
balanceOf[msg.sender] -= amount;
totalSupply -= amount;
emit Transfer(msg.sender, address(0), amount);
}
}

This is how your screen will appear after pasting the code mentioned above:

5ire IDE sol

Step 5: Compilation

  • Go to the Solidity Compiler from the left-panel.

  • To compile a contract, either select the desired file from the File Explorer, or ensure that the desired file is the active one in the Editor if multiple files are open.

  • If there is an active file chosen in the file explorer, then the solidity compiler will look like this:

5ire IDE Solidity Config

  • Click on Compile 5ire.sol to compile the contract file.

  • After successful compilation, this is what your screen will look like:

5ire IDE Solidity Compiler

Step 6: Deployment

  • Go to the Deploy & Run Transactions sidebar from the left-panel.

  • In order to use this module, it is necessary to have a compiled contract. Hence, if there is a contract name in the CONTRACT select box (the select box is under the VALUE input field), you can use this module.

    • 5ire Provider: For connecting 5ire IDE to an injected web3 provider. The most common injected provider is MetaMask and 5ire Wallet extension.
    • Hardhat Provider: For connecting 5ire IDE to a local Hardhat test chain.
    • Ganache Provider: For connecting 5ire IDE to a local Truffle Ganache test chain.

5ire IDE Deploy And Run

  • Click on Deploy.
  • Confirm the transaction on Web3 extension.

Video Tutorial:

  • Once the transaction is confirmed, the deployment details, contract address and transaction, will be visible in the terminal:

5ire IDE Code Output

Using Explorer

Step 1: Cloning the 5ireChain node

  • On your system, open a terminal shell.
  • Clone the firechain-evm-base node repository by running the following command:

HTTPS:

https://github.com/5ire-tech/5ire-evm-base.git

SSH:

[email protected]:5ire-tech/5ire-evm-base.git

Step 2: Connecting to the node

  • If needed, open up a terminal shell on your local system.
  • Change the root directory where you compiled the 5ire EVM base.
  • Start the node in development mode by running the following command:
Cargo build –release

./target/release/firechain-node --dev (it will run the node in development mode.)

Note: Cargo build compiles the code.

The --dev command-line option indicates that the node is operating using a predefined development chain specification, which includes a designated EVM account for Alice, along with other accounts specifically set up for testing purposes.

  • You can verify if your node is up and running successfully after reviewing the output displayed in the terminal.

The terminal should display an output similar to this:

Proof of 5ire

Proof of 5ire

  • Use the Polkadot-JS application to connect to the local node.

  • In the top bar, click on the developer dropdown menu.

  • Create the token contract.

    Note: For convenience, you can use the compiled bytecode from the token contract in MyToken.json to deploy the contract on the 5ire EVM Chain.

  • Select Extrinsics.

  • For submitting the transaction, select a funded account development account as the account.

  • Select EVM (Ethereum Virtual Machine).

  • Choose the create function.

  • Configure the parameters for the function.

For thisSpecify this
Source0xd43593c715fdd31c61141abd04a99fd6822c8558 (H160 Address of your Selected Account)
InitEnter the token raw bytecode
Value0
Gas Limit42949672
Max Fee Per Gas1000000
  • The optional parameters can be left empty. The nonce value will increase the known nonce for the purpose of the source account. This starts from 0x0. Depending primarily on the selected function, you will have to remove unused parameters.

  • Press submit transaction. This will start the process of completing your transaction.

  • To authorize the transaction, click Submit and Sign. This will result in completion of the transaction.

Proof of 5ire

Remix IDE

You can deploy a smart contract on the 5ire EVM chain using Remix IDE through the following steps:

Step 1: For initiating the transaction, visit this link.

Step 2: Under workspaces, click on Create New File. This will help you create a new document on which you can start working on deploying a smart contract on the 5ire EVM chain.

Proof of 5ire

Step 3: Create a New File under contracts with the name 5ire.sol. This will help you to create a new program through which you can deploy a smart contract on 5ire.

Proof of 5ire

Step 4: Copy and paste the code given below to the 5ire.sol file.

We have a sample code here for ERC-20 token:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.0/contracts/token/ERC20/IERC20.sol
interface IERC20 {
function totalSupply() external view returns (uint);

function balanceOf(address account) external view returns (uint);

function transfer(address recipient, uint amount) external returns (bool);

function allowance(address owner, address spender) external view returns (uint);

function approve(address spender, uint amount) external returns (bool);

function transferFrom(
address sender,
address recipient,
uint amount
) external returns (bool);

event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}



contract ERC20 is IERC20 {
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
string public name = "Solidity by Example";
string public symbol = "SOLBYEX";
uint8 public decimals = 18;

function transfer(address recipient, uint amount) external returns (bool) {
balanceOf[msg.sender] -= amount;
balanceOf[recipient] += amount;
emit Transfer(msg.sender, recipient, amount);
return true;
}

function approve(address spender, uint amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}

function transferFrom(
address sender,
address recipient,
uint amount
) external returns (bool) {
allowance[sender][msg.sender] -= amount;
balanceOf[sender] -= amount;
balanceOf[recipient] += amount;
emit Transfer(sender, recipient, amount);
return true;
}

function mint(uint amount) external {
balanceOf[msg.sender] += amount;
totalSupply += amount;
emit Transfer(address(0), msg.sender, amount);
}

function burn(uint amount) external {
balanceOf[msg.sender] -= amount;
totalSupply -= amount;
emit Transfer(msg.sender, address(0), amount);
}
}

This is how your screen will appear after you have inserted the code mentioned above:

Proof of 5ire

Step 5: Click on Solidity Compiler and click on compile 5ire.sol.

Proof of 5ire

Proof of 5ire

Step 6: Click on Deploy & Run Transactions to perform your desired transactions.

Proof of 5ire

Step 7: Deploy the contract 5ire.sol. Select Injected Web3 for deploying to live network. In this case, we have selected MetaMask as the injected provider.

Proof of 5ire

Step 8: Confirm the transaction after verifying the details. You have to enter the wallet address as well as the amount that will be transferred to the receiving account.

Proof of 5ire

Step 9: Confirm the gas fee in MetaMask to deploy transactions on the 5ire EVM chain (the gas fee is a small transaction fee which is used for completion of a transaction).

Proof of 5ire

Step 10: Find the deployed contract address in Remix and update the contract by interacting with integrated functions.

Proof of 5ire

Ganache

Ganache is a private Ethereum blockchain environment that allows you to emulate the Ethereum blockchain to interact with smart contracts in a private blockchain. It can run tests, execute commands, and inspect states while controlling how the chain operates.

Visit this link to download Ganache.

The following guide will walk you through the process of deploying a smart contract using Ganache:

Step 1: Open Remix IDE in your browser and create a new file under the contract section.

Ganache Step 1

Step 2: Use one of the sample code templates and compile by clicking the Compile button as shown below.

Ganache Step 2

Step 3: After compilation, open Ganache on your desktop. Your display will resemble the illustration below. Click on QUICKSTART Ethereum.

Ganache Step 3

Step 4: You will now see 10 default accounts, along with a mnemonic for your blockchain at a local RPC server (HTTP://127.0.0.1:7545) as shown below:

Ganache Step 4

Step 5: Go back to the browser and move to the Deploy section just below Compile and select Ganache Provider from the environment as shown below:

Ganache Step 5

Step 6: Enter the server HTTP://127.0.0.1:7545 as Ganache Provider. Your screen will look like the image shown below:

Ganache Step 6

Step 7: Your contract is now ready to be deployed! Click on the Deploy button to proceed.

Ganache Step 7

Step 8: Check the output tab to verify whether your contract has been successfully deployed.

Ganache Step 8

Step 9: To verify whether your transaction (process) was successfully reflected on the server, open Ganache and move to Transactions. Here you will see the details of your transaction as shown in the image below:

Ganache Step 9

Video Tutorial:

Hardhat

This guide outlines the process for deploying an EVM Smart Contract using Hardhat, which will be carried out on the 5ire EVM IDE.

Step 1: Start by creating a project folder. For this guide, the project folder is titled “mkdir hardhat-tutorial”.

HardHat Step 1

Step 2: Run the command npx hardhat.

Step 3: The next step is to select Create a Javascript/Typescript project when prompted with the question, "What do you want to do?"

HardHat Step 3

Step 4: Add the hardhat project root created at the start.

HardHat Step 4

Step 5: Press “Y” to complete the process.

HardHat Step 5

Step 6: Upon completion of the process, the appearance of your screen will be as depicted in the image below.

HardHat Step 6

Step 7: Open Remix IDE and select Deploy and Run Transactions.

HardHat Step 7

Step 8: Select Hardhat Provider.

HardHat Step 8

Step 9: You will see the chain ID and list of accounts if the connection has been established.

HardHat Step 9

Step 10: Run the command npx hardhat node. It will then display a list of 20 accounts with a balance of 10000 ETH.

HardHat Step 10

Step 11: By clicking on Deploy, you can initiate deployment of a specific smart contract, and if all goes well, your transaction will be successful.

HardHat Step 11

Step 12: You can verify the completion of your transaction by checking the terminal.

HardHat Step 12

Video Tutorial: