Skip to content

Commit

Permalink
Cleanup ProxyFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
m-chrzan committed Oct 16, 2024
1 parent 900c9b3 commit d9b202d
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/protocol/contracts/common/ProxyFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@ pragma solidity ^0.5.13;
import "./Proxy.sol";
import "./interfaces/IProxyFactory.sol";

/**
* @title Used for deploying Proxy contracts.
*/
contract ProxyFactory is IProxyFactory {
// Deploys a new proxy contract and transfers ownership to the provided address
function deployProxy(address owner) external returns (address) {
return _deployProxy(owner);
}

// Deploys a new proxy contract and transfers ownership to the sender
/**
* @notice Deploys a new proxy contract and transfers ownership to the sender
* @return Address of the deployed proxy.
*/
function deployProxy() external returns (address) {
return _deployProxy(msg.sender);
return deployProxy(msg.sender);
}

// Deploys a new proxy contract and transfers ownership to the provided address
function _deployProxy(address owner) private returns (address) {
/**
* @notice Deploys a new proxy contract and transfers ownership to the provided address
* @param owner The address to transfer ownership to.
* @return Address of the deployed proxy.
*/
function deployProxy(address owner) public returns (address) {
Proxy proxy = new Proxy();
proxy._transferOwnership(owner);
return address(proxy);
Expand Down

0 comments on commit d9b202d

Please sign in to comment.