smartcontractkit / smartcontractkit/chainlink-starknet

Figure out and clean up contract artifacts loading

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
60
Forks
31
Avg merge
3d 3h
Merged PRs (30d)
2

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the ad-hoc artifact loader shown in the issue and its uses in the TypeScript tests and Gauntlet implementation. Then investigate the Hardhat-toolchain question, Cairo packages from NPM or PyPI, and access from the Go stack. Done means the supported loading approach and scope for each stack are settled.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, solidity, typescript
Domain
blockchain, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.