Skip to content

Commit

Permalink
feat: make factory immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Feb 1, 2024
1 parent ad5bdf5 commit 9ade316
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/TokenizedStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ contract TokenizedStrategy {

/// @notice Address of the previously deployed Vault factory that the
// protocol fee config is retrieved from.
// NOTE: This will be set to deployed factory. deterministic address for testing is used now
address public constant FACTORY =
0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f;
address public immutable FACTORY;

/**
* @dev Custom storage slot that will be used to store the
Expand Down Expand Up @@ -2038,8 +2036,10 @@ contract TokenizedStrategy {
/**
* @dev On contract creation we set `asset` for this contract to address(1).
* This prevents it from ever being initialized in the future.
* @param _factory Address of the factory of the same version for protocol fees.
*/
constructor() {
constructor(address _factory) {
FACTORY = _factory;
_strategyStorage().asset = ERC20(address(1));
}
}
2 changes: 1 addition & 1 deletion src/test/utils/Setup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract Setup is ExtendedTest, IEvents {
mockFactory = new MockFactory(0, protocolFeeRecipient);

// Deploy the implementation for deterministic location
tokenizedStrategy = new TokenizedStrategy();
tokenizedStrategy = new TokenizedStrategy(address(mockFactory));

// create asset we will be using as the underlying asset
asset = new ERC20Mock();
Expand Down

0 comments on commit 9ade316

Please sign in to comment.