Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solc --gas outputs nothing #15219

Open
haoyang9804 opened this issue Jun 25, 2024 · 2 comments
Open

solc --gas outputs nothing #15219

haoyang9804 opened this issue Jun 25, 2024 · 2 comments
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. should have We like the idea but it’s not important enough to be a part of the roadmap.

Comments

@haoyang9804
Copy link
Contributor

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.

@mehtavishwa30
Copy link
Contributor

Hey @haoyang9804! Thanks for reporting this bug.

As mentioned in #13566, solc --gas has not been actively maintained and we plan to remove it in the next breaking version as the estimator isn't heavily used in practice.

As per our knowledge, there are no major tools that depend on it. So we would love to know if you have a specific use-case for it or any other dependency that the team should consider before deprecating it.

@haoyang9804
Copy link
Contributor Author

Hey @haoyang9804! Thanks for reporting this bug.

As mentioned in #13566, solc --gas has not been actively maintained and we plan to remove it in the next breaking version as the estimator isn't heavily used in practice.

As per our knowledge, there are no major tools that depend on it. So we would love to know if you have a specific use-case for it or any other dependency that the team should consider before deprecating it.

Thanks for your kind reply. Honestly, I don't have a designated scenario where this flag is necessary. I encountered this error while experimenting with the compiler for smart contract compilation, and I mistakenly regarded it as an error.

@cameel cameel added low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. should have We like the idea but it’s not important enough to be a part of the roadmap. labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. should have We like the idea but it’s not important enough to be a part of the roadmap.
Projects
None yet
Development

No branches or pull requests

3 participants