Skip to content

Contract name is not necessarily the same as the file name #5

@yann300

Description

@yann300

This leads to an exception while running
https://github.com/EdsonAlcala/remix-gas-profiler/blob/master/src/index.ts#L49
if the contract name is not the same as the file name.
Also .replace(browser/,...) can't be used as the file is not necessarily in the browser explorer.

As a workaround for the moment, I would just loop over all the (compilationResult as any).data.contracts and render

const gasPerLineCost = await this.profiler.getGasPerLineCost(
          sourceMap,
          bytecode,
          originalSourceCode,
          traces,
        )

at each iteration.
Then we can put this result in the editor when we have the API available

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions