Skip to content

Figure out and clean up contract artifacts loading  #96

Description

@krebernisak

Currently, we don't have proper tools in place to load Cairo and Solidity contract artifacts from imported NPM/PyPI packages.

Our typescript tests and gauntlet implementation is filled with ad-hoc loading functions like this:

export const loadOpenzepplinContract = (name: string): any => {
  return json.parse(
    fs
      .readFileSync(
        `${__dirname}/../../../node_modules/@openzeppelin/contracts/build/contracts/${name}.json`,
      )
      .toString('ascii'),
  )
}

There are many unanswered questions:

  • Is loading Solidity contracts from imported NPM packages really still unsupported by the HardHat toolchain?
  • If it's not supported, what kind of additional utilities we can write to simplify this for us?
  • What about Cairo imported contracts? These can be loaded to scope via NPM or PyPI, which complicates things.
  • What about our Go stack, how do we access and load contracts from our Go code?
    • We currently proxy contract deployments and some interactions via Gauntlet (TS). Will we continue to do that for all cases or will we need to access contract directly from Go code?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions