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

feat(script): add deployment script for new StakeManagers #72

Merged
merged 1 commit into from
Feb 29, 2024

Commits on Feb 28, 2024

  1. feat(script): add deployment script for new StakeManagers

    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 committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    a860f8f View commit details
    Browse the repository at this point in the history