clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

costs returned by deployContract are empty

Open pradel opened this issue 8 months ago • 4 comments

Describe the bug

When checking the costs returned by deployContract, their values is always null. Calling callReadOnlyFn correctly returns the costs. I have the --costs flag set and can see the costs of callReadOnlyFn.

const { costs } = simnet.deployContract(
      "anything",
      "anything",
      { clarityVersion: 3 },
      wallet1
    );
    // costs is null
    console.log("costs", costs);

Expected behavior Costs should be set when calling deployContracts.

Environment (please complete the following information):

  • Clarinet version: 2.15.2

pradel avatar Apr 04 '25 13:04 pradel

Nice catch @pradel In order for us to prioritise it, can you explain your use case? When do you actually need to track the costs of a contract deployment?

hugoclrd avatar Apr 04 '25 13:04 hugoclrd

I want to enforce a max costs for my contracts during the tests and try to optimise my contracts during development

pradel avatar Apr 04 '25 13:04 pradel

Ok I see. But the costs of contract deployment mostly only depends on the size of the contract. And on the top level execution of Clarity (so basically everything that is not define- etc.. Is this what you're interested in?

hugoclrd avatar Apr 04 '25 15:04 hugoclrd

yes exactly

pradel avatar Apr 04 '25 15:04 pradel