diff --git a/contracts/factory/PoolFactory.sol b/contracts/factory/PoolFactory.sol index 013e2e9f..22c4f9c7 100644 --- a/contracts/factory/PoolFactory.sol +++ b/contracts/factory/PoolFactory.sol @@ -5,8 +5,6 @@ import "@openzeppelin/contracts/access/Ownable.sol"; import "@solarity/solidity-lib/contracts-registry/pools/pool-factory/AbstractPoolFactory.sol"; -import "@spherex-xyz/contracts/src/ProtectedProxies/ProtectedBeaconProxy.sol"; - import "../interfaces/factory/IPoolFactory.sol"; import "../interfaces/core/IContractsRegistry.sol"; import "../interfaces/core/ISBT721.sol"; @@ -23,6 +21,8 @@ import "../gov/validators/GovValidators.sol"; import "../core/CoreProperties.sol"; import {PoolRegistry} from "./PoolRegistry.sol"; +import "../proxy/ProtectedPublicBeaconProxy.sol"; + import "../libs/factory/GovTokenDeployer.sol"; import "../core/Globals.sol"; @@ -257,7 +257,7 @@ contract PoolFactory is IPoolFactory, AbstractPoolFactory { ) internal override returns (address) { return address( - new ProtectedBeaconProxy( + new ProtectedPublicBeaconProxy( AbstractPoolContractsRegistry(poolRegistry).getProxyBeacon(poolType), bytes("") ) @@ -271,7 +271,7 @@ contract PoolFactory is IPoolFactory, AbstractPoolFactory { ) internal override returns (address) { return address( - new ProtectedBeaconProxy{salt: salt}( + new ProtectedPublicBeaconProxy{salt: salt}( AbstractPoolContractsRegistry(poolRegistry).getProxyBeacon(poolType), bytes("") ) @@ -285,7 +285,7 @@ contract PoolFactory is IPoolFactory, AbstractPoolFactory { ) internal view override returns (address) { bytes32 bytecodeHash = keccak256( abi.encodePacked( - type(ProtectedBeaconProxy).creationCode, + type(ProtectedPublicBeaconProxy).creationCode, abi.encode( AbstractPoolContractsRegistry(poolRegistry).getProxyBeacon(poolType), bytes("") diff --git a/contracts/proxy/ProtectedPublicBeaconProxy.sol b/contracts/proxy/ProtectedPublicBeaconProxy.sol new file mode 100644 index 00000000..57463e6f --- /dev/null +++ b/contracts/proxy/ProtectedPublicBeaconProxy.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; + +import "@spherex-xyz/contracts/src/ProtectedProxies/ProtectedBeaconProxy.sol"; + +contract ProtectedPublicBeaconProxy is ProtectedBeaconProxy { + constructor(address beacon, bytes memory data) ProtectedBeaconProxy(beacon, data) {} + + function implementation() external view returns (address) { + return IBeacon(_getBeacon()).implementation(); + } +}