-
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
Introduce deploy script for stakemanager migration #71
Comments
0x-r4bbit
added a commit
that referenced
this issue
Feb 28, 2024
This is needed to deploy individual new `StakeManager` instances in both, production environment and testing. The script can be used as follows: Within tests, to get a new `StakeManager` instance that has a reference to an older `StakeManager` instance, run: ```solidity function setUp() public virtual override { super.setUp(); DeployMigrationStakeManager deployment = new DeployMigrationStakeManager(address(stakeManager), stakeToken); newStakeManager = deployment.run(); } ``` Where `address(stakeManager)` is the address of the current `StakeManager` and `stakeToken` is the address of the stake token. To deploy a new instance from the CLI using `forge`, one can make use of the `PREV_STAKE_MANAGER` and `STAKE_TOKEN_ADDRESS` environment variables like this: ```sh $ PREV_STAKE_MANAGER=0x123 STAKE_TOKEN_ADDRES=0x456 forge script script/DeployMigrationStakeManager.s.sol ``` The script will revert when `STAKE_TOKEN_ADDRESS` is `address(0)`. Closes #71
6 tasks
0x-r4bbit
added a commit
that referenced
this issue
Feb 28, 2024
This is needed to deploy individual new `StakeManager` instances in both, production environment and testing. The script can be used as follows: Within tests, to get a new `StakeManager` instance that has a reference to an older `StakeManager` instance, run: ```solidity function setUp() public virtual override { super.setUp(); DeployMigrationStakeManager deployment = new DeployMigrationStakeManager(address(stakeManager), stakeToken); newStakeManager = deployment.run(); } ``` Where `address(stakeManager)` is the address of the current `StakeManager` and `stakeToken` is the address of the stake token. To deploy a new instance from the CLI using `forge`, one can make use of the `PREV_STAKE_MANAGER` and `STAKE_TOKEN_ADDRESS` environment variables like this: ```sh $ PREV_STAKE_MANAGER=0x123 STAKE_TOKEN_ADDRES=0x456 forge script script/DeployMigrationStakeManager.s.sol ``` The script will revert when `STAKE_TOKEN_ADDRESS` is `address(0)`. Closes #71
3esmit
pushed a commit
that referenced
this issue
Feb 29, 2024
This is needed to deploy individual new `StakeManager` instances in both, production environment and testing. The script can be used as follows: Within tests, to get a new `StakeManager` instance that has a reference to an older `StakeManager` instance, run: ```solidity function setUp() public virtual override { super.setUp(); DeployMigrationStakeManager deployment = new DeployMigrationStakeManager(address(stakeManager), stakeToken); newStakeManager = deployment.run(); } ``` Where `address(stakeManager)` is the address of the current `StakeManager` and `stakeToken` is the address of the stake token. To deploy a new instance from the CLI using `forge`, one can make use of the `PREV_STAKE_MANAGER` and `STAKE_TOKEN_ADDRESS` environment variables like this: ```sh $ PREV_STAKE_MANAGER=0x123 STAKE_TOKEN_ADDRES=0x456 forge script script/DeployMigrationStakeManager.s.sol ``` The script will revert when `STAKE_TOKEN_ADDRESS` is `address(0)`. Closes #71
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something that came up in #69 (comment)
Basically, the problem there is that another instance of
StakeManager
was added to the deployment script to get access to it in the test environment for migration related tests. Now, whenever we want to run the deployment, we'll always deploy twoStakeManager
, which is not actually what we want.In the context of the mentioned PR, this can be fixed by simply creating an instance of the migration stakemanager within the test environment and not touching the deployment script at all.
However, we still need a deployment script for deploying new versions of a stakemanager (without deploying them twice, or the
VaultFactory
).Hence, I think it makes sense to add a dedicated deployment script, which essentially does what's added in the mentioned PR.
That deployment script can then also be used in the tests.
The text was updated successfully, but these errors were encountered: