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

Smart Contract - Refactoring code and dependancies upgrade #56

Closed
10 of 11 tasks
bal7hazar opened this issue Sep 13, 2022 · 0 comments · Fixed by #68
Closed
10 of 11 tasks

Smart Contract - Refactoring code and dependancies upgrade #56

bal7hazar opened this issue Sep 13, 2022 · 0 comments · Fixed by #68

Comments

@bal7hazar
Copy link
Contributor

bal7hazar commented Sep 13, 2022

Description

With the new Cairo 0.10.0 we have to update our smart contract code to keep up-to-date.

Because we will have to go through all the code, it could be a good opportunity to refactor additionnal code according to latest guidelines.

Upgrade the following deps:

Few ideas:

  • Move protostar version from secrets to job env (to avoid to have failing CIs in PRs)
  • Add unit_256 checks for all Uint256 inputs (see function in OZ ERC-1155)
  • Re-entrancy security improvment (guard feature when interfaces are used in contracts)
  • Check-Effect-Interaction compliance when transfer ERC-20 tokens
  • Constructor to Initializer for libraries
  • _iter suffix for loops
  • Move owner assertions from library to contracts

What code could be improved?

All cairo files and python files (Cairo 0.10.0 also change python version from 3.7 to 3.9)

Acceptance Criteria

  • Tests on refactored code succeed
  • Deployements on refactored code succeed

Additional context

OZ released a new version of their contracts according to the new cairo version.
A new version of protostar has been released supporting cairo version.

We need a new release of Cairopen before the migration.

@bal7hazar bal7hazar changed the title Cairo upgrade and refactoring code Smart Contract - Cairo upgrade and refactoring code Sep 13, 2022
@bal7hazar bal7hazar changed the title Smart Contract - Cairo upgrade and refactoring code Smart Contract - Refactoring code and dependancies upgrade Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant