foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(doc): new section "Constants" for constants and immutables

Open PaulRBerg opened this issue 2 years ago • 2 comments

Component

Forge

Describe the feature you would like

Given the following Solidity contract:

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19;

contract Counter {
    uint256 public constant FOO = 1;
    uint256 public immutable BAR;

    constructor() {
        BAR = 2;
    }
}

forge doc will produce the following Markdown docs:

# Counter

## State Variables
### FOO

```solidity
uint256 public constant FOO = 1;
```


### BAR

```solidity
uint256 public immutable BAR;
```

That is, Forge will nest the FOO constant and the BAR immutable under a section called "State Variables".

The name of this section is misleading. It should say "Constants" instead.

Additional context

No response

PaulRBerg avatar Mar 20 '23 19:03 PaulRBerg

If no one has claimed this, I'd like a crack at it.

SocksNFlops avatar Nov 11 '25 22:11 SocksNFlops

Thanks @SocksNFlops, assigned

zerosnacks avatar Nov 12 '25 08:11 zerosnacks