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

Implement tools that help with reading compiled contracts #1455

Open
kkawula opened this issue Aug 23, 2024 · 23 comments · May be fixed by #1505
Open

Implement tools that help with reading compiled contracts #1455

kkawula opened this issue Aug 23, 2024 · 23 comments · May be fixed by #1505
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers priority: low

Comments

@kkawula
Copy link
Collaborator

kkawula commented Aug 23, 2024

Add a class/methods that helps with importing scarb output. It gives you everything needed to declare the contract.

  • reads sierra
  • reads casm
  • reads abi
  • calculates compiled_contract_casm

Additionally, add an example in docs.

For reference our implementation for test purposes load_contract.

@kkawula kkawula added the enhancement New feature or request label Aug 23, 2024
@kkawula kkawula added this to the Maintenance and UX milestone Aug 23, 2024
@ShantelPeters
Copy link

Hi @kkawula can i please be assigned to this issue?

@kkawula
Copy link
Collaborator Author

kkawula commented Aug 26, 2024

Hi @ShantelPeters yes, you can take it. Can you give pr this week? FYI: we have similar functionality in our test, so that can inspire you. load_contract

@ShantelPeters
Copy link

Thank you ser 🫡 @kkawula

@kkawula
Copy link
Collaborator Author

kkawula commented Aug 27, 2024

Hi @ShantelPeters, can you create a pull request this week?

@ShantelPeters
Copy link

Okay sir @kkawula

@Constantine234
Copy link

I have an Idea on how to do this i dont know if i can contribute to this

@kkawula
Copy link
Collaborator Author

kkawula commented Aug 28, 2024

Hi @Constantine234! Currently someone is working on this issue, so at this time you can't, but we have a few issues labeled as good first issue so feel free to choose something for yourself.

@kkawula
Copy link
Collaborator Author

kkawula commented Sep 2, 2024

Hi @Constantine234 this issue is free to take, are you still interested in it?

@kkawula kkawula assigned kkawula and Constantine234 and unassigned kkawula Sep 2, 2024
@Constantine234
Copy link

Constantine234 commented Sep 2, 2024

yes sir I am interested @kkawula

@Constantine234
Copy link

@kkawula when will you want this to be ready?

@kkawula
Copy link
Collaborator Author

kkawula commented Sep 2, 2024

It would be great if manage to open pull request in one week and request me for the first review

@Constantine234
Copy link

okay so that is to say it should be done before next week right ? @kkawula

@kkawula
Copy link
Collaborator Author

kkawula commented Sep 2, 2024

yes, something like that

@Constantine234
Copy link

then trust me on this is done I will start working on it tomorrow to Wednesday @kkawula

@Constantine234
Copy link

@kkawula Pull request will be done tomorrow thank you

@Constantine234
Copy link

@kkawula i have done the PR this is the code #1472
you can go check it thank you and if there is any changes let me know

@ManvithaMolakala
Copy link

Hi @kkawula, i would like to contribute to this issue if noone else is working on it. Also, can we connect on telegram to discuss?

Copy link

onlydustapp bot commented Sep 5, 2024

Hey @ManvithaMolakala!
Thanks for showing interest.
We've created an application for you to contribute to starknet.py.
Go check it out on OnlyDust!

Copy link

onlydustapp bot commented Sep 5, 2024

Hey @ManvithaMolakala!
Thanks for showing interest.
We've created an application for you to contribute to Starknet SDK for Python.
Go check it out on OnlyDust!

@franciszekjob franciszekjob modified the milestone: Maintenance and UX Sep 5, 2024
@KXYWISE
Copy link

KXYWISE commented Sep 17, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Intermediate in Python and Java.

How I plan on tackling this issue

Initialization:The class takes in file paths for the Sierra, CASM, and ABI files.Methods:read_sierra(): Loads the Sierra file.read_casm(): Loads the CASM file.read_abi(): Loads the ABI file.calculate_compiled_contract_casm(): Uses the loaded data to compute a unique value for the compiled contract (this is a placeholder and should be replaced with the actual computation).Usage:Create an instance of ScarbOutputImporter, provide the file paths, and call load_all() to load all the data.Then, call calculate_compiled_contract_casm() to compute the result.This structure should give you everything needed to handle importing the Scarb output and computing the required values for declaring the contract. You can extend the placeholder logic in calculate_compiled_contract_casm() based on how the contract declaration process is defined in Starknet.

@tumutech
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have been implemented tools using Python and i can borrow concepts from similar implementations to handle this issue.

How I plan on tackling this issue

I will use inspiration from the https://github.com/software-mansion/starknet.py/blob/development/starknet_py/tests/e2e/fixtures/misc.py#L72C5-L72C18 , then i will test the implementation solution if it solves the problem i will go ahead and write a documentation on how the tool can be used.

@ManvithaMolakala
Copy link

Hi @kkawula

Please confirm the following approach for this issue:
I will add the function load_contract that takes input as contract_name, package name and outputs casm, sierra in contract_utils.py.

@kkawula
Copy link
Collaborator Author

kkawula commented Sep 27, 2024

Hi @ManvithaMolakala
Yes, it sounds good, remember that Scarb generates artifacts file in target/dev, where we can find paths to outputs and casm isn't always generated, it must be marked as true in Scarb.toml

[[target.starknet-contract]]
casm = true
sierra = true

@ManvithaMolakala ManvithaMolakala linked a pull request Oct 5, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers priority: low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants