contract JoinFactory is IJoinFactory, AccessControl {

  /// @dev Deploys a new join.
  /// @param asset Address of the asset token.
  /// @return join The join address.
  function createJoin(address asset)
    external override
    auth
    returns (address)
  {
    Join join = new Join(asset);

    join.grantRole(ROOT, msg.sender);
    join.renounceRole(ROOT, address(this));
    
    emit JoinCreated(asset, address(join));

    return address(join);
  }
}
/// @dev The JoinFactory creates new join instances.
function createJoin(address asset)
  external override
  auth
  returns (address)
{
  Join join = new Join(asset);

  join.grantRole(ROOT, msg.sender);
  join.renounceRole(ROOT, address(this));
    
  emit JoinCreated(asset, address(join));

  return address(join);
}

/// @dev Deploys a new join.
/// @param asset Address of the asset token.
/// @return join The join address.