-
Notifications
You must be signed in to change notification settings - Fork 4
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
Execute forks separately #96
Conversation
That looks right to me. I guess this happens next but I think the places that use the I think we also need to manage a state where the fork is judged to have happened from the point of view of stopping action on the old version. I'm not sure whether this would be measuring whether one or the other children have been created, or whether it automatically kicks in once the |
d9b60dd
to
e4b52b5
Compare
For the token splitting I would do an interface something like
Then I think the balances need to be tracked per-user, not globally. [edited] |
Also on the token splitting, I don't think we need to write both to storage? You say which ones you want to move. If you say both, just do the burn and mint on both. If you only say one, mint that and write the other one to storage in |
e4b52b5
to
5b44a63
Compare
these things I would add later. I hate the fact that I needed to touch the bridge contract anyways, as it was optimized such that it nearly fits into a block limit. Hence, all these "helper function", I can add later, once I have the size again under control.
Fixed Also on the token splitting, I don't think we need to write both to storage? You say which ones you want to move. If you say both, just do the burn and mint on both. If you only say one, mint that and write the other one to storage in unspentTokens[owner][yesOrNo] or something then credit it if the user calls the other one later. Yes, I have that locally, but still need to figure out the contract size with that. the if and else things add some size. Let me try to figure out a good way |
I adopted much of the feedback. Contracts are now too big, but I will find a way to make them smaller again |
Finally, I am okaisch with the result: I needed to revert the separate creation of child1 and child2 for the bridge contract, since this would require two function that I could not fit into the bridge contract - (one consumes less space). It sounds crazy, but I would there are really no low hanging wins to reduce the contract size.
Also, I could not put in any storage variable that would store the tokens that are immediately created during the splitting process( as I did earlier in the PR). Now, the users just have the option to either mint both child-tokens after the forking process - or only one child-fork token, if the second version might have a broken minting functionality. In the forkonomic token, we have enough contract size left to do it more elegantly and also store the amount, if initially only one child-token was created. |
On |
Just first initial thoughts...