The Wayback Machine - https://web.archive.org/web/20230418021635/https://www.geeksforgeeks.org/steps-to-execute-solidity-smart-contract-using-remix-ide/
Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Steps to Execute Solidity Smart Contract using Remix IDE

Improve Article
Save Article
Like Article
  • Difficulty Level : Medium
  • Last Updated : 17 Feb, 2023
Improve Article
Save Article
Like Article

Remix IDE is generally used to compile and run Solidity smart contracts. Below are the steps for the compilation, execution, and debugging of the smart contract. 

Step 1: Open Remix IDE on any of your browsers, select on New File and click on Solidity to choose the environment. 

Remix IDE Startup Window

Step 2: Write the Smart contract in the code section, and click the Compile button under the Compiler window to compile the contract. 

Solidity




// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.5.0;
contract SolidityTest{
    uint a=10;
    uint b=12;
    uint sum;
    function getResult() public returns(uint){
        sum=a+b;
        return sum;
    }
}

Compile Code

Step 3: To execute the code, click on the Deploy button under Deploy and Run Transactions window. 

Deploy Code

Step 4: After deploying the code click on the method calls under the drop-down of deployed contracts to run the program, and for output, check to click on the drop-down on the console.

Output Window

Step 5: For debugging click on the Debug button corresponding to the method call in the console. Here you can check each function call and variable assignments. 

Debugging Code

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles