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

Delegate calls fix #36

Closed
Artemka374 opened this issue Apr 3, 2023 · 1 comment
Closed

Delegate calls fix #36

Artemka374 opened this issue Apr 3, 2023 · 1 comment
Assignees

Comments

@Artemka374
Copy link
Contributor

Artemka374 commented Apr 3, 2023

Right now delegate calls can't work as they were before due to latest ink! changes.
As was mentioned in this issue, the problem is in initializing storage, so, we have the following possible options of making everything work:

  • Using an empty ink(storage) struct and wrapping the main storage into another structure with initializing in Storable::decode method
  • We can implement custom Storable::decode method, so every struct will be extracted from storage by it's own storage key and initialized if it is not, like it was implemented here, but we have a problem, that we can reimplement encode method for structs to be set to storage by theirs storage key by default, so we will need to manually flush every such struct in storage.
  • Using Lazy for every such struct, but the downsides of this approach is that it will change the approach of working with any contract a lot

The best solution for this problem will be implementing something like this in ink! itself.

@Artemka374 Artemka374 changed the title Upgradeable contracts fix Delegate calls fix Apr 13, 2023
@PierreOssun
Copy link
Contributor

PierreOssun commented Jun 1, 2023

@Artemka374 Will this be fixed by #76?
Any update on when can we have diamond contracts back ?

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

No branches or pull requests

2 participants