Compiling a Contract

Do the following in the Remix IDE:

  1. Create a new blank workspace using the File Explorer.
  2. Create a new file and name it Storage.sol.
  3. Copy the below code and paste it into Storage.sol. This code is from the Solidity tutorial.
    // SPDX-License-Identifier: GPL-3.0
    pragma solidity >=0.4.16 <0.9.0;
    
    contract SimpleStorage {
        uint storedData;
    
        function set(uint x) public {
            storedData = x;
        }
    
        function get() public view returns (uint) {
            return storedData;
        }
    }
    
  4. Click on the Solidity compiler icon and click on the Compile Storage.sol to compile the contract.
  5. Introduce a bug in Storage.sol by changing the line uint storeData; to uint store;. Click the Compile Storage.sol button again and check that errors are reported.
  6. Undo the bug and continue with the next section.