Skip to content

Commit

Permalink
Make tranche token factory fileable (#224)
Browse files Browse the repository at this point in the history
* Make tranche token factory fileable

* IERC20Metadata => IERC20

* Revert erc20 interfaces

* Undo interface change again
  • Loading branch information
hieronx authored Dec 19, 2023
1 parent 2f07d31 commit 333cc86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ contract PoolManager is Auth {
uint8 internal constant MAX_DECIMALS = 18;

EscrowLike public immutable escrow;
TrancheTokenFactoryLike public immutable trancheTokenFactory;

GatewayLike public gateway;
InvestmentManagerLike public investmentManager;
TrancheTokenFactoryLike public trancheTokenFactory;
LiquidityPoolFactoryLike public liquidityPoolFactory;
RestrictionManagerFactoryLike public restrictionManagerFactory;

Expand Down Expand Up @@ -155,8 +155,9 @@ contract PoolManager is Auth {
function file(bytes32 what, address data) external auth {
if (what == "gateway") gateway = GatewayLike(data);
else if (what == "investmentManager") investmentManager = InvestmentManagerLike(data);
else if (what == "restrictionManagerFactory") restrictionManagerFactory = RestrictionManagerFactoryLike(data);
else if (what == "trancheTokenFactory") trancheTokenFactory = TrancheTokenFactoryLike(data);
else if (what == "liquidityPoolFactory") liquidityPoolFactory = LiquidityPoolFactoryLike(data);
else if (what == "restrictionManagerFactory") restrictionManagerFactory = RestrictionManagerFactoryLike(data);
else revert("PoolManager/file-unrecognized-param");
emit File(what, data);
}
Expand Down
4 changes: 4 additions & 0 deletions test/PoolManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ contract PoolManagerTest is TestSetup {
poolManager.file("investmentManager", newInvestmentManager);
assertEq(address(poolManager.investmentManager()), newInvestmentManager);

address newTrancheTokenFactory = makeAddr("newTrancheTokenFactory");
poolManager.file("trancheTokenFactory", newTrancheTokenFactory);
assertEq(address(poolManager.trancheTokenFactory()), newTrancheTokenFactory);

address newRestrictionManagerFactory = makeAddr("newRestrictionManagerFactory");
poolManager.file("restrictionManagerFactory", newRestrictionManagerFactory);
assertEq(address(poolManager.restrictionManagerFactory()), newRestrictionManagerFactory);
Expand Down

0 comments on commit 333cc86

Please sign in to comment.