-
Notifications
You must be signed in to change notification settings - Fork 160
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
WIP: upgrade-str #222
WIP: upgrade-str #222
Conversation
Hey @satyamakgec Overall pattern looks great. I think we can simplify the code a lot by using something like the below - taking advantage of overloaded functions in Solidity. Let me know what you think - should let us easily represent named variables and single-level maps in So for example, a line like: and:
|
To make it clearer what storage a contract is using, could we list all storage at the top in comments. i.e.
|
Would prefer to see storage structured along the lines of: symbol (string) maps to:
securityToken maps to:
Other securityToken details can be looked up dynamically from the ST (e.g. ST owner, ST name, ST version) - we can provide getter functions for these. If we want to make the above mappings iterable, we could also store:
|
Some feedback (not all of these relate to the upgrading functionality):
in a function.
|
|
@adamdossa I think constructor call is also not possible to store the state variables in proxy contract. I try to do it but I am not able to access the variables. Some insights are written here as well zeppelinos docs |
Can we do something like:
so we only write out the variable if the value changes - this should be cheap from a gas perspective. |
recent commit has the |
Re. I didn't follow the bit:
could you explain a bit more what you mean? In terms of updating state, the owner needs to be able to account for situations like:
|
Yes, we can add the function to change the PolyToken address.
The initially the idea of using the
following these above requirements in mind we had created
if we are thinking to change that functionality then we can rework on the logic of the
we have another function called To make the approach simpler we can merge |
As you suggested to create the library I try to make a one. I did not change lot of things in the code only factored out the hashing logic from the contract and use a helper library for that. you can check the code of EternalStorage.sol and the helper library. Using the library logic we saved more than But still, it is a good improvement related to gas. I am thinking to optimize it more. Could we move any other functionality into our |
ah! got the answer as It depends on the |
I'm wondering if we really need to have this function: |
Yes we can remove it as we will never gonna use it. |
Test cases are passed in the build but getting a failure in |
No description provided.