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

Move the crypto contract outside of cadence #3135

Open
3 tasks
tarakby opened this issue Feb 26, 2024 · 3 comments
Open
3 tasks

Move the crypto contract outside of cadence #3135

tarakby opened this issue Feb 26, 2024 · 3 comments
Labels
Feature Feedback Language Breaking Change Breaks Cadence contracts deployed on Mainnet

Comments

@tarakby
Copy link
Contributor

tarakby commented Feb 26, 2024

Issue to be solved

The crypto contract offers crypto tools that are fully developed in the cadence language and don't have to be built-in in the language. It makes more sense to take the crypto contract outside of the Cadence repo and add it as an independent standard library core-contract.

This issue is a follow-up on the discussion in #1447 (comment)

Suggested Solution

Moving the Crypto contract out of Cadence will require:

  • Moving the contract to the Flow core contracts repository (https://github.com/onflow/flow-core-contracts) (tiny)
    Move tests (small)
  • Deploy the contract on all chains (medium)
  • Add state migration which migrates existing stored values to the respective new deployed contract (large)

No additional work in the contract itself is required, we had already previously refactored it to be deployable like any other contract

@j1010001
Copy link
Member

Given the effort required to complete this (moving this as a separate contract, updating all contracts to import this) it is unlikely we can complete it in C1.0. It might need to stay where it is.

@j1010001 j1010001 added the Language Breaking Change Breaks Cadence contracts deployed on Mainnet label Mar 12, 2024
@j1010001
Copy link
Member

We might be able to do this in a non-breaking way, if we can make "import crypto" statement to work - then this would not be a breaking change.

@bluesign
Copy link
Contributor

I feel like if something breaking will be done here, better to moving native types ( HashAlgorithm.etc ) inside crypto in a native way. Crypto being pure Cadence has no value for the future. If we later have add something that is not in pure Cadence ( which seems pretty likely in the crypto context ) at least we can prevent polluting global namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feedback Language Breaking Change Breaks Cadence contracts deployed on Mainnet
Projects
None yet
Development

No branches or pull requests

3 participants