Skip to content

Commit 0f5d32b

Browse files
committed
fix: disable initializers
1 parent ae2d19f commit 0f5d32b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/contracts/extensions/stata-token/StataTokenFactory.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {
3939
ITransparentProxyFactory transparentProxyFactory,
4040
address stataTokenImpl
4141
) {
42+
_disableInitializers();
4243
POOL = pool;
4344
INITIAL_OWNER = initialOwner;
4445
TRANSPARENT_PROXY_FACTORY = transparentProxyFactory;

tests/extensions/stata-token/TestBase.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.10;
33

4+
import {Initializable} from 'openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol';
45
import {IERC20Metadata, IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol';
56
import {TransparentUpgradeableProxy} from 'openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol';
67
import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
@@ -57,6 +58,8 @@ abstract contract BaseTest is TestnetProcedures {
5758
proxyFactory = ITransparentProxyFactory(report.transparentProxyFactory);
5859

5960
factory = StataTokenFactory(report.staticATokenFactoryProxy);
61+
vm.expectRevert(Initializable.InvalidInitialization.selector);
62+
StataTokenFactory(report.staticATokenFactoryImplementation).initialize();
6063
factory.createStataTokens(contracts.poolProxy.getReservesList());
6164

6265
stataTokenV2 = StataTokenV2(factory.getStataToken(underlying));

0 commit comments

Comments
 (0)