Closed 0x-r4bbit closed 6 months ago
This is needed to deploy individual new StakeManager instances in both, production environment and testing.
StakeManager
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:
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.
address(stakeManager)
stakeToken
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:
forge
PREV_STAKE_MANAGER
STAKE_TOKEN_ADDRESS
$ 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).
address(0)
Closes #71
Ensure you completed all of the steps below before submitting your pull request:
forge snapshot
pnpm gas-report
pnpm lint
forge test
pnpm verify
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 olderStakeManager
instance, run:Where
address(stakeManager)
is the address of the currentStakeManager
andstakeToken
is the address of the stake token.To deploy a new instance from the CLI using
forge
, one can make use of thePREV_STAKE_MANAGER
andSTAKE_TOKEN_ADDRESS
environment variables like this:The script will revert when
STAKE_TOKEN_ADDRESS
isaddress(0)
.Closes #71
Checklist
Ensure you completed all of the steps below before submitting your pull request:
forge snapshot
?pnpm gas-report
?pnpm lint
?forge test
?pnpm verify
?