Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial owner as constructor argument #914

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ contract PoolManager is IPoolManager, ProtocolFees, NoDelegateCall, ERC6909Claim
_;
}

constructor(address initialOwner) ProtocolFees(initialOwner) {}

/// @inheritdoc IPoolManager
function unlock(bytes calldata data) external override returns (bytes memory result) {
if (Lock.isUnlocked()) AlreadyUnlocked.selector.revertWith();
Expand Down
2 changes: 1 addition & 1 deletion src/ProtocolFees.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract contract ProtocolFees is IProtocolFees, Owned {
/// @inheritdoc IProtocolFees
address public protocolFeeController;

constructor() Owned(msg.sender) {}
constructor(address initialOwner) Owned(initialOwner) {}

/// @inheritdoc IProtocolFees
function setProtocolFeeController(address controller) external onlyOwner {
Expand Down
2 changes: 2 additions & 0 deletions src/test/ProtocolFeesImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ contract ProtocolFeesImplementation is ProtocolFees {
mapping(PoolId id => Pool.State) internal _pools;
bool internal isUnlocked;

constructor() ProtocolFees(msg.sender) {}

// Used to set the price of a pool to pretend that the pool has been initialized in order to successfully set a protocol fee
function setPrice(PoolKey memory key, uint160 sqrtPriceX96) public {
Pool.State storage pool = _getPool(key.toId());
Expand Down
2 changes: 1 addition & 1 deletion src/test/ProxyPoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract ProxyPoolManager is IPoolManager, ProtocolFees, NoDelegateCall, ERC6909

address internal immutable _delegateManager;

constructor(address delegateManager) {
constructor(address delegateManager) ProtocolFees(msg.sender) {
_delegateManager = delegateManager;
}

Expand Down
2 changes: 1 addition & 1 deletion test/NoDelegateCall.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {Deployers} from "./utils/Deployers.sol";
contract TestDelegateCall is Test, Deployers {
// override to use ProxyPoolManager
function deployFreshManager() internal virtual override {
IPoolManager delegateManager = new PoolManager();
IPoolManager delegateManager = new PoolManager(address(this));
manager = new ProxyPoolManager(address(delegateManager));
}

Expand Down
2 changes: 1 addition & 1 deletion test/utils/Deployers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ contract Deployers is Test {
}

function deployFreshManager() internal virtual {
manager = new PoolManager();
manager = new PoolManager(address(this));
}

function deployFreshManagerAndRouters() internal {
Expand Down
Loading