Skip to content

solc --gas outputs nothing #15219

Open
Open
@haoyang9804

Description

@haoyang9804

Description

Just as the title mentioned, solc --gas does not output a gas esitimation.

Environment

  • Compiler version: 0.8.27-develop.2024.6.25+commit.ce4be6e1.Darwin.appleclang
  • Operating system: Macos M2 Sonoma 14.5

Steps to Reproduce

pragma solidity ^0.8.0;

contract Test {
    uint[] array;

    function testGasEstimation() public {
        array.push(1);
    }
}

Execute the above example and the output is

Warning: This is a pre-release compiler version, please do not use it in production.

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.

No gas estimation found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.low impactChanges are not very noticeable or potential benefits are limited.should haveWe like the idea but it’s not important enough to be a part of the roadmap.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions