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

Upgrade challenge 0 to v3 #150

Conversation

danielcdz
Copy link

@danielcdz danielcdz commented Oct 3, 2024

Full update challenge-0 to v3

Types of change

  • Feature
  • Bug
  • Enhancement

Comments (optional)

@danielcdz danielcdz force-pushed the upgrade-challenge-0-to-v3 branch from b4dc23f to ed39327 Compare October 3, 2024 05:19
@@ -0,0 +1,221 @@
use starknet::ContractAddress;
Copy link
Collaborator

@gianalarcon gianalarcon Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not look like this, I expect to see what section of the code has been changed/improved in order to match with latest dependencies

This file should not change from empty file to new implementation, we have already a working contract

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it looks like this because I started the migration using the base-challenge branch and added the necessary updates from challenge-0. However, the implementation is the same as what we currently have in challenge-0

@@ -0,0 +1,58 @@
#[starknet::contract]
Copy link
Collaborator

@gianalarcon gianalarcon Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need mock_contracts folder? As It is mentioned in the issue description we expect to remove this folder if it is not needed

@@ -1,5 +1,13 @@
mod YourContract;
Copy link
Collaborator

@gianalarcon gianalarcon Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mod YourContract is not part of latest stable release

I dont expect to see this change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I deleted this since the base-challenge branch has YourContract but as you mentioned for challenge-0 the mod is YourCollectible

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Dont need to delete a file thats has never been on this challenge-0. As you say I expected to see whats has been changed/improved on YourCollectible

openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.14.0" }
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" }
starknet = "2.8.2"
openzeppelin = "0.17.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to use full OZ, lets import the specific modules we need for this challenge

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! ✅

mod YourCollectible {
use starknet::storage::Map;
use contracts::components::Counter::CounterComponent;
use contracts::components::ERC721Enumerable::ERC721EnumerableComponent;
Copy link
Collaborator

@gianalarcon gianalarcon Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect to get rid of this custom ERC721EnumerableComponent and use the provided by OZ

@danielcdz
Copy link
Author

@gianalarcon I'll be addresing your comments asap 🫡 ty for your feedback

@gianalarcon
Copy link
Collaborator

gianalarcon commented Oct 8, 2024

Hi @danielcdz
The path I expect is the following
You create a local branch based on challenge-0 lasted stable version
On your local branch you have to migrate all the necessary changes of challenge-base, you dont need to migrate the YourContract and some views that just belong to challenge-base
After that you have to update and improve the contract of the challenge

Not sure if you can finish it on time, anyway the issue will remain open even after OD8 hacks end. Thanks! Do your best!

@danielcdz
Copy link
Author

closing this PR to change the approach, following advice from @gianalarcon , I'll be opening a new one asap

@danielcdz danielcdz closed this Oct 9, 2024
manlikeHB pushed a commit to manlikeHB/speedrunstark that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants