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

Add immutables to contract metadata #5611

Closed
Tracked by #13
xermicus opened this issue Sep 5, 2024 · 1 comment
Closed
Tracked by #13

Add immutables to contract metadata #5611

xermicus opened this issue Sep 5, 2024 · 1 comment
Assignees

Comments

@xermicus
Copy link
Member

xermicus commented Sep 5, 2024

In YUL there are two opcodes to load and store immutables. Immutables are indexed so we can store them just as a byte array. Storing is only allowed in the constructor (in EVM they are constants in the runtime code). We'd instead store them tied to the contract before returning from the constructor; the contract can then load them lazily on the first access. Delegate calls prevent us from storing them in regular contract storage.

To make it work for upgradable contracts using set_code_hash we must require that the new code was uploaded and instantiated, otherwise the immutables are missing.

@athei
Copy link
Member

athei commented Dec 1, 2024

Immutable support was added. The remainder of the work is tracked here: #6717

@athei athei closed this as completed Dec 1, 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

No branches or pull requests

3 participants