0

I have an extremely basic contract, but saw infinite execution cost on Remix. Any insights will be appreciated.

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Config {

    address public a;

    constructor (address _a) {
        a = _a;
    }
}

Remix gas estimate:

{
    "Creation": {
        "codeDepositCost": "49400",
        "executionCost": "infinite",
        "totalCost": "infinite"
    },
    "External": {
        "personalAddress()": "2489"
    }
}
2
  • where can you see the estimated gas? have you added an extra plugin to remix?
    – Majd TL
    Commented Jul 19, 2022 at 7:31
  • After you compile a contract, click "Compilation Details" =, then click "Gasestimates".
    – Richard
    Commented Jul 19, 2022 at 22:43

1 Answer 1

1

It's probably a bug. Sometimes Remix behave weird.

Check this post, This guy tested it on a testnet and proved that its just a bug Getting infinite gas estimates for simple functions

1
  • Thanks. I saw the other post. The other contract uses string. The gas usage ineed can be unbounded. Seems reasonable to think it is a remix bug.
    – Richard
    Commented Jul 19, 2022 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.