added the hub connected with TreasurySpoke in the constructor, so each treasury spoke will be connected with a hub - #1322
Open
web3devLuBdF wants to merge 2 commits into
Open
Conversation
…h treasury spoke will be connected with a hub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #799
An Immutable variabile named "HUB" has been added at the contract level , because it is immutable it will be part of the final bytecode and its value will not can be changed after deployment and it has been marked as public.
A constructor has been added in "TreasurySpoke" contract and the variabile "HUB" has been initialized in it, so each treasury spoke will have a hub.
Although "TreasurySpoke" contains upgradeable elements (for Ownable2StepUpgradeable), the presence of constructor is not a problem if it does not affect upgradeable pattern logic.
Naturally "TreasurySpokeInstance" and "MockTreasurySpokeInstance" contracts that inherit directly by "TreasurySpoke" had to indicate "HUB" variable as argument in their constructors.
Initially the deployment of treasury spoke instance failed in treasury spoke tests with the error "FailedCreate2FactoryCall" because it is deployed with CREATE2, so the addition of constructor in "TreasurySpoke" contract has changed final expected bytecode in deterministic deployment.
Because of this has been necessary to encode the "TreasurySpoke" argument in the final bytecode, and all files involved in treasury spoke deployment have added this argument to ensure that deployment succeds.
Since all this files are quite numerous, is necessary to be careful to how the argument integrates with the other variables.
For this reason if is needed change "HUB" variable visibility, modify the position of treasury spoke instance argument in all files involved in deployment or any other change and addition, i am willing to do it.