1

I understand that proxies use delegatecall to execute the logic contract's function with its own storage.

But what happens when we define any storage variables in the logic contract as well as initialize it at the same time.

How does the proxy get that value from the variable? For example, I am sharing the compound governance code.

This is the implementation contract, notice the variables are initialized. After deploying how does the storage of proxy gets updated with the exact values???

1 Answer 1

0

Those variables are marked as constant, which means they are part of the bytecode and are not stored in contract storage. Sometimes, you may see some variables are immutable. In that case, they are also part of the bytecode. The values for those types of variables, are initialized during the deployment in the constructor and can't be reassigned later.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.