Skip to content

Commit

Permalink
Add denies
Browse files Browse the repository at this point in the history
  • Loading branch information
AStox committed Jul 30, 2024
1 parent f0e4945 commit 1c2bbbb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/spell/MigrationSpell-mainnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ contract MigrationSpell {
IRoot rootOld = IRoot(address(ROOT_OLD));
IRoot rootNew = IRoot(address(ROOT_NEW));
IPoolManager poolManager = IPoolManager(address(POOLMANAGER));
IInvestmentManager investmentManagerOld = IInvestmentManager(address(INVESTMENTMANAGER_OLD));
ITranche trancheTokenOld = ITranche(TRANCHE_TOKEN_OLD);
IInvestmentManager investmentManagerOld = IInvestmentManager(address(INVESTMENTMANAGER_OLD));
rootOld.relyContract(address(investmentManagerOld), self);

// deploy new tranche token
rootNew.relyContract(address(POOLMANAGER), self);
Expand Down Expand Up @@ -126,6 +127,11 @@ contract MigrationSpell {
trancheTokenOld.file("symbol", SYMBOL_OLD);

// denies
rootNew.denyContract(address(POOLMANAGER), self);
rootNew.denyContract(address(trancheTokenNew), self);
rootOld.denyContract(address(investmentManagerOld), self);
rootOld.deny(self);
rootNew.deny(self);
}

function getNumberOfMigratedMembers() public view returns (uint256) {
Expand Down
7 changes: 7 additions & 0 deletions src/spell/MigrationSpell.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ contract MigrationSpellTest is Test {
// assert renaming of old trancheToken worked
assertEq(trancheTokenOld.name(), spell.NAME_OLD());
assertEq(trancheTokenOld.symbol(), spell.SYMBOL_OLD());

// assert denies
assertEq(spell.POOLMANAGER().wards(address(spell)), 0);
assertEq(spell.trancheTokenNew().wards(address(spell)), 0);
assertEq(spell.INVESTMENTMANAGER_OLD().wards(address(spell)), 0);
assertEq(spell.ROOT_OLD().wards(address(spell)), 0);
assertEq(spell.ROOT_NEW().wards(address(spell)), 0);
}

function _loadDeployment(string memory folder, string memory name) internal {
Expand Down

0 comments on commit 1c2bbbb

Please sign in to comment.