contract DesignatedVotingFactory is Withdrawable {

    enum Roles {
        // Can withdraw any ETH or ERC20 sent accidentally to this contract.
        Withdrawer
    }

    address private finder;
    mapping(address => DesignatedVoting) public designatedVotingContracts;

    constructor(address finderAddress) public {
        finder = finderAddress;

        createWithdrawRole(uint(Roles.Withdrawer), uint(Roles.Withdrawer), msg.sender);
    }

    /**
     * @notice Deploys a new `DesignatedVoting` contract.
     */
    function newDesignatedVoting(address ownerAddress) external returns (DesignatedVoting designatedVoting) {
        require(address(designatedVotingContracts[msg.sender]) == address(0), "Duplicate hot key not permitted");

        designatedVoting = new DesignatedVoting(finder, ownerAddress, msg.sender);
        designatedVotingContracts[msg.sender] = designatedVoting;
    }

    /**
     * @notice Associates a `DesignatedVoting` instance with `msg.sender`.
     */
    function setDesignatedVoting(address designatedVotingAddress) external {
        require(address(designatedVotingContracts[msg.sender]) == address(0), "Duplicate hot key not permitted");
        designatedVotingContracts[msg.sender] = DesignatedVoting(designatedVotingAddress);
    }
}
function setDesignatedVoting(address designatedVotingAddress) external {
    require(address(designatedVotingContracts[msg.sender]) == address(0), "Duplicate hot key not permitted");
    designatedVotingContracts[msg.sender] = DesignatedVoting(designatedVotingAddress);
}

/**
 * @notice Associates a `DesignatedVoting` instance with `msg.sender`.
 */