> For the complete documentation index, see [llms.txt](/llms.txt).

export const counterSource = `// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.30;

contract Counter {
    uint256 public number;

    function setNumber(uint256 newNumber) public {
        number = newNumber;
    }

    function increment() public {
        number++;
    }
}`;

## Folder Structure

Let’s view the file structure for a default foundry project:

```bash
$ cd hello_foundry
$ tree . -d -L 1
.
├── lib
├── script
├── src
└── test

4 directories
```

## Demo smart contract
In the `src` folder, you will find a simple smart contract called `counter.sol`. Which contains a simple counter contract.



:::info[Try this contract in Remix]
Want to deploy and interact with `Counter.sol` without any local setup? Use the button below to open it directly in the Remix IDE. You'll need MetaMask with [Rootstock Testnet configured](/dev-tools/wallets/metamask/) — see the full [Remix + Rootstock guide](/developers/quickstart/remix/) for the exact steps.


:::

## Compile the Contract
To build the contract, run the following command in the project's root directory.

```bash
forge build
```

This will compile your smart contracts and generate `out` directory:

```bash
forge build
[⠊] Compiling...
[⠒] Compiling 36 files with Solc 0.8.30
[⠑] Solc 0.8.30 finished in 1.56s
Compiler run successful!
```
