Skip to content
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

Closed
0x-r4bbit opened this issue Feb 28, 2024 · 0 comments · Fixed by #72
Closed

Introduce deploy script for stakemanager migration #71

0x-r4bbit opened this issue Feb 28, 2024 · 0 comments · Fixed by #72
Assignees
Milestone

Comments

@0x-r4bbit
Copy link
Collaborator

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 two StakeManager, 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.

@0x-r4bbit 0x-r4bbit added this to the Staking V1 milestone Feb 28, 2024
@0x-r4bbit 0x-r4bbit mentioned this issue Feb 28, 2024
6 tasks
@0x-r4bbit 0x-r4bbit self-assigned this Feb 28, 2024
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
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant