Skip to content

Added DeployContractUDC to improve contract deployment experience. #752

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

Closed
wants to merge 3 commits into from

Conversation

HACKER097
Copy link

Addresses issue #381.

Implementation details:

  • Declared DeployContractUDC method to account/account.go
  • Implemented logic in account/transaction.go
  • Edited examples/deployContractUDC/main.go to use DeployContractUDC
  • Tested deployment on Sepolia testnet: Transaction

First crypto PR, looking forward to feedback :)

@thiagodeev
Copy link
Collaborator

Hey @HACKER097, congrats on your first PR!
I've noticed you didn't create a unit test for it. Please create one in the transactions_test.go file, using the devnet and/or testnet environment. Take the other tests as example. Let me know if you have any questions

@HACKER097
Copy link
Author

I wasn't able to create a test on devnet because the ABI of the UDC contract differs from the one on testnet, specifically, the function deploy_contract is named deployContract instead. Accounting for that would require changes to the DeployContractUDC directly. Also, the lack of pre-existing class hashes on devnet would make the test more complex.

For now, I've written a test that runs on testnet. It uses hardcoded testnet keys and an RPC URL, similar to the TestSendDeclareTxn test. While I'm not sure if that's acceptable, it does keep the test simpler. Let me know if this approach is okay, and I'll go ahead and push the changes.

@thiagodeev
Copy link
Collaborator

thiagodeev commented Jun 13, 2025

Hey @HACKER097, sorry for the delay.
Interesting information regarding the UDC contract in devnet. I didn't know that.

Sure! You can push the changes, so I can take a look at the code

@thiagodeev thiagodeev moved this to 🏗 In progress in [Nubia] Starknet.go Jun 13, 2025
@HACKER097
Copy link
Author

I have pushed the test. As for the devnet discrepancy, this is how I came across it:

Run the testnet

$ docker run -p 5050:5050 shardlabs/starknet-devnet-rs

Use provided address for testing

Predeployed UDC
Address: 0x41A78E741E5AF2FEC34B695679BC6891742439F7AFB8484ECD7766661AD02BF
Class Hash: 0x7B3E05F48F0C69E4A65CE5E076A66271A527AFF2C34CE1083EC6E1526997A69

Check abi

$ starkli class-at 0x41A78E741E5AF2FEC34B695679BC6891742439F7AFB8484ECD7766661AD02BF --rpc http://0.0.0.0:5050
...
      "type": "function",
      "name": "deployContract",
      "inputs": [
...

@thiagodeev
Copy link
Collaborator

thiagodeev commented Jun 17, 2025

Hey @HACKER097!
I have a request. Could you please create a new branch in your fork by copying this one, and create a new PR here? I'm not able to push commits to this PR due to some permission issues. I believe this will be resolved if you use a different branch than main in your fork.

@thiagodeev
Copy link
Collaborator

thiagodeev commented Jun 17, 2025

About your issue with devnet, which version are you using?
Here, with version 0.4.0, in the ABI the function is called deployContract, same as Sepolia

@HACKER097
Copy link
Author

@thiagodeev I have created pr #760 as requested, closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants