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

Upgradeable contracts using proxies. #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented May 21, 2024

name = "implementation"

[proxy]
enabled = true # Undecided if we really need this flag yet.
Copy link
Member

Choose a reason for hiding this comment

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

I think removing this makes sense, as absence or existence of [proxy] table can be used to deduce this

Copy link
Member Author

@JoshuaBatty JoshuaBatty May 21, 2024

Choose a reason for hiding this comment

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

I guess setting this to false would allow you to deploy the contract for testing purposes before generating and committing to the proxy contract.

Users could always comment out [proxy] but this might make that more explicit?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm you mean to test the implementation contract right? if so sounds good to me. Another option to infer the enabled = true if the table is there, and for testing users can use enabled = false or we can explicitly require the field to be there.

Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw I think having them comment it out for that behavior (or run a specific flag) looks more correct.

Choose a reason for hiding this comment

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

I'm not sure if address = # is valid TOML.

Some blockchains make things like this explicit by pointing to well-known values like addresss = 0x0000000000000000000000000000000000000000. I personally don't like this because you have to count the number of 0 for no good reason and is also error-prone.

Maybe an enum here or a shorter value as a placeholder could make sense:

address = 0x0
address = ""

Choose a reason for hiding this comment

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

If the proxy will only ever be a single value, would it make sense to move this to the project table?

- **Storage Layout Consistency**: Ensure that the storage layout between the proxy and the implementation contracts is identical.

### **Example Contract Syntax**
@IGI-111 to fill out.
Copy link
Member

@sdankel sdankel Aug 20, 2024

Choose a reason for hiding this comment

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

Can we fill this in?

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.

5 participants