Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading contracts with only ABI #143

Open
ivpavici opened this issue Jul 8, 2022 · 4 comments
Open

Allow loading contracts with only ABI #143

ivpavici opened this issue Jul 8, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@ivpavici
Copy link
Contributor

ivpavici commented Jul 8, 2022

starknet.getContractFactory could be modified to not require both contract.json and contract_abi.json artifacts. This way using contractFactory.getContractAt would only be supported, contractFactory.deploy wouldn't.

@ivpavici ivpavici added the enhancement New feature or request label Jul 8, 2022
@FabijanC
Copy link
Collaborator

FabijanC commented Jul 8, 2022

Also note, the content of the contract_abi.json is a property of the object in contract.json. Perhaps this can be taken into account when addressing this issue.

@FabijanC FabijanC added the OnlyDust Open for OnlyDust contributors label Jan 31, 2023
@robinstraub
Copy link

Hello @FabijanC, sorry for the delay. I had a more thorough look into it and got some advice from @Nathan-SL.

Basically the "contract.json" is represented by the "metadaPath" and the "contract_abi.json" is represented by the "abiPath". So this issue is about getting rid of the "abiPath".

There are 2 modifications needed to resolve this issue that I would consider breaking changes:

I see 3 options to address this:

  1. Create a breaking change and get rid of the abiPath (including removing the getAbiPath function and the interface inheritance)
  2. Consider the getAbiPath function and the interface inheritance important and disregarding the issue
  3. Marking the abiPath property as optional, and deriving it from the metadataPath (but then the logic of getContractFactoryUtil)[https://github.com/Shard-Labs/starknet-hardhat-plugin/blob/master/src/extend-utils.ts#L13] becomes redundant and it might need a bigger refactoring)

I'd say if the breaking change is not a problem we go with solution 1.

Feel free to ping me on telegram if you want to discuss this more thoroughly.

@FabijanC
Copy link
Collaborator

@robinstraub Sorry for the delay in replying. I don't understand how removing abiPath would allow users to load contracts only with ABI. Shouldn't it be the other json artifact that would require removing? Also note that since the introduction of Cairo 1 the plugin currently requires another artifact: contract.casm (due to Sierra mid-layer).

@ivpavici
Copy link
Contributor Author

ivpavici commented Aug 24, 2023

This will probably be handled as well by #396

@ivpavici ivpavici removed the OnlyDust Open for OnlyDust contributors label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants