diff --git a/contracts/interfaces/IMasterDeployer.sol b/contracts/interfaces/IMasterDeployer.sol index 61efce23..db8d4209 100644 --- a/contracts/interfaces/IMasterDeployer.sol +++ b/contracts/interfaces/IMasterDeployer.sol @@ -15,6 +15,4 @@ interface IMasterDeployer { function pools(address pool) external view returns (bool); function deployPool(address factory, bytes calldata deployData) external returns (address); - - function owner() external returns (address); } diff --git a/contracts/interfaces/IMasterDeployerV2.sol b/contracts/interfaces/IMasterDeployerV2.sol new file mode 100644 index 00000000..e2561af2 --- /dev/null +++ b/contracts/interfaces/IMasterDeployerV2.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity >=0.8.0; + +import "./IMasterDeployer.sol"; + +/// @notice Trident pool deployer interface. +interface IMasterDeployerV2 is IMasterDeployer { + function barFee() external view returns (uint256); + + function barFeeTo() external view returns (address); + + function bento() external view returns (address); + + function migrator() external view returns (address); + + function pools(address pool) external view returns (bool); + + function deployPool(address factory, bytes calldata deployData) external returns (address); + + function owner() external returns (address); +} diff --git a/contracts/interfaces/IStablePoolFactory.sol b/contracts/interfaces/IStablePoolFactory.sol index ac64eb44..51de37a8 100644 --- a/contracts/interfaces/IStablePoolFactory.sol +++ b/contracts/interfaces/IStablePoolFactory.sol @@ -2,8 +2,8 @@ pragma solidity >=0.8.0; -import "./IMasterDeployer.sol"; +import "./IMasterDeployerV2.sol"; interface IStablePoolFactory { - function getDeployData() external view returns (bytes memory, IMasterDeployer); + function getDeployData() external view returns (bytes memory, IMasterDeployerV2); } diff --git a/contracts/pool/stable/StablePool.sol b/contracts/pool/stable/StablePool.sol index a450107b..49fec0a0 100644 --- a/contracts/pool/stable/StablePool.sol +++ b/contracts/pool/stable/StablePool.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.0; import {ERC20} from "@rari-capital/solmate/src/tokens/ERC20.sol"; import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol"; import {IBentoBoxMinimal} from "../../interfaces/IBentoBoxMinimal.sol"; -import {IMasterDeployer} from "../../interfaces/IMasterDeployer.sol"; +import {IMasterDeployerV2} from "../../interfaces/IMasterDeployerV2.sol"; import {IPool} from "../../interfaces/IPool.sol"; import {IStablePoolFactory} from "../../interfaces/IStablePoolFactory.sol"; import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -39,7 +39,7 @@ contract StablePool is IPool, ERC20, ReentrancyGuard { uint256 internal immutable MAX_FEE_MINUS_SWAP_FEE; IBentoBoxMinimal public immutable bento; - IMasterDeployer public immutable masterDeployer; + IMasterDeployerV2 public immutable masterDeployer; address public immutable token0; address public immutable token1; @@ -56,7 +56,7 @@ contract StablePool is IPool, ERC20, ReentrancyGuard { bytes32 public constant poolIdentifier = "Trident:StablePool"; constructor() ERC20("Sushi Stable LP Token", "SSLP", 18) { - (bytes memory _deployData, IMasterDeployer _masterDeployer) = IStablePoolFactory(msg.sender).getDeployData(); + (bytes memory _deployData, IMasterDeployerV2 _masterDeployer) = IStablePoolFactory(msg.sender).getDeployData(); (address _token0, address _token1, uint256 _swapFee) = abi.decode(_deployData, (address, address, uint256)); diff --git a/contracts/pool/stable/StablePoolFactory.sol b/contracts/pool/stable/StablePoolFactory.sol index bb03bd3e..90207370 100644 --- a/contracts/pool/stable/StablePoolFactory.sol +++ b/contracts/pool/stable/StablePoolFactory.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.0; import {PoolDeployer} from "../../abstract/PoolDeployer.sol"; import {StablePool} from "./StablePool.sol"; import {IStablePoolFactory} from "../../interfaces/IStablePoolFactory.sol"; -import {IMasterDeployer} from "../../interfaces/IMasterDeployer.sol"; +import {IMasterDeployerV2} from "../../interfaces/IMasterDeployerV2.sol"; contract StablePoolFactory is IStablePoolFactory, PoolDeployer { bytes32 public constant bytecodeHash = keccak256(type(StablePool).creationCode); @@ -40,8 +40,8 @@ contract StablePoolFactory is IStablePoolFactory, PoolDeployer { } // This called in the StablePool constructor. - function getDeployData() external view override returns (bytes memory, IMasterDeployer) { - return (cachedDeployData, IMasterDeployer(masterDeployer)); + function getDeployData() external view override returns (bytes memory, IMasterDeployerV2) { + return (cachedDeployData, IMasterDeployerV2(masterDeployer)); } function calculatePoolAddress(